Skip to content

Commit b25ab10

Browse files
authored
Merge pull request #357 from Dlubal-Software/heet-updateResultTables
Heet update result tables
2 parents 28b29b2 + 767fa69 commit b25ab10

2 files changed

Lines changed: 144 additions & 5 deletions

File tree

RFEM/Results/resultTables.py

Lines changed: 116 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -502,17 +502,39 @@ def MembersGlobalDeformations(
502502
loading_no: int = 1,
503503
object_no: int = 0,
504504
include_base: bool = False,
505+
without_extremes: bool = False,
505506
model = Model):
506507

507508
'''
508509
Args:
509510
loading_type (emun): Loading type (LC2 = E_OBJECT_TYPE_LOAD_CASE)
510511
loading_no (int): Loading Number (CO2 = 2)
511512
object_no (int): Object number
513+
include_base (bool, optional): Include Base (include_base must be 'True' for without_extremes=True)
514+
without_extremes (bool, optional): Without Extremes Option
512515
model (class, optional): Model instance
513516
'''
517+
if without_extremes:
514518

515-
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_global_deformations(loading_type.name, loading_no, object_no), include_base)
519+
results = ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_global_deformations(loading_type.name, loading_no, object_no), True)
520+
result, combos, combo = [], [], ()
521+
522+
for item in results:
523+
description = item.get('description')
524+
location = item.get('location')
525+
node = item.get('node_number')
526+
if isinstance(description, float) or description == 'Extremes':
527+
if description == 'Extremes':
528+
description = results[results.index(item) - 1].get('description')
529+
if location != None: combo = (description, node, location)
530+
if combo not in combos:
531+
combos.append(combo)
532+
result.append(item)
533+
534+
return result
535+
536+
else:
537+
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_global_deformations(loading_type.name, loading_no, object_no), include_base)
516538

517539
@staticmethod
518540
def MembersHingeDeformations(
@@ -556,35 +578,80 @@ def MembersInternalForces(
556578
loading_no: int = 1,
557579
object_no: int = 0,
558580
include_base: bool = False,
581+
without_extremes: bool = False,
559582
model = Model):
560583

561584
'''
562585
Args:
563586
loading_type (emun): Loading type (LC2 = E_OBJECT_TYPE_LOAD_CASE)
564587
loading_no (int): Loading Number (CO2 = 2)
565588
object_no (int): Object number
589+
include_base (bool, optional): Include Base (include_base must be 'True' for without_extremes=True)
590+
without_extremes (bool, optional): Without Extremes Option
566591
model (class, optional): Model instance
567592
'''
593+
if without_extremes:
594+
595+
results = ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_internal_forces(loading_type.name, loading_no, object_no), True)
596+
result, combos, combo = [], [], ()
568597

569-
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_internal_forces(loading_type.name, loading_no, object_no), include_base)
598+
for item in results:
599+
description = item.get('description')
600+
location = item.get('location')
601+
node = item.get('node_number')
602+
if isinstance(description, float) or description == 'Extremes':
603+
if description == 'Extremes':
604+
description = results[results.index(item) - 1].get('description')
605+
if location != None: combo = (description, node, location)
606+
if combo not in combos:
607+
combos.append(combo)
608+
result.append(item)
609+
610+
return result
611+
612+
else:
613+
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_internal_forces(loading_type.name, loading_no, object_no), include_base)
570614

571615
@staticmethod
572616
def MembersInternalForcesByMemberSet(
573617
loading_type: enum = CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,
574618
loading_no: int = 1,
575619
object_no: int = 0,
576620
include_base: bool = False,
621+
without_extremes: bool = False,
577622
model = Model):
578623

579624
'''
580625
Args:
581626
loading_type (emun): Loading type (LC2 = E_OBJECT_TYPE_LOAD_CASE)
582627
loading_no (int): Loading Number (CO2 = 2)
583628
object_no (int): Object number
629+
include_base (bool, optional): Include Base (include_base must be 'True' for without_extremes=True)
630+
without_extremes (bool, optional): Without Extremes Option
584631
model (class, optional): Model instance
585632
'''
633+
if without_extremes:
634+
635+
results = ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_internal_forces_by_member_set(loading_type.name, loading_no, object_no), True)
636+
result, combos, combo = [], [], ()
637+
638+
for item in results:
639+
description = item.get('description')
640+
location = item.get('location')
641+
node = item.get('node_number')
642+
member = item.get('member_number')
643+
if isinstance(description, float) or description == 'Extremes':
644+
if description == 'Extremes':
645+
description = results[results.index(item) - 1].get('description')
646+
if location != None: combo = (description, member, node, location)
647+
if combo not in combos:
648+
combos.append(combo)
649+
result.append(item)
586650

587-
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_internal_forces_by_member_set(loading_type.name, loading_no, object_no), include_base)
651+
return result
652+
653+
else:
654+
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_internal_forces_by_member_set(loading_type.name, loading_no, object_no), include_base)
588655

589656
@staticmethod
590657
def MembersInternalForcesBySection(
@@ -610,35 +677,79 @@ def MembersLocalDeformations(
610677
loading_no: int = 1,
611678
object_no: int = 0,
612679
include_base: bool = False,
680+
without_extremes: bool = False,
613681
model = Model):
614682

615683
'''
616684
Args:
617685
loading_type (emun): Loading type (LC2 = E_OBJECT_TYPE_LOAD_CASE)
618686
loading_no (int): Loading Number (CO2 = 2)
619687
object_no (int): Object number
688+
include_base (bool, optional): Include Base (include_base must be 'True' for without_extremes=True)
689+
without_extremes (bool, optional): Without Extremes Option
620690
model (class, optional): Model instance
621691
'''
692+
if without_extremes:
693+
694+
results = ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_local_deformations(loading_type.name, loading_no, object_no), True)
695+
result, combos, combo = [], [], ()
696+
697+
for item in results:
698+
description = item.get('description')
699+
location = item.get('location')
700+
node = item.get('node_number')
701+
if isinstance(description, float) or description == 'Extremes':
702+
if description == 'Extremes':
703+
description = results[results.index(item) - 1].get('description')
704+
if location != None: combo = (description, node, location)
705+
if combo not in combos:
706+
combos.append(combo)
707+
result.append(item)
708+
709+
return result
622710

623-
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_local_deformations(loading_type.name, loading_no, object_no), include_base)
711+
else:
712+
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_local_deformations(loading_type.name, loading_no, object_no), include_base)
624713

625714
@staticmethod
626715
def MembersStrains(
627716
loading_type: enum = CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,
628717
loading_no: int = 1,
629718
object_no: int = 0,
630719
include_base: bool = False,
720+
without_extremes: bool = False,
631721
model = Model):
632722

633723
'''
634724
Args:
635725
loading_type (emun): Loading type (LC2 = E_OBJECT_TYPE_LOAD_CASE)
636726
loading_no (int): Loading Number (CO2 = 2)
637727
object_no (int): Object number
728+
include_base (bool, optional): Include Base (include_base must be 'True' for without_extremes=True)
729+
without_extremes (bool, optional): Without Extremes Option
638730
model (class, optional): Model instance
639731
'''
732+
if without_extremes:
733+
734+
results = ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_strains(loading_type.name, loading_no, object_no), True)
735+
result, combos, combo = [], [], ()
736+
737+
for item in results:
738+
description = item.get('description')
739+
location = item.get('location')
740+
node = item.get('node_number')
741+
if isinstance(description, float) or description == 'Extremes':
742+
if description == 'Extremes':
743+
description = results[results.index(item) - 1].get('description')
744+
if location != None: combo = (description, node, location)
745+
if combo not in combos:
746+
combos.append(combo)
747+
result.append(item)
640748

641-
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_strains(loading_type.name, loading_no, object_no), include_base)
749+
return result
750+
751+
else:
752+
return ConvertResultsToListOfDct(model.clientModel.service.get_results_for_members_strains(loading_type.name, loading_no, object_no), include_base)
642753

643754
@staticmethod
644755
def ModalAnalysisEffectiveModalMasses(

UnitTests/test_ResultTables.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,31 @@ def test_result_tables():
6161

6262
table = ResultTables.SurfacesPrincipalTotalStrains(CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, 1, 1)
6363
assert table
64+
65+
table1 = ResultTables.MembersGlobalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=False)
66+
table2 = ResultTables.MembersGlobalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=True)
67+
table3 = ResultTables.MembersGlobalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=1, include_base=True, without_extremes=True)
68+
69+
assert len(table1) > len(table2)
70+
assert len(table2) > len(table3)
71+
72+
table4 = ResultTables.MembersLocalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=False)
73+
table5 = ResultTables.MembersLocalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=True)
74+
table6 = ResultTables.MembersLocalDeformations(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=1, include_base=True, without_extremes=True)
75+
76+
assert len(table4) > len(table5)
77+
assert len(table5) > len(table6)
78+
79+
table7 = ResultTables.MembersInternalForces(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=False)
80+
table8 = ResultTables.MembersInternalForces(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=True)
81+
table9 = ResultTables.MembersInternalForces(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=1, include_base=True, without_extremes=True)
82+
83+
assert len(table7) > len(table8)
84+
assert len(table8) > len(table9)
85+
86+
table10 = ResultTables.MembersStrains(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=False)
87+
table11 = ResultTables.MembersStrains(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=0, include_base=True, without_extremes=True)
88+
table12 = ResultTables.MembersStrains(CaseObjectType.E_OBJECT_TYPE_LOAD_CASE,1, object_no=1, include_base=True, without_extremes=True)
89+
90+
assert len(table10) > len(table11)
91+
assert len(table11) > len(table12)

0 commit comments

Comments
 (0)