Skip to content

Commit d3703a8

Browse files
committed
Experimental - remove _result_properties
1 parent 5095180 commit d3703a8

File tree

3 files changed

+5
-64
lines changed

3 files changed

+5
-64
lines changed

src/ansys/dpf/core/available_result.py

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ def name(self):
200200
"""Result operator."""
201201
if self._properties and "scripting_name" in self._properties.keys():
202202
name = self._properties["scripting_name"]
203-
elif self.operator_name in _result_properties:
204-
name = _result_properties[self.operator_name]["scripting_name"]
205203
else:
206204
name = _remove_spaces(self._physics_name)
207205
return _make_as_function_name(name)
@@ -266,8 +264,8 @@ def native_location(self):
266264
"""Native location of the result."""
267265
if hasattr(self, "_properties") and "location" in self._properties.keys():
268266
return self._properties["location"]
269-
if self.operator_name in _result_properties:
270-
return _result_properties[self.operator_name]["location"]
267+
else:
268+
return ""
271269

272270
@property
273271
def native_scoping_location(self):
@@ -307,52 +305,6 @@ def qualifier_combinations(self) -> List[dict]:
307305
return [q.__dict__() for q in self.qualifiers]
308306

309307

310-
_result_properties = {
311-
"S": {"location": "ElementalNodal", "scripting_name": "stress"},
312-
"ENF": {"location": "ElementalNodal", "scripting_name": "element_nodal_forces"},
313-
"EPEL": {"location": "ElementalNodal", "scripting_name": "elastic_strain"},
314-
"EPPL": {"location": "ElementalNodal", "scripting_name": "plastic_strain"},
315-
"ECR": {"location": "ElementalNodal", "scripting_name": "creep_strain"},
316-
"BFE": {"location": "ElementalNodal", "scripting_name": "structural_temperature"},
317-
"ETH": {"location": "ElementalNodal", "scripting_name": "thermal_strain"},
318-
"ETH_SWL": {"location": "ElementalNodal", "scripting_name": "swelling_strains"},
319-
"ENG_VOL": {"location": "Elemental", "scripting_name": "elemental_volume"},
320-
"ENG_SE": {"location": "Elemental", "scripting_name": "stiffness_matrix_energy"},
321-
"ENG_AHO": {
322-
"location": "Elemental",
323-
"scripting_name": "artificial_hourglass_energy",
324-
},
325-
"ENG_KE": {"location": "Elemental", "scripting_name": "kinetic_energy"},
326-
"ENG_CO": {"location": "Elemental", "scripting_name": "co_energy"},
327-
"ENG_INC": {"location": "Elemental", "scripting_name": "incremental_energy"},
328-
"ENG_TH": {"location": "Elemental", "scripting_name": "thermal_dissipation_energy"},
329-
"U": {"location": "Nodal", "scripting_name": "displacement"},
330-
"V": {"location": "Nodal", "scripting_name": "velocity"},
331-
"A": {"location": "Nodal", "scripting_name": "acceleration"},
332-
"RF": {"location": "Nodal", "scripting_name": "reaction_force"},
333-
"F": {"location": "Nodal", "scripting_name": "nodal_force"},
334-
"M": {"location": "Nodal", "scripting_name": "nodal_moment"},
335-
"TEMP": {"location": "Nodal", "scripting_name": "temperature"},
336-
"EF": {"location": "ElementalNodal", "scripting_name": "electric_field"},
337-
"VOLT": {"location": "Nodal", "scripting_name": "electric_potential"},
338-
"TF": {"location": "ElementalNodal", "scripting_name": "heat_flux"},
339-
"UTOT": {"location": "Nodal", "scripting_name": "raw_displacement"},
340-
"RFTOT": {"location": "Nodal", "scripting_name": "raw_reaction_force"},
341-
"ECT_STAT": {"location": "ElementalNodal", "scripting_name": "contact_status"},
342-
"ECT_PRES": {"location": "ElementalNodal", "scripting_name": "contact_pressure"},
343-
"ECT_PENE": {"location": "ElementalNodal", "scripting_name": "contact_penetration"},
344-
"ECT_SLIDE": {"location": "ElementalNodal", "scripting_name": "contact_sliding_distance"},
345-
"ECT_GAP": {"location": "ElementalNodal", "scripting_name": "contact_gap_distance"},
346-
"ECT_SFRIC": {"location": "ElementalNodal", "scripting_name": "contact_friction_stress"},
347-
"ECT_STOT": {"location": "ElementalNodal", "scripting_name": "contact_total_stress"},
348-
"ECT_FRES": {
349-
"location": "ElementalNodal",
350-
"scripting_name": "contact_fluid_penetration_pressure",
351-
},
352-
"ECT_FLUX": {"location": "ElementalNodal", "scripting_name": "contact_surface_heat_flux"},
353-
}
354-
355-
356308
def available_result_from_name(name) -> AvailableResult:
357309
"""Create an instance of AvailableResult from a specified results name.
358310

src/ansys/dpf/core/result_info.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -472,17 +472,11 @@ def _get_result(self, numres):
472472
self._api.result_info_get_result_location(self, numres, loc_name)
473473
loc_name = str(loc_name)
474474
except AttributeError:
475-
if name in available_result._result_properties:
476-
loc_name = available_result._result_properties[name]["location"]
477-
else:
478-
loc_name = ""
475+
loc_name = ""
479476
try:
480477
scripting_name = self._api.result_info_get_result_scripting_name(self, numres)
481478
except AttributeError:
482-
if name in available_result._result_properties:
483-
scripting_name = available_result._result_properties[name]["scripting_name"]
484-
else:
485-
scripting_name = available_result._remove_spaces(physic_name)
479+
scripting_name = available_result._remove_spaces(physic_name)
486480
num_sub_res = self._api.result_info_get_number_of_sub_results(self, numres)
487481
sub_res = {}
488482
for ires in range(num_sub_res):

src/ansys/dpf/core/results.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,7 @@ def __init__(self, connector, mesh_by_default, result_info, server):
272272
self._mesh_scoping = None
273273
self._location = None
274274
self._mesh_by_default = mesh_by_default
275-
if isinstance(result_info, str):
276-
from ansys.dpf.core.available_result import available_result_from_name
277-
278-
self._result_info = available_result_from_name(result_info)
279-
else:
280-
self._result_info = result_info
275+
self._result_info = result_info
281276
self._specific_fc_type = None
282277
from ansys.dpf.core import operators
283278

0 commit comments

Comments
 (0)