From 24a14f36a3df7d1473e85a402bf5d5936edf5f15 Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Thu, 22 May 2025 13:02:50 +0200 Subject: [PATCH 1/3] Fill the values in the Beam3 ElementDescriptor --- src/ansys/dpf/core/elements.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ansys/dpf/core/elements.py b/src/ansys/dpf/core/elements.py index 15515401f8..70c9c478d6 100644 --- a/src/ansys/dpf/core/elements.py +++ b/src/ansys/dpf/core/elements.py @@ -1219,7 +1219,9 @@ def _descriptors(): ), element_types.Edge2: ElementDescriptor(element_types.Edge2, "Edge2", "edge2", "beam"), element_types.Edge3: ElementDescriptor(element_types.Edge3, "Edge3", "edge3", "beam"), - element_types.Beam3: ElementDescriptor(element_types.Beam3, "Beam3", "beam3", "beam"), + element_types.Beam3: ElementDescriptor( + element_types.Beam3, "Beam3", "beam3", "beam", 2, 0, 3, False, False, True, False + ), element_types.Beam4: ElementDescriptor(element_types.Beam4, "Beam4", "beam4", "beam"), element_types.GeneralPlaceholder: ElementDescriptor( element_types.GeneralPlaceholder, From 36a95ad1c01fe06a21d9d8ab1301bb4db0d5928f Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Thu, 22 May 2025 14:04:05 +0200 Subject: [PATCH 2/3] Revert "Fill the values in the Beam3 ElementDescriptor" This reverts commit 24a14f36a3df7d1473e85a402bf5d5936edf5f15. --- src/ansys/dpf/core/elements.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ansys/dpf/core/elements.py b/src/ansys/dpf/core/elements.py index 70c9c478d6..15515401f8 100644 --- a/src/ansys/dpf/core/elements.py +++ b/src/ansys/dpf/core/elements.py @@ -1219,9 +1219,7 @@ def _descriptors(): ), element_types.Edge2: ElementDescriptor(element_types.Edge2, "Edge2", "edge2", "beam"), element_types.Edge3: ElementDescriptor(element_types.Edge3, "Edge3", "edge3", "beam"), - element_types.Beam3: ElementDescriptor( - element_types.Beam3, "Beam3", "beam3", "beam", 2, 0, 3, False, False, True, False - ), + element_types.Beam3: ElementDescriptor(element_types.Beam3, "Beam3", "beam3", "beam"), element_types.Beam4: ElementDescriptor(element_types.Beam4, "Beam4", "beam4", "beam"), element_types.GeneralPlaceholder: ElementDescriptor( element_types.GeneralPlaceholder, From d3703a84b6c43e9003c0f9a5b7e5a36e763b4feb Mon Sep 17 00:00:00 2001 From: Rafael Canton Date: Fri, 13 Jun 2025 09:42:54 +0200 Subject: [PATCH 3/3] Experimental - remove _result_properties --- src/ansys/dpf/core/available_result.py | 52 +------------------------- src/ansys/dpf/core/result_info.py | 10 +---- src/ansys/dpf/core/results.py | 7 +--- 3 files changed, 5 insertions(+), 64 deletions(-) diff --git a/src/ansys/dpf/core/available_result.py b/src/ansys/dpf/core/available_result.py index c90012f922..4e76733b64 100644 --- a/src/ansys/dpf/core/available_result.py +++ b/src/ansys/dpf/core/available_result.py @@ -200,8 +200,6 @@ def name(self): """Result operator.""" if self._properties and "scripting_name" in self._properties.keys(): name = self._properties["scripting_name"] - elif self.operator_name in _result_properties: - name = _result_properties[self.operator_name]["scripting_name"] else: name = _remove_spaces(self._physics_name) return _make_as_function_name(name) @@ -266,8 +264,8 @@ def native_location(self): """Native location of the result.""" if hasattr(self, "_properties") and "location" in self._properties.keys(): return self._properties["location"] - if self.operator_name in _result_properties: - return _result_properties[self.operator_name]["location"] + else: + return "" @property def native_scoping_location(self): @@ -307,52 +305,6 @@ def qualifier_combinations(self) -> List[dict]: return [q.__dict__() for q in self.qualifiers] -_result_properties = { - "S": {"location": "ElementalNodal", "scripting_name": "stress"}, - "ENF": {"location": "ElementalNodal", "scripting_name": "element_nodal_forces"}, - "EPEL": {"location": "ElementalNodal", "scripting_name": "elastic_strain"}, - "EPPL": {"location": "ElementalNodal", "scripting_name": "plastic_strain"}, - "ECR": {"location": "ElementalNodal", "scripting_name": "creep_strain"}, - "BFE": {"location": "ElementalNodal", "scripting_name": "structural_temperature"}, - "ETH": {"location": "ElementalNodal", "scripting_name": "thermal_strain"}, - "ETH_SWL": {"location": "ElementalNodal", "scripting_name": "swelling_strains"}, - "ENG_VOL": {"location": "Elemental", "scripting_name": "elemental_volume"}, - "ENG_SE": {"location": "Elemental", "scripting_name": "stiffness_matrix_energy"}, - "ENG_AHO": { - "location": "Elemental", - "scripting_name": "artificial_hourglass_energy", - }, - "ENG_KE": {"location": "Elemental", "scripting_name": "kinetic_energy"}, - "ENG_CO": {"location": "Elemental", "scripting_name": "co_energy"}, - "ENG_INC": {"location": "Elemental", "scripting_name": "incremental_energy"}, - "ENG_TH": {"location": "Elemental", "scripting_name": "thermal_dissipation_energy"}, - "U": {"location": "Nodal", "scripting_name": "displacement"}, - "V": {"location": "Nodal", "scripting_name": "velocity"}, - "A": {"location": "Nodal", "scripting_name": "acceleration"}, - "RF": {"location": "Nodal", "scripting_name": "reaction_force"}, - "F": {"location": "Nodal", "scripting_name": "nodal_force"}, - "M": {"location": "Nodal", "scripting_name": "nodal_moment"}, - "TEMP": {"location": "Nodal", "scripting_name": "temperature"}, - "EF": {"location": "ElementalNodal", "scripting_name": "electric_field"}, - "VOLT": {"location": "Nodal", "scripting_name": "electric_potential"}, - "TF": {"location": "ElementalNodal", "scripting_name": "heat_flux"}, - "UTOT": {"location": "Nodal", "scripting_name": "raw_displacement"}, - "RFTOT": {"location": "Nodal", "scripting_name": "raw_reaction_force"}, - "ECT_STAT": {"location": "ElementalNodal", "scripting_name": "contact_status"}, - "ECT_PRES": {"location": "ElementalNodal", "scripting_name": "contact_pressure"}, - "ECT_PENE": {"location": "ElementalNodal", "scripting_name": "contact_penetration"}, - "ECT_SLIDE": {"location": "ElementalNodal", "scripting_name": "contact_sliding_distance"}, - "ECT_GAP": {"location": "ElementalNodal", "scripting_name": "contact_gap_distance"}, - "ECT_SFRIC": {"location": "ElementalNodal", "scripting_name": "contact_friction_stress"}, - "ECT_STOT": {"location": "ElementalNodal", "scripting_name": "contact_total_stress"}, - "ECT_FRES": { - "location": "ElementalNodal", - "scripting_name": "contact_fluid_penetration_pressure", - }, - "ECT_FLUX": {"location": "ElementalNodal", "scripting_name": "contact_surface_heat_flux"}, -} - - def available_result_from_name(name) -> AvailableResult: """Create an instance of AvailableResult from a specified results name. diff --git a/src/ansys/dpf/core/result_info.py b/src/ansys/dpf/core/result_info.py index 336a571e0f..0deb184d5b 100644 --- a/src/ansys/dpf/core/result_info.py +++ b/src/ansys/dpf/core/result_info.py @@ -472,17 +472,11 @@ def _get_result(self, numres): self._api.result_info_get_result_location(self, numres, loc_name) loc_name = str(loc_name) except AttributeError: - if name in available_result._result_properties: - loc_name = available_result._result_properties[name]["location"] - else: - loc_name = "" + loc_name = "" try: scripting_name = self._api.result_info_get_result_scripting_name(self, numres) except AttributeError: - if name in available_result._result_properties: - scripting_name = available_result._result_properties[name]["scripting_name"] - else: - scripting_name = available_result._remove_spaces(physic_name) + scripting_name = available_result._remove_spaces(physic_name) num_sub_res = self._api.result_info_get_number_of_sub_results(self, numres) sub_res = {} for ires in range(num_sub_res): diff --git a/src/ansys/dpf/core/results.py b/src/ansys/dpf/core/results.py index a1801ee4f5..28eb0bd8b8 100644 --- a/src/ansys/dpf/core/results.py +++ b/src/ansys/dpf/core/results.py @@ -272,12 +272,7 @@ def __init__(self, connector, mesh_by_default, result_info, server): self._mesh_scoping = None self._location = None self._mesh_by_default = mesh_by_default - if isinstance(result_info, str): - from ansys.dpf.core.available_result import available_result_from_name - - self._result_info = available_result_from_name(result_info) - else: - self._result_info = result_info + self._result_info = result_info self._specific_fc_type = None from ansys.dpf.core import operators