From f909f6cfd8a5c9aa3c30fd429764b3d233d47406 Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Mon, 12 May 2025 11:56:38 +0200 Subject: [PATCH 01/13] Adding API to create Property Field with location --- src/ansys/dpf/core/property_field.py | 2 +- src/ansys/dpf/gate/generated/property_field_abstract_api.py | 2 +- src/ansys/dpf/gate/generated/property_field_capi.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index 6434db8c5dc..79a7eae51e4 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -128,7 +128,7 @@ def _field_create_internal_obj( client, nentities, nentities * dim.component_count ) else: - return api.csproperty_field_new(nentities, nentities * dim.component_count) + return api.csproperty_field_new_location(nentities, nentities * dim.component_count, location) @version_requires("8.1") def _load_field_definition(self): diff --git a/src/ansys/dpf/gate/generated/property_field_abstract_api.py b/src/ansys/dpf/gate/generated/property_field_abstract_api.py index f57282c5cdd..35c5e644aa6 100644 --- a/src/ansys/dpf/gate/generated/property_field_abstract_api.py +++ b/src/ansys/dpf/gate/generated/property_field_abstract_api.py @@ -40,7 +40,7 @@ def property_field_get_location(field): raise NotImplementedError @staticmethod - def csproperty_field_new(numEntities, data_size): + def csproperty_field_new_location(numEntities, data_size, location): raise NotImplementedError @staticmethod diff --git a/src/ansys/dpf/gate/generated/property_field_capi.py b/src/ansys/dpf/gate/generated/property_field_capi.py index b788948c43c..fbee93492bd 100644 --- a/src/ansys/dpf/gate/generated/property_field_capi.py +++ b/src/ansys/dpf/gate/generated/property_field_capi.py @@ -83,10 +83,10 @@ def property_field_get_location(field): return newres @staticmethod - def csproperty_field_new(numEntities, data_size): + def csproperty_field_new_location(numEntities, data_size, location): errorSize = ctypes.c_int(0) sError = ctypes.c_wchar_p() - res = capi.dll.CSPropertyField_new(utils.to_int32(numEntities), utils.to_int32(data_size), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError)) + res = capi.dll.CSPropertyField_new_location(utils.to_int32(numEntities), utils.to_int32(data_size), utils.to_char_ptr(location), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError)) if errorSize.value != 0: raise errors.DPFServerException(sError.value) return res From 18c09362f06a2f25eb4af06218c01d74b2b03284 Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Thu, 29 May 2025 17:50:11 +0200 Subject: [PATCH 02/13] Supporting versions in property field --- src/ansys/dpf/core/custom_type_field.py | 3 +- src/ansys/dpf/core/field.py | 3 +- src/ansys/dpf/core/field_base.py | 4 +-- src/ansys/dpf/core/fields_factory.py | 2 +- src/ansys/dpf/core/property_field.py | 34 +++++++++++++------ src/ansys/dpf/core/string_field.py | 3 +- .../generated/property_field_abstract_api.py | 4 +++ .../dpf/gate/generated/property_field_capi.py | 9 +++++ 8 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/ansys/dpf/core/custom_type_field.py b/src/ansys/dpf/core/custom_type_field.py index 863711a5415..4ffc686e232 100644 --- a/src/ansys/dpf/core/custom_type_field.py +++ b/src/ansys/dpf/core/custom_type_field.py @@ -169,7 +169,7 @@ def _init_api_env(self): @staticmethod def _field_create_internal_obj( api, - client, + server, nature, nentities, location=locations.nodal, @@ -178,6 +178,7 @@ def _field_create_internal_obj( with_type=None, ): dpf_type_name = numpy_type_to_dpf[with_type] + client = server.client if client is not None: return api.cscustom_type_field_new_on_client( client, dpf_type_name, with_type.itemsize, nentities, nentities diff --git a/src/ansys/dpf/core/field.py b/src/ansys/dpf/core/field.py index 259ddfaef00..97dc4e81c43 100644 --- a/src/ansys/dpf/core/field.py +++ b/src/ansys/dpf/core/field.py @@ -234,7 +234,7 @@ def _init_api_env(self): @staticmethod def _field_create_internal_obj( api: field_abstract_api.FieldAbstractAPI, - client, + server, nature, nentities, location=locations.nodal, @@ -243,6 +243,7 @@ def _field_create_internal_obj( with_type=None, ): dim = dimensionality.Dimensionality([ncomp_n, ncomp_m], nature) + client = server.client if dim.is_1d_dim(): if client is not None: diff --git a/src/ansys/dpf/core/field_base.py b/src/ansys/dpf/core/field_base.py index 36046522d12..537dd58c0f6 100644 --- a/src/ansys/dpf/core/field_base.py +++ b/src/ansys/dpf/core/field_base.py @@ -77,7 +77,7 @@ def __init__( else: self._internal_obj = self.__class__._field_create_internal_obj( self._api, - client=self._server.client, + server=self._server, nature=nature, nentities=nentities, location=location, @@ -97,7 +97,7 @@ def _api(self): @abstractmethod def _field_create_internal_obj( api: field_abstract_api.FieldAbstractAPI, - client, + server, nature, nentities, location=locations.nodal, diff --git a/src/ansys/dpf/core/fields_factory.py b/src/ansys/dpf/core/fields_factory.py index 11964cc0517..386fe396d2d 100644 --- a/src/ansys/dpf/core/fields_factory.py +++ b/src/ansys/dpf/core/fields_factory.py @@ -393,7 +393,7 @@ def _create_field( api.init_field_environment(server) internal_obj = Field._field_create_internal_obj( api=api, - client=server.client, + server=server, nature=nature, nentities=n_entities, location=str(location), diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index 79a7eae51e4..86887bc5d11 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -91,7 +91,7 @@ def __init__( field=property_field, server=server, ) - self._field_definition_instance = None + self._field_definition_instance = self._load_field_definition() @property def _api(self) -> property_field_abstract_api.PropertyFieldAbstractAPI: @@ -114,7 +114,7 @@ def _init_api_env(self): @staticmethod def _field_create_internal_obj( api: property_field_abstract_api.PropertyFieldAbstractAPI, - client, + server, nature, nentities, location=locations.nodal, @@ -123,12 +123,21 @@ def _field_create_internal_obj( with_type=None, ): dim = dimensionality.Dimensionality([ncomp_n, ncomp_m], nature) - if client is not None: - return api.csproperty_field_new_on_client( - client, nentities, nentities * dim.component_count - ) + client = server.client + if meets_version(server.version, "11.0"): + if client is not None: + return api.csproperty_field_new_location_on_client( + client, nentities, nentities * dim.component_count, location + ) + else: + return api.csproperty_field_new_location(nentities, nentities * dim.component_count, location) else: - return api.csproperty_field_new_location(nentities, nentities * dim.component_count, location) + if client is not None: + return api.csproperty_field_new_on_client( + client, nentities, nentities * dim.component_count + ) + else: + return api.csproperty_field_new(nentities, nentities * dim.component_count) @version_requires("8.1") def _load_field_definition(self): @@ -152,7 +161,7 @@ def location(self): Examples -------- - Create a property field and request the location. + Create a property field and request the location. ##TODO Important, modify this example! as well as the description >>> from ansys.dpf import core as dpf >>> pfield = dpf.PropertyField() @@ -164,8 +173,13 @@ def location(self): 'Nodal' """ - location = self.scoping.location - return location if location else None + if meets_version(self._server.version, "11.0"): + if self._field_definition: + return self._field_definition.location + if self.scoping: + return self.scoping.location + else: + return None @location.setter def location(self, value): diff --git a/src/ansys/dpf/core/string_field.py b/src/ansys/dpf/core/string_field.py index b767aab7b6f..4e29f4fc0bb 100644 --- a/src/ansys/dpf/core/string_field.py +++ b/src/ansys/dpf/core/string_field.py @@ -103,7 +103,7 @@ def _init_api_env(self): @staticmethod def _field_create_internal_obj( api: string_field_abstract_api.StringFieldAbstractAPI, - client, + server, nature, nentities, location=locations.nodal, @@ -111,6 +111,7 @@ def _field_create_internal_obj( ncomp_m=0, with_type=None, ): + client = server.client if client is not None: return api.csstring_field_new_on_client(client, nentities, nentities) else: diff --git a/src/ansys/dpf/gate/generated/property_field_abstract_api.py b/src/ansys/dpf/gate/generated/property_field_abstract_api.py index 35c5e644aa6..901cf024b68 100644 --- a/src/ansys/dpf/gate/generated/property_field_abstract_api.py +++ b/src/ansys/dpf/gate/generated/property_field_abstract_api.py @@ -39,6 +39,10 @@ def property_field_get_entity_data_by_id(field, EntityId, size): def property_field_get_location(field): raise NotImplementedError + @staticmethod + def csproperty_field_new(numEntities, data_size): + raise NotImplementedError + @staticmethod def csproperty_field_new_location(numEntities, data_size, location): raise NotImplementedError diff --git a/src/ansys/dpf/gate/generated/property_field_capi.py b/src/ansys/dpf/gate/generated/property_field_capi.py index fbee93492bd..0cbe5956f90 100644 --- a/src/ansys/dpf/gate/generated/property_field_capi.py +++ b/src/ansys/dpf/gate/generated/property_field_capi.py @@ -82,6 +82,15 @@ def property_field_get_location(field): capi.dll.DataProcessing_String_post_event(res, ctypes.byref(errorSize), ctypes.byref(sError)) return newres + @staticmethod + def csproperty_field_new(numEntities, data_size): + errorSize = ctypes.c_int(0) + sError = ctypes.c_wchar_p() + res = capi.dll.CSPropertyField_new(utils.to_int32(numEntities), utils.to_int32(data_size), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError)) + if errorSize.value != 0: + raise errors.DPFServerException(sError.value) + return res + @staticmethod def csproperty_field_new_location(numEntities, data_size, location): errorSize = ctypes.c_int(0) From a9a8c1ae358be46dc80980dab81707d72c2f5dc1 Mon Sep 17 00:00:00 2001 From: PProfizi <100710998+PProfizi@users.noreply.github.com> Date: Fri, 30 May 2025 07:18:23 +0000 Subject: [PATCH 03/13] update generated code --- .../dpf/gate/generated/property_field_abstract_api.py | 5 ----- src/ansys/dpf/gate/generated/property_field_capi.py | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/src/ansys/dpf/gate/generated/property_field_abstract_api.py b/src/ansys/dpf/gate/generated/property_field_abstract_api.py index 901cf024b68..9e029411849 100644 --- a/src/ansys/dpf/gate/generated/property_field_abstract_api.py +++ b/src/ansys/dpf/gate/generated/property_field_abstract_api.py @@ -47,11 +47,6 @@ def csproperty_field_new(numEntities, data_size): def csproperty_field_new_location(numEntities, data_size, location): raise NotImplementedError - @staticmethod - def csproperty_field_new_location(numEntities, data_size, location): - raise NotImplementedError - - @staticmethod def csproperty_field_new_with_transformation(numEntities, data_size, wf, input_name, output_name): raise NotImplementedError diff --git a/src/ansys/dpf/gate/generated/property_field_capi.py b/src/ansys/dpf/gate/generated/property_field_capi.py index 0cbe5956f90..b51579f585b 100644 --- a/src/ansys/dpf/gate/generated/property_field_capi.py +++ b/src/ansys/dpf/gate/generated/property_field_capi.py @@ -100,16 +100,6 @@ def csproperty_field_new_location(numEntities, data_size, location): raise errors.DPFServerException(sError.value) return res - @staticmethod - def csproperty_field_new_location(numEntities, data_size, location): - errorSize = ctypes.c_int(0) - sError = ctypes.c_wchar_p() - res = capi.dll.CSPropertyField_new_location(utils.to_int32(numEntities), utils.to_int32(data_size), utils.to_char_ptr(location), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError)) - if errorSize.value != 0: - raise errors.DPFServerException(sError.value) - return res - - @staticmethod def csproperty_field_new_with_transformation(numEntities, data_size, wf, input_name, output_name): errorSize = ctypes.c_int(0) sError = ctypes.c_wchar_p() From 524069aa033d6e9b73e6d091668f6a35cf88100d Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Tue, 22 Jul 2025 12:21:13 +0200 Subject: [PATCH 04/13] Updating non-generated-grpc code and issue with FieldDef --- src/ansys/dpf/core/property_field.py | 9 +++++++-- src/ansys/dpf/gate/property_field_grpcapi.py | 10 ++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index 86887bc5d11..b0bb5243b6e 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -91,7 +91,10 @@ def __init__( field=property_field, server=server, ) - self._field_definition_instance = self._load_field_definition() + if meets_version(server.version, "11.0"): + self._field_definition_instance = self._load_field_definition() + else: + self._field_definition_instance = None @property def _api(self) -> property_field_abstract_api.PropertyFieldAbstractAPI: @@ -130,7 +133,9 @@ def _field_create_internal_obj( client, nentities, nentities * dim.component_count, location ) else: - return api.csproperty_field_new_location(nentities, nentities * dim.component_count, location) + return api.csproperty_field_new_location( + nentities, nentities * dim.component_count, location + ) else: if client is not None: return api.csproperty_field_new_on_client( diff --git a/src/ansys/dpf/gate/property_field_grpcapi.py b/src/ansys/dpf/gate/property_field_grpcapi.py index 0f6d59afe53..ae7612754fc 100644 --- a/src/ansys/dpf/gate/property_field_grpcapi.py +++ b/src/ansys/dpf/gate/property_field_grpcapi.py @@ -24,6 +24,16 @@ def csproperty_field_new_on_client(client, numEntities, data_size): request.datatype = "int" return field_grpcapi._get_stub(client).Create(request) + @staticmethod + def csproperty_field_new_location_on_client(client, numEntities, data_size, location): + from ansys.grpc.dpf import field_pb2 + request = field_pb2.FieldRequest() + request.size.scoping_size = numEntities + request.size.data_size = data_size + request.location.location = location + request.datatype = "int" + return field_grpcapi._get_stub(client).Create(request) + @staticmethod def csproperty_field_get_number_elementary_data(field): return api_to_call.csfield_get_number_elementary_data(field) From fcdbfab70852dc683c1e0fd8ad42f5711380c3c4 Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Tue, 22 Jul 2025 16:39:59 +0200 Subject: [PATCH 05/13] Adding check for plugin cases --- src/ansys/dpf/core/property_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index b0bb5243b6e..9253cf1f2df 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -91,7 +91,7 @@ def __init__( field=property_field, server=server, ) - if meets_version(server.version, "11.0"): + if server is not None and meets_version(server.version, "11.0"): self._field_definition_instance = self._load_field_definition() else: self._field_definition_instance = None From 99ed06cf1edd5e297cba737ec0fa2195ad63d673 Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Thu, 24 Jul 2025 09:27:54 +0200 Subject: [PATCH 06/13] Modifying examples --- src/ansys/dpf/core/property_field.py | 37 +++++++++++++++++++--------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index 9253cf1f2df..c805beaa8e9 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -155,8 +155,8 @@ def _load_field_definition(self): def location(self): """Location of the property field. - A property field contains a scoping, which is the location that is read. - To update location, directly update the scoping location. + The property field location is the one contained in its field definition. + To update location, just update the property field location. Returns ------- @@ -166,14 +166,11 @@ def location(self): Examples -------- - Create a property field and request the location. ##TODO Important, modify this example! as well as the description + Create a property field and request the location. >>> from ansys.dpf import core as dpf >>> pfield = dpf.PropertyField() - >>> list_ids = [1, 2, 4, 6, 7] - >>> scop = dpf.Scoping(ids = list_ids, location = dpf.locations.nodal) - >>> pfield.scoping = scop - >>> pfield.scoping.location = dpf.locations.nodal + >>> pfield.location = dpf.locations.nodal >>> pfield.location 'Nodal' @@ -181,7 +178,7 @@ def location(self): if meets_version(self._server.version, "11.0"): if self._field_definition: return self._field_definition.location - if self.scoping: + elif self.scoping: return self.scoping.location else: return None @@ -200,14 +197,32 @@ def location(self, value): -------- >>> from ansys.dpf import core as dpf >>> pfield = dpf.PropertyField() - >>> scop = dpf.Scoping(ids = list_ids, location = dpf.locations.nodal) - >>> pfield.scoping = scop + >>> list_ids = [1, 2, 4, 6, 7] >>> pfield.location = 'Nodal' >>> pfield.location 'Nodal' """ - self.scoping.location = value + if meets_version(self._server.version, "11.0"): + if self._field_definition: + self._field_definition.location = value + else: + raise Exception( + "Property field location is based on field definition, and field definition is not defined" + ) + elif self.scoping: + self.scoping.location = value + else: + raise Exception( + "Property field location before v11.0 was based on scoping, and scoping is not defined" + ) + + if self.scoping: + self.scoping.location = value + else: + raise Exception( + "Property field location is based on scoping, and scoping is not defined" + ) @property def component_count(self): From 238d9f0a187c15bb382994cce3315e118ad53981 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Wed, 30 Jul 2025 12:07:29 +0200 Subject: [PATCH 07/13] Attempt to fix --- src/ansys/dpf/core/field.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ansys/dpf/core/field.py b/src/ansys/dpf/core/field.py index 97dc4e81c43..16be4c7ef48 100644 --- a/src/ansys/dpf/core/field.py +++ b/src/ansys/dpf/core/field.py @@ -660,9 +660,7 @@ def unit(self, value: str | tuple[Homogeneity, str]): Setting a named dimensionless unit requires DPF 11.0 (2026 R1) or above. """ - field_def = self.field_definition - field_def.unit = value - self.field_definition = field_def + self.field_definition.unit = value @property def dimensionality(self): From a72bfdf33457d86e704483e3dde85444a3044063 Mon Sep 17 00:00:00 2001 From: PProfizi <100710998+PProfizi@users.noreply.github.com> Date: Wed, 30 Jul 2025 12:55:45 +0000 Subject: [PATCH 08/13] update generated code --- .../dpf/gate/generated/property_field_abstract_api.py | 4 ++++ src/ansys/dpf/gate/generated/property_field_capi.py | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ansys/dpf/gate/generated/property_field_abstract_api.py b/src/ansys/dpf/gate/generated/property_field_abstract_api.py index 9e029411849..dd335a55ae8 100644 --- a/src/ansys/dpf/gate/generated/property_field_abstract_api.py +++ b/src/ansys/dpf/gate/generated/property_field_abstract_api.py @@ -47,6 +47,10 @@ def csproperty_field_new(numEntities, data_size): def csproperty_field_new_location(numEntities, data_size, location): raise NotImplementedError +<<<<<<< HEAD +======= + @staticmethod +>>>>>>> 9e1687ce7 (update generated code) def csproperty_field_new_with_transformation(numEntities, data_size, wf, input_name, output_name): raise NotImplementedError diff --git a/src/ansys/dpf/gate/generated/property_field_capi.py b/src/ansys/dpf/gate/generated/property_field_capi.py index b51579f585b..5b3fb052e1e 100644 --- a/src/ansys/dpf/gate/generated/property_field_capi.py +++ b/src/ansys/dpf/gate/generated/property_field_capi.py @@ -92,14 +92,6 @@ def csproperty_field_new(numEntities, data_size): return res @staticmethod - def csproperty_field_new_location(numEntities, data_size, location): - errorSize = ctypes.c_int(0) - sError = ctypes.c_wchar_p() - res = capi.dll.CSPropertyField_new_location(utils.to_int32(numEntities), utils.to_int32(data_size), utils.to_char_ptr(location), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError)) - if errorSize.value != 0: - raise errors.DPFServerException(sError.value) - return res - def csproperty_field_new_with_transformation(numEntities, data_size, wf, input_name, output_name): errorSize = ctypes.c_int(0) sError = ctypes.c_wchar_p() From 54494308e5af42210393c91f29f86caa72e94ddf Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Wed, 30 Jul 2025 16:35:59 +0200 Subject: [PATCH 09/13] self --- src/ansys/dpf/core/property_field.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index c805beaa8e9..244bb94d7da 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -91,7 +91,7 @@ def __init__( field=property_field, server=server, ) - if server is not None and meets_version(server.version, "11.0"): + if meets_version(self._server.version, "11.0"): self._field_definition_instance = self._load_field_definition() else: self._field_definition_instance = None From 454ae0408f4ed882872fde324383ece043b618c9 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Thu, 31 Jul 2025 09:17:22 +0200 Subject: [PATCH 10/13] Add return --- src/ansys/dpf/core/property_field.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index 244bb94d7da..3c2b1b2704e 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -206,22 +206,17 @@ def location(self, value): if meets_version(self._server.version, "11.0"): if self._field_definition: self._field_definition.location = value + return else: raise Exception( "Property field location is based on field definition, and field definition is not defined" ) elif self.scoping: self.scoping.location = value + return else: raise Exception( - "Property field location before v11.0 was based on scoping, and scoping is not defined" - ) - - if self.scoping: - self.scoping.location = value - else: - raise Exception( - "Property field location is based on scoping, and scoping is not defined" + "Property field location before is based on scoping, and scoping is not defined" ) @property From b110d2b7b0c6acf3ad2c88471da2955a3a526140 Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Fri, 1 Aug 2025 11:11:15 +0200 Subject: [PATCH 11/13] Fixing issue of rebase --- src/ansys/dpf/gate/generated/property_field_abstract_api.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/ansys/dpf/gate/generated/property_field_abstract_api.py b/src/ansys/dpf/gate/generated/property_field_abstract_api.py index dd335a55ae8..9e029411849 100644 --- a/src/ansys/dpf/gate/generated/property_field_abstract_api.py +++ b/src/ansys/dpf/gate/generated/property_field_abstract_api.py @@ -47,10 +47,6 @@ def csproperty_field_new(numEntities, data_size): def csproperty_field_new_location(numEntities, data_size, location): raise NotImplementedError -<<<<<<< HEAD -======= - @staticmethod ->>>>>>> 9e1687ce7 (update generated code) def csproperty_field_new_with_transformation(numEntities, data_size, wf, input_name, output_name): raise NotImplementedError From b58d056561e0dcffc6605f46c845396e4f250bfe Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Fri, 1 Aug 2025 15:18:08 +0200 Subject: [PATCH 12/13] Fixing issues with rebase --- .../dpf/gate/generated/property_field_abstract_api.py | 1 + src/ansys/dpf/gate/generated/property_field_capi.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/ansys/dpf/gate/generated/property_field_abstract_api.py b/src/ansys/dpf/gate/generated/property_field_abstract_api.py index 9e029411849..f57282c5cdd 100644 --- a/src/ansys/dpf/gate/generated/property_field_abstract_api.py +++ b/src/ansys/dpf/gate/generated/property_field_abstract_api.py @@ -47,6 +47,7 @@ def csproperty_field_new(numEntities, data_size): def csproperty_field_new_location(numEntities, data_size, location): raise NotImplementedError + @staticmethod def csproperty_field_new_with_transformation(numEntities, data_size, wf, input_name, output_name): raise NotImplementedError diff --git a/src/ansys/dpf/gate/generated/property_field_capi.py b/src/ansys/dpf/gate/generated/property_field_capi.py index 5b3fb052e1e..b788948c43c 100644 --- a/src/ansys/dpf/gate/generated/property_field_capi.py +++ b/src/ansys/dpf/gate/generated/property_field_capi.py @@ -91,6 +91,15 @@ def csproperty_field_new(numEntities, data_size): raise errors.DPFServerException(sError.value) return res + @staticmethod + def csproperty_field_new_location(numEntities, data_size, location): + errorSize = ctypes.c_int(0) + sError = ctypes.c_wchar_p() + res = capi.dll.CSPropertyField_new_location(utils.to_int32(numEntities), utils.to_int32(data_size), utils.to_char_ptr(location), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError)) + if errorSize.value != 0: + raise errors.DPFServerException(sError.value) + return res + @staticmethod def csproperty_field_new_with_transformation(numEntities, data_size, wf, input_name, output_name): errorSize = ctypes.c_int(0) From 443bfa261f4a5f487d4578c259b63452aa7b549b Mon Sep 17 00:00:00 2001 From: Josip Vidal Orlovac Date: Fri, 1 Aug 2025 17:03:18 +0200 Subject: [PATCH 13/13] Implementing comment from verifier --- src/ansys/dpf/core/property_field.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ansys/dpf/core/property_field.py b/src/ansys/dpf/core/property_field.py index 3c2b1b2704e..6d5dbe294be 100644 --- a/src/ansys/dpf/core/property_field.py +++ b/src/ansys/dpf/core/property_field.py @@ -91,10 +91,7 @@ def __init__( field=property_field, server=server, ) - if meets_version(self._server.version, "11.0"): - self._field_definition_instance = self._load_field_definition() - else: - self._field_definition_instance = None + self._field_definition_instance = None @property def _api(self) -> property_field_abstract_api.PropertyFieldAbstractAPI: