Skip to content

Experimental - remove _result_properties #2365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
24a14f3
Fill the values in the Beam3 ElementDescriptor
rafacanton May 22, 2025
36a95ad
Revert "Fill the values in the Beam3 ElementDescriptor"
rafacanton May 22, 2025
176b020
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton May 22, 2025
4e461da
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton May 23, 2025
2df663f
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton May 28, 2025
703575f
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 3, 2025
b6abfab
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 4, 2025
6ce3f22
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 4, 2025
8df5098
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 6, 2025
2f9761e
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 6, 2025
d6265a6
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 6, 2025
9a28386
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 9, 2025
c780ea8
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 11, 2025
277ef7b
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 11, 2025
5095180
Merge branch 'master' of https://github.com/ansys/pydpf-core
rafacanton Jun 13, 2025
d3703a8
Experimental - remove _result_properties
rafacanton Jun 13, 2025
da3f1da
Merge branch 'master' into rcanton/remove_result_props
PProfizi Aug 5, 2025
c6bdbfa
Merge branch 'master' into rcanton/remove_result_props
PProfizi Aug 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 2 additions & 58 deletions src/ansys/dpf/core/available_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -307,60 +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"},
"EPCR": {"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"},
"B_N": {"location": "ElementalNodal", "scripting_name": "beam_axial_force"},
"B_M1": {"location": "ElementalNodal", "scripting_name": "beam_s_bending_moment"},
"B_M2": {"location": "ElementalNodal", "scripting_name": "beam_t_bending_moment"},
"B_MT": {"location": "ElementalNodal", "scripting_name": "beam_torsional_moment"},
"B_SN": {"location": "ElementalNodal", "scripting_name": "beam_axial_stress"},
"B_EL": {"location": "ElementalNodal", "scripting_name": "beam_axial_total_strain"},
"B_T1": {"location": "ElementalNodal", "scripting_name": "beam_s_shear_force"},
"B_T2": {"location": "ElementalNodal", "scripting_name": "beam_t_shear_force"},
}


def available_result_from_name(name) -> AvailableResult:
"""Create an instance of AvailableResult from a specified results name.

Expand Down
10 changes: 2 additions & 8 deletions src/ansys/dpf/core/result_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 1 addition & 6 deletions src/ansys/dpf/core/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading