From ba252abc2d2d489e017d1634d009c776ca228ad8 Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 18 Mar 2022 09:17:24 +0100 Subject: [PATCH 01/14] Imperfection Case, Local methode added --- RFEM/Imperfections/imperfectionCase.py | 67 ++++++++++++++++++++++++-- RFEM/enums.py | 7 +++ 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/RFEM/Imperfections/imperfectionCase.py b/RFEM/Imperfections/imperfectionCase.py index 1366d131..f1707b57 100644 --- a/RFEM/Imperfections/imperfectionCase.py +++ b/RFEM/Imperfections/imperfectionCase.py @@ -1,19 +1,69 @@ -from RFEM.initModel import Model, clearAtributes +from RFEM.enums import ImperfectionType +from RFEM.initModel import Model, clearAtributes, ConvertToDlString class ImperfectionCase(): + def __init__(self, no: int = 1, - assigned_to_load_cases: str = '1', + assigned_to_load_combinations: str ='', + assigned_to_load_cases: str = '', comment: str = '', params: dict = {}): + ''' + Args: + no (int): Imperfection Case Tag + comment (str, optional): Comments + params (dict, optional): Parameters + ''' + + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:imperfection_case') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Imperfection Case No. + clientObject.no = no + + # Assign to Load Combinations + if len(assigned_to_load_combinations) > 0: + clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) + # Assign to Load Cases + if len(assigned_to_load_cases) > 0: + clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) + + if len(assigned_to_load_cases) + len(assigned_to_load_combinations) == 0: + print('Warning: An imperfection case should be assigned to a load case or load combination.') + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Imperfection Case to client model + Model.clientModel.service.set_imperfection_case(clientObject) + + def Local(self, + no: int = 1, + assigned_to_load_combinations: str ='', + assigned_to_load_cases: str = '', + comment: str = '', + params: dict = {}): ''' Args: no (int): Imperfection Case Tag + assigned_to_load_combinations (str, optional): Assigned Load Combinations + assigned_to_load_cases (str, optional): Assigned Load Cases comment (str, optional): Comments params (dict, optional): Parameters ''' + # assigned_to_load_combinations XY is first in parameter list because imperfections are + # usually assigned to load combinations. + # Client model | Imperfection Case clientObject = Model.clientModel.factory.create('ns0:imperfection_case') @@ -23,8 +73,19 @@ def __init__(self, # Imperfection Case No. clientObject.no = no + # Der Typ local muss übergeben werden. Der wird jetzt nur gesetzt, weil er default ist. + clientObject.type = ImperfectionType.IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS.name + + # Assign to Load Combinations + if len(assigned_to_load_combinations) > 0: + clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) + # Assign to Load Cases - clientObject.assigned_to_load_cases = assigned_to_load_cases + if len(assigned_to_load_cases) > 0: + clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) + + if len(assigned_to_load_cases) + len(assigned_to_load_combinations) == 0: + print('Warning: An imperfection case should be assigned to a load case or load combination.') # Comment clientObject.comment = comment diff --git a/RFEM/enums.py b/RFEM/enums.py index 02cc85e1..3cce1423 100644 --- a/RFEM/enums.py +++ b/RFEM/enums.py @@ -1205,3 +1205,10 @@ class ModelCheckProcessOptionType(Enum): Model Check Process Object Groups Option Type ''' CROSS_LINES, CROSS_MEMBERS, DELETE_UNUSED_NODES, UNITE_NODES_AND_DELETE_UNUSED_NODES = range(4) + +class ImperfectionType(Enum): + ''' + Types for Imperfection + ''' + IMPERFECTION_TYPE_BUCKLING_MODE, IMPERFECTION_TYPE_DYNAMIC_EIGENMODE, IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP, IMPERFECTION_TYPE_INITIAL_SWAY_VIA_TABLE, IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS, IMPERFECTION_TYPE_NOTIONAL_LOADS_FROM_LOAD_CASE, IMPERFECTION_TYPE_STATIC_DEFORMATION = range(7) + \ No newline at end of file From 9eebd043ffc789bb5f4a9f1a81fb5f05e19c69ff Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 25 Mar 2022 09:04:22 +0100 Subject: [PATCH 02/14] Add class memberImperfection.py --- RFEM/Imperfections/memberImpferfection.py | 54 +++++++++++++++++++++ RFEM/Imperfections/membersetImperfection.py | 1 + 2 files changed, 55 insertions(+) create mode 100644 RFEM/Imperfections/memberImpferfection.py create mode 100644 RFEM/Imperfections/membersetImperfection.py diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py new file mode 100644 index 00000000..7db430d9 --- /dev/null +++ b/RFEM/Imperfections/memberImpferfection.py @@ -0,0 +1,54 @@ +from RFEM.initModel import Model, clearAtributes, ConvertToDlString + +class MemberImperfection(): + ''' + Creates a member imperfection. + An imperfection case must be created before. + ''' + + def __init__(self, + no: int = 1, + imperfection_case_no: int = 1, + members: str ='1', + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + comment (str, optional): Comments + params (dict, optional): Parameters + ''' + + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + clientObject.members = ConvertToDlString(members) + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) + + + def InitalSway(self, + ): + pass + + def InitalBow(self, + ): + pass + + def InitalBowAndCriterion(self, + ): + pass \ No newline at end of file diff --git a/RFEM/Imperfections/membersetImperfection.py b/RFEM/Imperfections/membersetImperfection.py new file mode 100644 index 00000000..8903f2e1 --- /dev/null +++ b/RFEM/Imperfections/membersetImperfection.py @@ -0,0 +1 @@ +from RFEM.initModel import Model, clearAtributes, ConvertToDlString \ No newline at end of file From 9b66f268dfd5d9f5cce58ecdd20ea222b17dc07e Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Tue, 5 Apr 2022 09:09:37 +0200 Subject: [PATCH 03/14] init finished --- RFEM/Imperfections/memberImpferfection.py | 45 ++++++++++- test.py | 93 +++++++++++++++++++++++ 2 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 test.py diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py index 7db430d9..15e3d1d1 100644 --- a/RFEM/Imperfections/memberImpferfection.py +++ b/RFEM/Imperfections/memberImpferfection.py @@ -15,6 +15,8 @@ def __init__(self, ''' Args: no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers comment (str, optional): Comments params (dict, optional): Parameters ''' @@ -41,9 +43,44 @@ def __init__(self, Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - def InitalSway(self, - ): - pass + def InitialSwayRelative(self, + no: int = 1, + imperfection_case_no: int = 1, + members: str ='1', + sway: float =300.0, # Das muss in clientObject eingefügt werden. + direction: , # Da muss eine Aufzählung definiert werden. + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers + sway (float): + comment (str, optional): Comments + params (dict, optional): Parameters + ''' + # Hier geht es weiter! + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + clientObject.members = ConvertToDlString(members) + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) def InitalBow(self, ): @@ -51,4 +88,4 @@ def InitalBow(self, def InitalBowAndCriterion(self, ): - pass \ No newline at end of file + pass diff --git a/test.py b/test.py new file mode 100644 index 00000000..b7e01c58 --- /dev/null +++ b/test.py @@ -0,0 +1,93 @@ +import sys + +from RFEM.BasicObjects.lineSet import LineSet +from RFEM.Imperfections.memberImpferfection import MemberImperfection +from RFEM.Loads.solidSetLoad import SolidSetLoad +sys.path.append(".") +sys.path.append("./RFEM") +import pytest +from UnitTests import test_loads + +from RFEM.Loads import * +from RFEM.enums import * +from RFEM.dataTypes import * +from RFEM.initModel import * +from RFEM.BasicObjects.material import * +from RFEM.BasicObjects.section import * +from RFEM.BasicObjects.thickness import * +from RFEM.BasicObjects.node import * +from RFEM.BasicObjects.line import * +from RFEM.BasicObjects.member import * +from RFEM.BasicObjects.surface import * +from RFEM.BasicObjects.solid import * +from RFEM.BasicObjects.solidSet import * +from RFEM.BasicObjects.opening import * +from RFEM.TypesForNodes.nodalSupport import * +from RFEM.TypesForLines.lineSupport import * +from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import * +from RFEM.LoadCasesAndCombinations.designSituation import * +from RFEM.LoadCasesAndCombinations.loadCase import * +from RFEM.LoadCasesAndCombinations.loadCombination import * +from RFEM.Loads.memberLoad import * +from RFEM.Loads.freeLoad import * +from RFEM.Loads.lineLoad import * +from RFEM.Loads.nodalLoad import * +from RFEM.Loads.surfaceLoad import * +from RFEM.Loads.lineLoad import * +from RFEM.Imperfections.imperfectionCase import * + +if __name__ == '__main__': + Model.clientModel.service.begin_modification('new') + + Material(1, 'S235') + + Node(1, 0.0, 0.0, 0.0) + Node(2, 0.0, 0.0, -10.0) + + Section(1, 'IPE 300') + Member(1, 1, 2, 0, 1, 1) + + NodalSupport(1, '1', NodalSupportType.FIXED) + + StaticAnalysisSettings(1, 'LINEAR', StaticAnalysisType.GEOMETRICALLY_LINEAR) + StaticAnalysisSettings(2, 'NONLINEAR', StaticAnalysisType.SECOND_ORDER_P_DELTA) + + DesignSituation(1, True,'My DS', True) + + LoadCase(1, 'Test 1') + LoadCase(2, 'Test 2', [False]) + + LoadCombination(1, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') + + NodalLoad(1, 1, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 10000) + NodalLoad(1, 2, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 5000) + + ImperfectionCase.Local(ImperfectionCase, 1, '1', '1-2', 'My Comment' ) + ImperfectionCase.Local(ImperfectionCase, 2, '1') + #ImperfectionCase.Local(ImperfectionCase, 3) + + MemberImperfectionDict = { + "imperfection_type" : "IMPERFECTION_TYPE_INITIAL_SWAY", + "imperfection_direction" : "IMPERFECTION_DIRECTION_LOCAL_Y", + "definition_type" : "DEFINITION_TYPE_RELATIVE", + "basic_value_relative" : 300.0 + } + + MemberImperfection(1, 1, '1', 'My Comment', MemberImperfectionDict) + + + # Dieses Testprogramm wird noch etwas ausgebaut und schön gemacht. Dann wird es als + # Beispiel veröffentlicht. + + + + + + + #Calculate_all() + + Model.clientModel.service.finish_modification() + + + print('Fertig!') + From 982aedd81a888cf0991600cb7a0965f059692d0c Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Tue, 5 Apr 2022 15:25:35 +0200 Subject: [PATCH 04/14] InitialSwayRelative() finished --- RFEM/Imperfections/memberImpferfection.py | 18 +++++++++++++++--- RFEM/enums.py | 7 ++++++- test.py | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py index 15e3d1d1..5b9468c2 100644 --- a/RFEM/Imperfections/memberImpferfection.py +++ b/RFEM/Imperfections/memberImpferfection.py @@ -1,4 +1,5 @@ from RFEM.initModel import Model, clearAtributes, ConvertToDlString +from RFEM.enums import * class MemberImperfection(): ''' @@ -46,9 +47,9 @@ def __init__(self, def InitialSwayRelative(self, no: int = 1, imperfection_case_no: int = 1, - members: str ='1', - sway: float =300.0, # Das muss in clientObject eingefügt werden. - direction: , # Da muss eine Aufzählung definiert werden. + members: str = '1', + sway: float = 300.0, + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, comment: str = '', params: dict = {}): ''' @@ -57,6 +58,7 @@ def InitialSwayRelative(self, imperfection_case_no (int): number of imperfection case for this member imperfection members (str) : List of member numbers sway (float): + imperfection_direction comment (str, optional): Comments params (dict, optional): Parameters ''' @@ -72,6 +74,16 @@ def InitialSwayRelative(self, clientObject.members = ConvertToDlString(members) + # Sway + + clientObject.basic_value_relative = sway + + # Imperfection Direction + + clientObject.imperfection_direction = imperfection_direction.name + + clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' + # Comment clientObject.comment = comment diff --git a/RFEM/enums.py b/RFEM/enums.py index 3cce1423..a5b57fe0 100644 --- a/RFEM/enums.py +++ b/RFEM/enums.py @@ -1211,4 +1211,9 @@ class ImperfectionType(Enum): Types for Imperfection ''' IMPERFECTION_TYPE_BUCKLING_MODE, IMPERFECTION_TYPE_DYNAMIC_EIGENMODE, IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP, IMPERFECTION_TYPE_INITIAL_SWAY_VIA_TABLE, IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS, IMPERFECTION_TYPE_NOTIONAL_LOADS_FROM_LOAD_CASE, IMPERFECTION_TYPE_STATIC_DEFORMATION = range(7) - \ No newline at end of file + +class ImperfectionDirection(Enum): + ''' + Direction of member imperfection + ''' + IMPERFECTION_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, IMPERFECTION_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, IMPERFECTION_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, IMPERFECTION_DIRECTION_LOCAL_Y, IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE, IMPERFECTION_DIRECTION_LOCAL_Z, IMPERFECTION_DIRECTION_LOCAL_Z_NEGATIVE, IMPERFECTION_DIRECTION_PRINCIPAL_U, IMPERFECTION_DIRECTION_PRINCIPAL_U_NEGATIVE, IMPERFECTION_DIRECTION_PRINCIPAL_V, IMPERFECTION_DIRECTION_PRINCIPAL_V_NEGATIVE = range(11) \ No newline at end of file diff --git a/test.py b/test.py index b7e01c58..911116ec 100644 --- a/test.py +++ b/test.py @@ -74,6 +74,7 @@ } MemberImperfection(1, 1, '1', 'My Comment', MemberImperfectionDict) + MemberImperfection.InitialSwayRelative(2, 2, 2, '1', 250.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) # Dieses Testprogramm wird noch etwas ausgebaut und schön gemacht. Dann wird es als From 07ab2cf775adc442f3286cd85d86319f828ff16e Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Tue, 5 Apr 2022 16:22:57 +0200 Subject: [PATCH 05/14] InitalBowRelative() finished --- RFEM/Imperfections/memberImpferfection.py | 72 +++++++++++++++++++---- test.py | 11 ++-- 2 files changed, 66 insertions(+), 17 deletions(-) diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py index 5b9468c2..5d8159f3 100644 --- a/RFEM/Imperfections/memberImpferfection.py +++ b/RFEM/Imperfections/memberImpferfection.py @@ -45,13 +45,13 @@ def __init__(self, def InitialSwayRelative(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str = '1', - sway: float = 300.0, - imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, - comment: str = '', - params: dict = {}): + no: int = 1, + imperfection_case_no: int = 1, + members: str = '1', + sway: float = 300.0, + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, + comment: str = '', + params: dict = {}): ''' Args: no (int): Member Imperfection Tag @@ -60,9 +60,8 @@ def InitialSwayRelative(self, sway (float): imperfection_direction comment (str, optional): Comments - params (dict, optional): Parameters + params (dict, optional): Additional parameters ''' - # Hier geht es weiter! # Client model | Imperfection Case clientObject = Model.clientModel.factory.create('ns0:member_imperfection') @@ -82,6 +81,7 @@ def InitialSwayRelative(self, clientObject.imperfection_direction = imperfection_direction.name + clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_SWAY' clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' # Comment @@ -94,10 +94,56 @@ def InitialSwayRelative(self, # Add Member Imperfection to client model Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - def InitalBow(self, - ): - pass + def InitalBowRelative(self, + no: int = 1, + imperfection_case_no: int = 1, + members: str = '1', + bow: float = 250.0, + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers + bow (float): + imperfection_direction + comment (str, optional): Comments + params (dict, optional): Additional parameters + ''' + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + clientObject.members = ConvertToDlString(members) + + # Sway + + clientObject.basic_value_relative = bow + + # Imperfection Direction + + clientObject.imperfection_direction = imperfection_direction.name + + clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW' + clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - def InitalBowAndCriterion(self, + def InitalBowRelativeAndCriterion(self, ): pass diff --git a/test.py b/test.py index 911116ec..3693eaea 100644 --- a/test.py +++ b/test.py @@ -58,23 +58,26 @@ LoadCase(2, 'Test 2', [False]) LoadCombination(1, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') + LoadCombination(2, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') + LoadCombination(3, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') NodalLoad(1, 1, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 10000) NodalLoad(1, 2, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 5000) ImperfectionCase.Local(ImperfectionCase, 1, '1', '1-2', 'My Comment' ) - ImperfectionCase.Local(ImperfectionCase, 2, '1') - #ImperfectionCase.Local(ImperfectionCase, 3) + ImperfectionCase.Local(ImperfectionCase, 2, '2') + ImperfectionCase.Local(ImperfectionCase, 3, '3') MemberImperfectionDict = { - "imperfection_type" : "IMPERFECTION_TYPE_INITIAL_SWAY", + "imperfection_type" : "IMPERFECTION_TYPE_INITIAL_BOW", "imperfection_direction" : "IMPERFECTION_DIRECTION_LOCAL_Y", "definition_type" : "DEFINITION_TYPE_RELATIVE", "basic_value_relative" : 300.0 } MemberImperfection(1, 1, '1', 'My Comment', MemberImperfectionDict) - MemberImperfection.InitialSwayRelative(2, 2, 2, '1', 250.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) + MemberImperfection.InitialSwayRelative(MemberImperfection, 2, 2, '1', 250.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) + MemberImperfection.InitalBowRelative(MemberImperfection,3, 3, '1', 200.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) # Dieses Testprogramm wird noch etwas ausgebaut und schön gemacht. Dann wird es als From eaec46a6313de342fea172cb325fb4150cfcb01b Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 8 Apr 2022 09:33:01 +0200 Subject: [PATCH 06/14] Typo --- RFEM/Imperfections/memberImpferfection.py | 6 +++--- test.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py index 5d8159f3..0f31a051 100644 --- a/RFEM/Imperfections/memberImpferfection.py +++ b/RFEM/Imperfections/memberImpferfection.py @@ -94,7 +94,7 @@ def InitialSwayRelative(self, # Add Member Imperfection to client model Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - def InitalBowRelative(self, + def InitialBowRelative(self, no: int = 1, imperfection_case_no: int = 1, members: str = '1', @@ -130,7 +130,7 @@ def InitalBowRelative(self, # Imperfection Direction clientObject.imperfection_direction = imperfection_direction.name - + clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW' clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' @@ -144,6 +144,6 @@ def InitalBowRelative(self, # Add Member Imperfection to client model Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - def InitalBowRelativeAndCriterion(self, + def InitialBowRelativeAndCriterion(self, ): pass diff --git a/test.py b/test.py index 3693eaea..773e4e67 100644 --- a/test.py +++ b/test.py @@ -77,7 +77,7 @@ MemberImperfection(1, 1, '1', 'My Comment', MemberImperfectionDict) MemberImperfection.InitialSwayRelative(MemberImperfection, 2, 2, '1', 250.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) - MemberImperfection.InitalBowRelative(MemberImperfection,3, 3, '1', 200.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) + MemberImperfection.InitialBowRelative(MemberImperfection,3, 3, '1', 200.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) # Dieses Testprogramm wird noch etwas ausgebaut und schön gemacht. Dann wird es als From d02d6cc4930bc81e2036e7d80dab2808cf5e0e23 Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 8 Apr 2022 14:03:58 +0200 Subject: [PATCH 07/14] InitialBowRelativeAndCriterion() finished --- RFEM/Imperfections/memberImpferfection.py | 59 +++++++++++++++++++++-- RFEM/enums.py | 7 +++ test.py | 15 +++++- 3 files changed, 76 insertions(+), 5 deletions(-) diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py index 0f31a051..824b9cf5 100644 --- a/RFEM/Imperfections/memberImpferfection.py +++ b/RFEM/Imperfections/memberImpferfection.py @@ -123,7 +123,7 @@ def InitialBowRelative(self, clientObject.members = ConvertToDlString(members) - # Sway + # Bow clientObject.basic_value_relative = bow @@ -145,5 +145,58 @@ def InitialBowRelative(self, Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) def InitialBowRelativeAndCriterion(self, - ): - pass + no: int = 1, + imperfection_case_no: int = 1, + members: str = '1', + active_criterion = ImperfectionActivationCriterion.ACTIVITY_CRITERION_ALWAYS, + bow = [250.0], + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers + bow (float): + active_criterion (): + imperfection_direction + comment (str, optional): Comments + params (dict, optional): Additional parameters + ''' + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + clientObject.members = ConvertToDlString(members) + + # Criterion + clientObject.active_criterion = active_criterion.name + + if active_criterion == ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE: + clientObject.active_bow = bow[1] + + # Bow + clientObject.basic_value_relative = bow[0] + + # Imperfection Direction + + clientObject.imperfection_direction = imperfection_direction.name + + clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION' + clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) diff --git a/RFEM/enums.py b/RFEM/enums.py index fa156201..1294a589 100644 --- a/RFEM/enums.py +++ b/RFEM/enums.py @@ -1204,6 +1204,13 @@ class ImperfectionDirection(Enum): Direction of member imperfection ''' IMPERFECTION_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, IMPERFECTION_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, IMPERFECTION_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, IMPERFECTION_DIRECTION_LOCAL_Y, IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE, IMPERFECTION_DIRECTION_LOCAL_Z, IMPERFECTION_DIRECTION_LOCAL_Z_NEGATIVE, IMPERFECTION_DIRECTION_PRINCIPAL_U, IMPERFECTION_DIRECTION_PRINCIPAL_U_NEGATIVE, IMPERFECTION_DIRECTION_PRINCIPAL_V, IMPERFECTION_DIRECTION_PRINCIPAL_V_NEGATIVE = range(11) + +class ImperfectionActivationCriterion(Enum): + ''' + Activation criterion for bow + ''' + ACTIVITY_CRITERION_ALWAYS, ACTIVITY_CRITERION_DEFINE, ACTIVITY_CRITERION_DIN_18800, ACTIVITY_CRITERION_EN_1993, ACTIVITY_CRITERION_EN_1999 = range(5) + class OptimizeOnType(Enum): ''' Optimization Settings Optimize On Type diff --git a/test.py b/test.py index 773e4e67..daaf4a79 100644 --- a/test.py +++ b/test.py @@ -52,7 +52,11 @@ StaticAnalysisSettings(1, 'LINEAR', StaticAnalysisType.GEOMETRICALLY_LINEAR) StaticAnalysisSettings(2, 'NONLINEAR', StaticAnalysisType.SECOND_ORDER_P_DELTA) - DesignSituation(1, True,'My DS', True) + #DesignSituation(1, True,'My DS', True) + DsDict = { + "design_situation_type": "" + } + DesignSituation(1,DesignSituationType.DESIGN_SITUATION_TYPE_A_ACCIDENTAL, True, 'Test', 'My Comment', DsDict) LoadCase(1, 'Test 1') LoadCase(2, 'Test 2', [False]) @@ -60,6 +64,8 @@ LoadCombination(1, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') LoadCombination(2, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') LoadCombination(3, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') + LoadCombination(4, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') + LoadCombination(5, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') NodalLoad(1, 1, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 10000) NodalLoad(1, 2, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 5000) @@ -67,9 +73,12 @@ ImperfectionCase.Local(ImperfectionCase, 1, '1', '1-2', 'My Comment' ) ImperfectionCase.Local(ImperfectionCase, 2, '2') ImperfectionCase.Local(ImperfectionCase, 3, '3') + ImperfectionCase.Local(ImperfectionCase, 4, '4') + ImperfectionCase.Local(ImperfectionCase, 5, '5') MemberImperfectionDict = { - "imperfection_type" : "IMPERFECTION_TYPE_INITIAL_BOW", + "imperfection_type" : "IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION", + "active_criterion" : "ACTIVITY_CRITERION_ALWAYS", "imperfection_direction" : "IMPERFECTION_DIRECTION_LOCAL_Y", "definition_type" : "DEFINITION_TYPE_RELATIVE", "basic_value_relative" : 300.0 @@ -78,6 +87,8 @@ MemberImperfection(1, 1, '1', 'My Comment', MemberImperfectionDict) MemberImperfection.InitialSwayRelative(MemberImperfection, 2, 2, '1', 250.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) MemberImperfection.InitialBowRelative(MemberImperfection,3, 3, '1', 200.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) + MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 4, 4, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_ALWAYS, [150.0]) + MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 5, 5, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE, [150.0, 1.78]) # Dieses Testprogramm wird noch etwas ausgebaut und schön gemacht. Dann wird es als From 26194142b684a9028b484e506009f29323dd3cca Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 22 Apr 2022 09:38:22 +0200 Subject: [PATCH 08/14] Add a parameter check, formatting --- RFEM/Imperfections/memberImpferfection.py | 26 +++++++++++++++++------ test.py | 23 ++++++++++++++++---- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py index 824b9cf5..a4234e4d 100644 --- a/RFEM/Imperfections/memberImpferfection.py +++ b/RFEM/Imperfections/memberImpferfection.py @@ -31,6 +31,7 @@ def __init__(self, # Member Imperfection No. clientObject.no = no + # Member No. clientObject.members = ConvertToDlString(members) # Comment @@ -62,6 +63,7 @@ def InitialSwayRelative(self, comment (str, optional): Comments params (dict, optional): Additional parameters ''' + # Client model | Imperfection Case clientObject = Model.clientModel.factory.create('ns0:member_imperfection') @@ -71,17 +73,19 @@ def InitialSwayRelative(self, # Member Imperfection No. clientObject.no = no + # Member No. clientObject.members = ConvertToDlString(members) # Sway - clientObject.basic_value_relative = sway # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name + # Imperfection Type clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_SWAY' + + # Imperfection Definition Type clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' # Comment @@ -112,6 +116,7 @@ def InitialBowRelative(self, comment (str, optional): Comments params (dict, optional): Additional parameters ''' + # Client model | Imperfection Case clientObject = Model.clientModel.factory.create('ns0:member_imperfection') @@ -121,17 +126,19 @@ def InitialBowRelative(self, # Member Imperfection No. clientObject.no = no + # Member No. clientObject.members = ConvertToDlString(members) # Bow - clientObject.basic_value_relative = bow # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name + # Imperfection Type clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW' + + # Imperfection Definition Type clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' # Comment @@ -164,6 +171,7 @@ def InitialBowRelativeAndCriterion(self, comment (str, optional): Comments params (dict, optional): Additional parameters ''' + # Client model | Imperfection Case clientObject = Model.clientModel.factory.create('ns0:member_imperfection') @@ -173,22 +181,28 @@ def InitialBowRelativeAndCriterion(self, # Member Imperfection No. clientObject.no = no + # Member No. clientObject.members = ConvertToDlString(members) # Criterion clientObject.active_criterion = active_criterion.name if active_criterion == ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE: - clientObject.active_bow = bow[1] + if len(bow) == 2: + clientObject.active_bow = bow[1] + else: + print('A second parameter in the bow list is required for this definition criterion. Eps must be specified, from which the imperfection is to take effect.') # Bow clientObject.basic_value_relative = bow[0] # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name + # Imperfection Type clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION' + + # Imperfection Definition Type clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' # Comment diff --git a/test.py b/test.py index daaf4a79..e5fdac23 100644 --- a/test.py +++ b/test.py @@ -35,6 +35,8 @@ from RFEM.Loads.surfaceLoad import * from RFEM.Loads.lineLoad import * from RFEM.Imperfections.imperfectionCase import * +from RFEM.ImportExport.exports import * +from RFEM.Reports.html import * if __name__ == '__main__': Model.clientModel.service.begin_modification('new') @@ -66,6 +68,7 @@ LoadCombination(3, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') LoadCombination(4, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') LoadCombination(5, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') + LoadCombination(6, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') NodalLoad(1, 1, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 10000) NodalLoad(1, 2, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 5000) @@ -75,6 +78,7 @@ ImperfectionCase.Local(ImperfectionCase, 3, '3') ImperfectionCase.Local(ImperfectionCase, 4, '4') ImperfectionCase.Local(ImperfectionCase, 5, '5') + ImperfectionCase.Local(ImperfectionCase, 6, '6') MemberImperfectionDict = { "imperfection_type" : "IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION", @@ -89,20 +93,31 @@ MemberImperfection.InitialBowRelative(MemberImperfection,3, 3, '1', 200.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 4, 4, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_ALWAYS, [150.0]) MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 5, 5, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE, [150.0, 1.78]) + # Das sollte einen Fehler ausgeben, weil die Liste bow einen Parameter zu wenig hat. + #MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 6, 6, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE, [150.0]) + ### # Dieses Testprogramm wird noch etwas ausgebaut und schön gemacht. Dann wird es als # Beispiel veröffentlicht. + ''' + Model.clientModel.service.calculate_all(False) + MyPathXML = str("C:\\Users\\faulstichf\\Documents\\temp\\results.xml") + ExportResultTablesToXML(MyPathXML) + MyPathXMLDetail = str("C:\\Users\\faulstichf\\Documents\\temp\\results-detail.xml") + ExportResultTablesWithDetaliedMembersResultsToXML(MyPathXMLDetail) + MyPathCSV = str("C:\\Users\\faulstichf\\Documents\\temp\\results.csv") + ExportResultTablesToCSV(MyPathCSV) - - - #Calculate_all() - + MyPathHTML = str("C:\\Users\\faulstichf\\Documents\\temp\\results.html") + ExportResultTablesToHtml(MyPathHTML) + ''' Model.clientModel.service.finish_modification() + print('Fertig!') From ebe0bea66dac0c29a08aeb7a80b7be8e8b55df91 Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 22 Apr 2022 09:57:38 +0200 Subject: [PATCH 09/14] Remove test file --- test.py | 123 -------------------------------------------------------- 1 file changed, 123 deletions(-) delete mode 100644 test.py diff --git a/test.py b/test.py deleted file mode 100644 index e5fdac23..00000000 --- a/test.py +++ /dev/null @@ -1,123 +0,0 @@ -import sys - -from RFEM.BasicObjects.lineSet import LineSet -from RFEM.Imperfections.memberImpferfection import MemberImperfection -from RFEM.Loads.solidSetLoad import SolidSetLoad -sys.path.append(".") -sys.path.append("./RFEM") -import pytest -from UnitTests import test_loads - -from RFEM.Loads import * -from RFEM.enums import * -from RFEM.dataTypes import * -from RFEM.initModel import * -from RFEM.BasicObjects.material import * -from RFEM.BasicObjects.section import * -from RFEM.BasicObjects.thickness import * -from RFEM.BasicObjects.node import * -from RFEM.BasicObjects.line import * -from RFEM.BasicObjects.member import * -from RFEM.BasicObjects.surface import * -from RFEM.BasicObjects.solid import * -from RFEM.BasicObjects.solidSet import * -from RFEM.BasicObjects.opening import * -from RFEM.TypesForNodes.nodalSupport import * -from RFEM.TypesForLines.lineSupport import * -from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import * -from RFEM.LoadCasesAndCombinations.designSituation import * -from RFEM.LoadCasesAndCombinations.loadCase import * -from RFEM.LoadCasesAndCombinations.loadCombination import * -from RFEM.Loads.memberLoad import * -from RFEM.Loads.freeLoad import * -from RFEM.Loads.lineLoad import * -from RFEM.Loads.nodalLoad import * -from RFEM.Loads.surfaceLoad import * -from RFEM.Loads.lineLoad import * -from RFEM.Imperfections.imperfectionCase import * -from RFEM.ImportExport.exports import * -from RFEM.Reports.html import * - -if __name__ == '__main__': - Model.clientModel.service.begin_modification('new') - - Material(1, 'S235') - - Node(1, 0.0, 0.0, 0.0) - Node(2, 0.0, 0.0, -10.0) - - Section(1, 'IPE 300') - Member(1, 1, 2, 0, 1, 1) - - NodalSupport(1, '1', NodalSupportType.FIXED) - - StaticAnalysisSettings(1, 'LINEAR', StaticAnalysisType.GEOMETRICALLY_LINEAR) - StaticAnalysisSettings(2, 'NONLINEAR', StaticAnalysisType.SECOND_ORDER_P_DELTA) - - #DesignSituation(1, True,'My DS', True) - DsDict = { - "design_situation_type": "" - } - DesignSituation(1,DesignSituationType.DESIGN_SITUATION_TYPE_A_ACCIDENTAL, True, 'Test', 'My Comment', DsDict) - - LoadCase(1, 'Test 1') - LoadCase(2, 'Test 2', [False]) - - LoadCombination(1, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') - LoadCombination(2, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') - LoadCombination(3, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') - LoadCombination(4, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') - LoadCombination(5, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') - LoadCombination(6, AnalysisType.ANALYSIS_TYPE_STATIC, 1, [False], 2, False, False, False, True, [[1.1, 1, 0, False], [1.5, 2, 0, False]], 'My Combination') - - NodalLoad(1, 1, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 10000) - NodalLoad(1, 2, '2', LoadDirectionType.LOAD_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W, 5000) - - ImperfectionCase.Local(ImperfectionCase, 1, '1', '1-2', 'My Comment' ) - ImperfectionCase.Local(ImperfectionCase, 2, '2') - ImperfectionCase.Local(ImperfectionCase, 3, '3') - ImperfectionCase.Local(ImperfectionCase, 4, '4') - ImperfectionCase.Local(ImperfectionCase, 5, '5') - ImperfectionCase.Local(ImperfectionCase, 6, '6') - - MemberImperfectionDict = { - "imperfection_type" : "IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION", - "active_criterion" : "ACTIVITY_CRITERION_ALWAYS", - "imperfection_direction" : "IMPERFECTION_DIRECTION_LOCAL_Y", - "definition_type" : "DEFINITION_TYPE_RELATIVE", - "basic_value_relative" : 300.0 - } - - MemberImperfection(1, 1, '1', 'My Comment', MemberImperfectionDict) - MemberImperfection.InitialSwayRelative(MemberImperfection, 2, 2, '1', 250.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) - MemberImperfection.InitialBowRelative(MemberImperfection,3, 3, '1', 200.0, ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE) - MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 4, 4, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_ALWAYS, [150.0]) - MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 5, 5, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE, [150.0, 1.78]) - # Das sollte einen Fehler ausgeben, weil die Liste bow einen Parameter zu wenig hat. - #MemberImperfection.InitialBowRelativeAndCriterion(MemberImperfection, 6, 6, '1', ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE, [150.0]) - ### - - - # Dieses Testprogramm wird noch etwas ausgebaut und schön gemacht. Dann wird es als - # Beispiel veröffentlicht. - ''' - Model.clientModel.service.calculate_all(False) - - MyPathXML = str("C:\\Users\\faulstichf\\Documents\\temp\\results.xml") - ExportResultTablesToXML(MyPathXML) - - MyPathXMLDetail = str("C:\\Users\\faulstichf\\Documents\\temp\\results-detail.xml") - ExportResultTablesWithDetaliedMembersResultsToXML(MyPathXMLDetail) - - MyPathCSV = str("C:\\Users\\faulstichf\\Documents\\temp\\results.csv") - ExportResultTablesToCSV(MyPathCSV) - - MyPathHTML = str("C:\\Users\\faulstichf\\Documents\\temp\\results.html") - ExportResultTablesToHtml(MyPathHTML) - ''' - Model.clientModel.service.finish_modification() - - - - print('Fertig!') - From 06b9d752844c0cbaf1229be2e95ca012a2f07d72 Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 22 Apr 2022 11:29:13 +0200 Subject: [PATCH 10/14] Typo removed --- RFEM/Imperfections/memberImperfection.py | 216 +++++++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 RFEM/Imperfections/memberImperfection.py diff --git a/RFEM/Imperfections/memberImperfection.py b/RFEM/Imperfections/memberImperfection.py new file mode 100644 index 00000000..a4234e4d --- /dev/null +++ b/RFEM/Imperfections/memberImperfection.py @@ -0,0 +1,216 @@ +from RFEM.initModel import Model, clearAtributes, ConvertToDlString +from RFEM.enums import * + +class MemberImperfection(): + ''' + Creates a member imperfection. + An imperfection case must be created before. + ''' + + def __init__(self, + no: int = 1, + imperfection_case_no: int = 1, + members: str ='1', + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers + comment (str, optional): Comments + params (dict, optional): Parameters + ''' + + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + # Member No. + clientObject.members = ConvertToDlString(members) + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) + + + def InitialSwayRelative(self, + no: int = 1, + imperfection_case_no: int = 1, + members: str = '1', + sway: float = 300.0, + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers + sway (float): + imperfection_direction + comment (str, optional): Comments + params (dict, optional): Additional parameters + ''' + + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + # Member No. + clientObject.members = ConvertToDlString(members) + + # Sway + clientObject.basic_value_relative = sway + + # Imperfection Direction + clientObject.imperfection_direction = imperfection_direction.name + + # Imperfection Type + clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_SWAY' + + # Imperfection Definition Type + clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) + + def InitialBowRelative(self, + no: int = 1, + imperfection_case_no: int = 1, + members: str = '1', + bow: float = 250.0, + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers + bow (float): + imperfection_direction + comment (str, optional): Comments + params (dict, optional): Additional parameters + ''' + + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + # Member No. + clientObject.members = ConvertToDlString(members) + + # Bow + clientObject.basic_value_relative = bow + + # Imperfection Direction + clientObject.imperfection_direction = imperfection_direction.name + + # Imperfection Type + clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW' + + # Imperfection Definition Type + clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) + + def InitialBowRelativeAndCriterion(self, + no: int = 1, + imperfection_case_no: int = 1, + members: str = '1', + active_criterion = ImperfectionActivationCriterion.ACTIVITY_CRITERION_ALWAYS, + bow = [250.0], + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, + comment: str = '', + params: dict = {}): + ''' + Args: + no (int): Member Imperfection Tag + imperfection_case_no (int): number of imperfection case for this member imperfection + members (str) : List of member numbers + bow (float): + active_criterion (): + imperfection_direction + comment (str, optional): Comments + params (dict, optional): Additional parameters + ''' + + # Client model | Imperfection Case + clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + # Member No. + clientObject.members = ConvertToDlString(members) + + # Criterion + clientObject.active_criterion = active_criterion.name + + if active_criterion == ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE: + if len(bow) == 2: + clientObject.active_bow = bow[1] + else: + print('A second parameter in the bow list is required for this definition criterion. Eps must be specified, from which the imperfection is to take effect.') + + # Bow + clientObject.basic_value_relative = bow[0] + + # Imperfection Direction + clientObject.imperfection_direction = imperfection_direction.name + + # Imperfection Type + clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION' + + # Imperfection Definition Type + clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) From 1df2ce7cfb5db172f5c4801505f61e883df06d22 Mon Sep 17 00:00:00 2001 From: FrankFaulstich <36745927+FrankFaulstich@users.noreply.github.com> Date: Fri, 22 Apr 2022 11:29:51 +0200 Subject: [PATCH 11/14] Typo removed --- RFEM/Imperfections/memberImpferfection.py | 216 ---------------------- 1 file changed, 216 deletions(-) delete mode 100644 RFEM/Imperfections/memberImpferfection.py diff --git a/RFEM/Imperfections/memberImpferfection.py b/RFEM/Imperfections/memberImpferfection.py deleted file mode 100644 index a4234e4d..00000000 --- a/RFEM/Imperfections/memberImpferfection.py +++ /dev/null @@ -1,216 +0,0 @@ -from RFEM.initModel import Model, clearAtributes, ConvertToDlString -from RFEM.enums import * - -class MemberImperfection(): - ''' - Creates a member imperfection. - An imperfection case must be created before. - ''' - - def __init__(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str ='1', - comment: str = '', - params: dict = {}): - ''' - Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - comment (str, optional): Comments - params (dict, optional): Parameters - ''' - - # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - # Member Imperfection No. - clientObject.no = no - - # Member No. - clientObject.members = ConvertToDlString(members) - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - - - def InitialSwayRelative(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str = '1', - sway: float = 300.0, - imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, - comment: str = '', - params: dict = {}): - ''' - Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - sway (float): - imperfection_direction - comment (str, optional): Comments - params (dict, optional): Additional parameters - ''' - - # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - # Member Imperfection No. - clientObject.no = no - - # Member No. - clientObject.members = ConvertToDlString(members) - - # Sway - clientObject.basic_value_relative = sway - - # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name - - # Imperfection Type - clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_SWAY' - - # Imperfection Definition Type - clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - - def InitialBowRelative(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str = '1', - bow: float = 250.0, - imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, - comment: str = '', - params: dict = {}): - ''' - Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - bow (float): - imperfection_direction - comment (str, optional): Comments - params (dict, optional): Additional parameters - ''' - - # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - # Member Imperfection No. - clientObject.no = no - - # Member No. - clientObject.members = ConvertToDlString(members) - - # Bow - clientObject.basic_value_relative = bow - - # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name - - # Imperfection Type - clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW' - - # Imperfection Definition Type - clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - - def InitialBowRelativeAndCriterion(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str = '1', - active_criterion = ImperfectionActivationCriterion.ACTIVITY_CRITERION_ALWAYS, - bow = [250.0], - imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, - comment: str = '', - params: dict = {}): - ''' - Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - bow (float): - active_criterion (): - imperfection_direction - comment (str, optional): Comments - params (dict, optional): Additional parameters - ''' - - # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - # Member Imperfection No. - clientObject.no = no - - # Member No. - clientObject.members = ConvertToDlString(members) - - # Criterion - clientObject.active_criterion = active_criterion.name - - if active_criterion == ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE: - if len(bow) == 2: - clientObject.active_bow = bow[1] - else: - print('A second parameter in the bow list is required for this definition criterion. Eps must be specified, from which the imperfection is to take effect.') - - # Bow - clientObject.basic_value_relative = bow[0] - - # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name - - # Imperfection Type - clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION' - - # Imperfection Definition Type - clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) From 95b302a6a44729f61b09b5f689578a6a9d2ecd2a Mon Sep 17 00:00:00 2001 From: MichalO Date: Tue, 24 May 2022 07:54:35 +0200 Subject: [PATCH 12/14] finished Imperfection cases and tests --- RFEM/Imperfections/imperfectionCase.py | 420 +++++++++++++++++++++++-- RFEM/enums.py | 29 +- UnitTests/test_imperfectionCase.py | 43 ++- 3 files changed, 460 insertions(+), 32 deletions(-) diff --git a/RFEM/Imperfections/imperfectionCase.py b/RFEM/Imperfections/imperfectionCase.py index a0ba6cf7..c3f22d73 100644 --- a/RFEM/Imperfections/imperfectionCase.py +++ b/RFEM/Imperfections/imperfectionCase.py @@ -1,23 +1,40 @@ -from RFEM.enums import ImperfectionType +from pydoc import cli from RFEM.initModel import Model, clearAtributes, ConvertToDlString +from RFEM.enums import ImperfectionType, ImperfectionCaseDirection, DirectionForLevelDirection +from RFEM.enums import ImperfectionCaseSourceType, ImperfectionCaseAssignmentType class ImperfectionCase(): + level_imperfection_item: dict = {'no':1,'level':3,'e_1':0,'theta_1':0,'e_2':0,'theta_2':0,'comment':''} + imperfection_case_item: dict = {'no':1,'name':1, 'factor':1.1,'operator_type': 'OPERATOR_NONE','comment':''} + def __init__(self, no: int = 1, - assigned_to_load_combinations: str ='', + type = ImperfectionType.IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS, assigned_to_load_cases: str = '', + assigned_to_load_combinations: str ='', + assign_to_combinations_without_assigned_imperfection_case: bool = True, + active: bool = True, comment: str = '', - params: dict = {}): - ''' + params: dict = None, + model = Model): + """ + Imperfection Case + Args: - no (int): Imperfection Case Tag + no (int, optional): Number + type (enum, optional): Type + assigned_to_load_cases (str, optional): Assigned to load case + assigned_to_load_combinations (str, optional): Assigned to load combinations + assign_to_combinations_without_assigned_imperfection_case (bool, optional): Assign to all load combinations without assigned imperfection case + active (bool, optional): Active comment (str, optional): Comments - params (dict, optional): Parameters - ''' + params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance + """ # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:imperfection_case') + clientObject = model.clientModel.factory.create('ns0:imperfection_case') # Clears object atributes | Sets all atributes to None clearAtributes(clientObject) @@ -25,47 +42,59 @@ def __init__(self, # Imperfection Case No. clientObject.no = no + # Type of imperfection + clientObject.type = type.name + # Assign to Load Combinations - if len(assigned_to_load_combinations) > 0: + if assigned_to_load_combinations: clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) # Assign to Load Cases - if len(assigned_to_load_cases) > 0: + if assigned_to_load_cases: clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) - if len(assigned_to_load_cases) + len(assigned_to_load_combinations) == 0: - print('Warning: An imperfection case should be assigned to a load case or load combination.') + # Assign to Combinations Without Assigned Imperfection Case + clientObject.assign_to_combinations_without_assigned_imperfection_case = assign_to_combinations_without_assigned_imperfection_case + + # Active + clientObject.is_active = active # Comment clientObject.comment = comment # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] + if params: + for key in params: + clientObject[key] = params[key] # Add Imperfection Case to client model - Model.clientModel.service.set_imperfection_case(clientObject) + model.clientModel.service.set_imperfection_case(clientObject) - def Local(self, + @staticmethod + def Local( no: int = 1, assigned_to_load_combinations: str ='', assigned_to_load_cases: str = '', comment: str = '', - params: dict = {}): - ''' + params: dict = None, + model = Model): + """ + Imperfection Case Local Imperfections + Args: - no (int): Imperfection Case Tag + no (int, optional): Number assigned_to_load_combinations (str, optional): Assigned Load Combinations assigned_to_load_cases (str, optional): Assigned Load Cases comment (str, optional): Comments params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary - ''' + model (class, optional): Model instance + """ # assigned_to_load_combinations XY is first in parameter list because imperfections are # usually assigned to load combinations. # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:imperfection_case') + clientObject = model.clientModel.factory.create('ns0:imperfection_case') # Clears object atributes | Sets all atributes to None clearAtributes(clientObject) @@ -73,15 +102,15 @@ def Local(self, # Imperfection Case No. clientObject.no = no - # Der Typ local muss übergeben werden. Der wird jetzt nur gesetzt, weil er default ist. + # Local Type clientObject.type = ImperfectionType.IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS.name # Assign to Load Combinations - if len(assigned_to_load_combinations) > 0: + if assigned_to_load_combinations: clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) # Assign to Load Cases - if len(assigned_to_load_cases) > 0: + if assigned_to_load_cases: clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) if len(assigned_to_load_cases) + len(assigned_to_load_combinations) == 0: @@ -96,4 +125,345 @@ def Local(self, clientObject[key] = params[key] # Add Imperfection Case to client model - Model.clientModel.service.set_imperfection_case(clientObject) + model.clientModel.service.set_imperfection_case(clientObject) + + @staticmethod + def InitialSwayViaTable( + no: int = 1, + assigned_to_load_cases: str = '', + assigned_to_load_combinations: str ='', + assign_to_combinations_without_assigned_imperfection_case: bool = True, + direction = ImperfectionCaseDirection.IMPERFECTION_CASE_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, + direction_for_level_direction = DirectionForLevelDirection.DIRECTION_X, + coordinate_system: int = 1, + sway_coefficients_reciprocal: bool = True, + level_imperfections: list = [level_imperfection_item], + active: bool = True, + comment: str = '', + params: dict = None, + model = Model): + """ + Imperfection Case Initial Sway via Table + + Args: + no (int, optional): Number + type (enum, optional): Imperfection type + assigned_to_load_cases (str, optional): Assigned to load case + assigned_to_load_combinations (str, optional): Assigned to load combinations + assign_to_combinations_without_assigned_imperfection_case (bool, optional): Assign to all load combinations without assigned imperfection case + direction (enum, optional): Level direction + direction_for_level_direction (enum, optional): Imperfection direction + coordinate_system (int, optional): Coordinate system + sway_coefficients_reciprocal (bool, optional): Sway coefficient as reciprocal of 1 + level_imperfections (list, optional): Level imperfections + active (bool, optional): Active + comment (str, optional): Comments + params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance + """ + + # Client model | Imperfection Case + clientObject = model.clientModel.factory.create('ns0:imperfection_case') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Imperfection Case No. + clientObject.no = no + + # Type of imperfection + clientObject.type = ImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY_VIA_TABLE.name + + # Assign to Load Combinations + if assigned_to_load_combinations: + clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) + + # Assign to Load Cases + if assigned_to_load_cases: + clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) + + # Assign to Combinations Without Assigned Imperfection Case + clientObject.assign_to_combinations_without_assigned_imperfection_case = assign_to_combinations_without_assigned_imperfection_case + + # Level Direction + clientObject.direction = direction.name + + # Imperfection Direction + clientObject.direction_for_level_direction = direction_for_level_direction.name + + # Coordinate System + clientObject.coordinate_system = coordinate_system + + # Sway Coeefficient as Reciprocal of 1 + clientObject.sway_coefficients_reciprocal = sway_coefficients_reciprocal + + # Level Imperfections Table + clientObject.level_imperfections = model.clientModel.factory.create('ns0:array_of_imperfection_case_level_imperfections') + + for i in level_imperfections: + li_proto = model.clientModel.factory.create('ns0:imperfection_case_level_imperfections_row') + li_proto.no = i['no'] + li_proto.row.level = i['level'] + li_proto.row.e_1 = i['e_1'] + li_proto.row.theta_1 = i['theta_1'] + li_proto.row.e_2 = i['e_2'] + li_proto.row.theta_2 = i['theta_2'] + li_proto.row.comment = i['comment'] + + clientObject.level_imperfections.imperfection_case_level_imperfections.append(li_proto) + + # Active + clientObject.is_active = active + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + if params: + for key in params: + clientObject[key] = params[key] + + # Add Imperfection Case to client model + model.clientModel.service.set_imperfection_case(clientObject) + + @staticmethod + def NotionalLoads( + no: int = 1, + assigned_to_load_cases: str = '', + assigned_to_load_combinations: str ='', + assign_to_combinations_without_assigned_imperfection_case: bool = True, + load_case_for_notional_loads: int = 1, + active: bool = True, + comment: str = '', + params: dict = None, + model = Model): + """ + Imperfection Case + + Args: + no (int, optional): Number + assigned_to_load_cases (str, optional): Assigned to load case + assigned_to_load_combinations (str, optional): Assigned to load combinations + assign_to_combinations_without_assigned_imperfection_case (bool, optional): Assign to all load combinations without assigned imperfection case + load_case_for_notional_loads(int, manadatory): Load case for notional loads + active (bool, optional): Active + comment (str, optional): Comments + params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance + """ + + # Client model | Imperfection Case + clientObject = model.clientModel.factory.create('ns0:imperfection_case') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Imperfection Case No. + clientObject.no = no + + # Type of imperfection + clientObject.type = ImperfectionType.IMPERFECTION_TYPE_NOTIONAL_LOADS_FROM_LOAD_CASE.name + + # Assign to Load Combinations + if assigned_to_load_combinations: + clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) + + # Assign to Load Cases + if assigned_to_load_cases: + clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) + + # Assign to Combinations Without Assigned Imperfection Case + clientObject.assign_to_combinations_without_assigned_imperfection_case = assign_to_combinations_without_assigned_imperfection_case + + # Load Case for Notional Loads + clientObject.load_case_for_notional_loads = load_case_for_notional_loads + + # Active + clientObject.is_active = active + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + if params: + for key in params: + clientObject[key] = params[key] + + # Add Imperfection Case to client model + model.clientModel.service.set_imperfection_case(clientObject) + + @staticmethod + def StaticDeformation( + no: int = 1, + assigned_to_load_cases: str = '', + assigned_to_load_combinations: str ='', + assign_to_combinations_without_assigned_imperfection_case: bool = True, + direction = ImperfectionCaseDirection.IMPERFECTION_CASE_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, + coordinate_system: int = 1, + source = ImperfectionCaseSourceType.SOURCE_TYPE_LOAD_CASE, + imperfection_shape_from: int = 1, + imperfection_magnitude: float = 0.3, + magnitude_assignment_type = ImperfectionCaseAssignmentType.MAGNITUDE_ASSIGNMENT_SPECIFIC_NODE, + reference_node: int = None, + active: bool = True, + comment: str = '', + params: dict = None, + model = Model): + """ + Static Deformation Type + + Args: + no (int, optional): Number + assigned_to_load_cases (str, optional): Assigned to load case + assigned_to_load_combinations (str, optional): Assigned to load combinations + assign_to_combinations_without_assigned_imperfection_case (bool, optional): Assign to all load combinations without assigned imperfection case + direction (enum, optional): + coordinate_system (int, optional): + source (enum, optional): + imperfection_shape_from (int, optional): + imperfection_magnitude (float, optional): + magnitude_assignment_type (enum, optional): + reference_node (int, optional): + active (bool, optional): Active + comment (str, optional): Comments + params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance + """ + + # Client model | Imperfection Case + clientObject = model.clientModel.factory.create('ns0:imperfection_case') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Imperfection Case No. + clientObject.no = no + + # Type of imperfection + clientObject.type = ImperfectionType.IMPERFECTION_TYPE_STATIC_DEFORMATION.name + + # Assign to Load Combinations + if assigned_to_load_combinations: + clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) + + # Assign to Load Cases + if assigned_to_load_cases: + clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) + + # Assign to Combinations Without Assigned Imperfection Case + clientObject.assign_to_combinations_without_assigned_imperfection_case = assign_to_combinations_without_assigned_imperfection_case + + # Direction + clientObject.direction = direction.name + + # Coordinate System number + clientObject.coordinate_system = coordinate_system + + # Source + clientObject.source = source.name + + # Shape from Load Case/Combination + if source == ImperfectionCaseSourceType.SOURCE_TYPE_LOAD_CASE: + clientObject.shape_from_load_case = imperfection_shape_from + else: + clientObject.shape_from_load_combination = imperfection_shape_from + + # Imperfection Magnuítude + clientObject.delta_zero = imperfection_magnitude + + # Reference Location + clientObject.magnitude_assignment_type = magnitude_assignment_type.name + + # Reference Node + if magnitude_assignment_type == ImperfectionCaseAssignmentType.MAGNITUDE_ASSIGNMENT_SPECIFIC_NODE: + clientObject.reference_node = reference_node + + # Active + clientObject.is_active = active + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + if params: + for key in params: + clientObject[key] = params[key] + + # Add Imperfection Case to client model + model.clientModel.service.set_imperfection_case(clientObject) + + @staticmethod + def Group( + no: int = 1, + assigned_to_load_cases: str = '', + assigned_to_load_combinations: str ='', + assign_to_combinations_without_assigned_imperfection_case: bool = True, + imperfection_cases: list = [imperfection_case_item], + active: bool = True, + comment: str = '', + params: dict = None, + model = Model): + """ + Imperfection Case + + Args: + no (int, optional): Number + assigned_to_load_cases (str, optional): Assigned to load case + assigned_to_load_combinations (str, optional): Assigned to load combinations + assign_to_combinations_without_assigned_imperfection_case (bool, optional): Assign to all load combinations without assigned imperfection case + imperfection_cases (list, optional): Imperfection cases items + active (bool, optional): Active + comment (str, optional): Comments + params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance + """ + + # Client model | Imperfection Case + clientObject = model.clientModel.factory.create('ns0:imperfection_case') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Imperfection Case No. + clientObject.no = no + + # Type + clientObject.type = ImperfectionType.IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP.name + + # Assign to Load Combinations + if assigned_to_load_combinations: + clientObject.assigned_to_load_combinations = ConvertToDlString(assigned_to_load_combinations) + + # Assign to Load Cases + if assigned_to_load_cases: + clientObject.assigned_to_load_cases = ConvertToDlString(assigned_to_load_cases) + + # Assign to Combinations Without Assigned Imperfection Case + clientObject.assign_to_combinations_without_assigned_imperfection_case = assign_to_combinations_without_assigned_imperfection_case + + # Imperfection Case Items + clientObject.imperfection_cases_items = model.clientModel.factory.create('ns0:array_of_imperfection_case_imperfection_cases_items') + + for i in imperfection_cases: + li_proto = model.clientModel.factory.create('ns0:imperfection_case_imperfection_cases_items_row') + li_proto.no = i['no'] + li_proto.row.name = i['name'] + li_proto.row.factor = i['factor'] + li_proto.row.operator_type = i['operator_type'] + li_proto.row.comment = i['comment'] + + clientObject.imperfection_cases_items.imperfection_case_imperfection_cases_items.append(li_proto) + + # Active + clientObject.is_active = active + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + if params: + for key in params: + clientObject[key] = params[key] + + # Add Imperfection Case to client model + model.clientModel.service.set_imperfection_case(clientObject) diff --git a/RFEM/enums.py b/RFEM/enums.py index 7bd91143..b038cd38 100644 --- a/RFEM/enums.py +++ b/RFEM/enums.py @@ -1499,7 +1499,20 @@ class ImperfectionType(Enum): ''' Types for Imperfection ''' - IMPERFECTION_TYPE_BUCKLING_MODE, IMPERFECTION_TYPE_DYNAMIC_EIGENMODE, IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP, IMPERFECTION_TYPE_INITIAL_SWAY_VIA_TABLE, IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS, IMPERFECTION_TYPE_NOTIONAL_LOADS_FROM_LOAD_CASE, IMPERFECTION_TYPE_STATIC_DEFORMATION = range(7) + IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS, IMPERFECTION_TYPE_INITIAL_SWAY_VIA_TABLE, IMPERFECTION_TYPE_NOTIONAL_LOADS_FROM_LOAD_CASE, IMPERFECTION_TYPE_STATIC_DEFORMATION, IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP, \ + IMPERFECTION_TYPE_BUCKLING_MODE, IMPERFECTION_TYPE_DYNAMIC_EIGENMODE, = range(7) + +class ImperfectionCaseSourceType(Enum): + ''' + Imperfection Case, Static Deformation Type, Source Type + ''' + SOURCE_TYPE_LOAD_CASE, SOURCE_TYPE_LOAD_COMBINATION = range(2) + +class ImperfectionCaseAssignmentType(Enum): + ''' + Imperfection Case, Static Deformation Type, Magnitude Assignment Type + ''' + MAGNITUDE_ASSIGNMENT_SPECIFIC_NODE, MAGNITUDE_ASSIGNMENT_LOCATION_WITH_LARGEST_DISPLACEMENT = range(2) class ImperfectionDirection(Enum): ''' @@ -1774,6 +1787,20 @@ class SteelBoundaryConditionsEccentricityTypeZ(Enum): ECCENTRICITY_TYPE_AT_LOWER_FLANGE, ECCENTRICITY_TYPE_AT_UPPER_FLANGE, ECCENTRICITY_TYPE_NONE, ECCENTRICITY_TYPE_USER_VALUE = range( 4) +class ImperfectionCaseDirection(Enum): + ''' + Imperfection Case Sway via Table Direction + ''' + IMPERFECTION_CASE_DIRECTION_LOCAL_X, IMPERFECTION_CASE_DIRECTION_LOCAL_Y, IMPERFECTION_CASE_DIRECTION_LOCAL_Z, IMPERFECTION_CASE_DIRECTION_LOCAL_Y_NEGATIVE, IMPERFECTION_CASE_DIRECTION_LOCAL_Z_NEGATIVE, \ + IMPERFECTION_CASE_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, IMPERFECTION_CASE_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, IMPERFECTION_CASE_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, \ + IMPERFECTION_CASE_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_NEGATIVE, IMPERFECTION_CASE_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_NEGATIVE, IMPERFECTION_CASE_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_NEGATIVE, \ + IMPERFECTION_CASE_DIRECTION_SPATIAL = range(12) + +class DirectionForLevelDirection(Enum): + ''' + Imperfection Case, Sway via Table, Direction for Level Direction + ''' + DIRECTION_X, DIRECTION_Y, DIRECTION_Z, DIRECTION_XY, DIRECTION_XZ, DIRECTION_YZ = range(6) class ActionCategoryType(Enum): ''' diff --git a/UnitTests/test_imperfectionCase.py b/UnitTests/test_imperfectionCase.py index 52481d19..fb73758b 100644 --- a/UnitTests/test_imperfectionCase.py +++ b/UnitTests/test_imperfectionCase.py @@ -1,3 +1,4 @@ +from importlib import import_module import os import sys PROJECT_ROOT = os.path.abspath(os.path.join( @@ -6,7 +7,7 @@ ) sys.path.append(PROJECT_ROOT) -from RFEM.enums import * +from RFEM.enums import ImperfectionType, ImperfectionCaseAssignmentType, ActionCategoryType from RFEM.initModel import Model from RFEM.Imperfections.imperfectionCase import ImperfectionCase from RFEM.LoadCasesAndCombinations.loadCase import LoadCase @@ -15,15 +16,45 @@ if Model.clientModel is None: Model() -def test_member_set(): - +def test_imperfection_case(): Model.clientModel.service.delete_all() Model.clientModel.service.begin_modification() StaticAnalysisSettings() + + LoadCase(1, 'LC1') LoadCase(2, 'LC2') - ImperfectionCase(2, '2') + LoadCase(3, 'LC3') + LoadCase(4, 'LC4') + LoadCase(5, 'LC5') + + ImperfectionCase(1, ImperfectionType.IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS, '2') + ImperfectionCase.Local(2) + ImperfectionCase.InitialSwayViaTable(3,'1') + ImperfectionCase.NotionalLoads(4,'3') + ImperfectionCase.StaticDeformation(5,'4',magnitude_assignment_type = ImperfectionCaseAssignmentType.MAGNITUDE_ASSIGNMENT_LOCATION_WITH_LARGEST_DISPLACEMENT) + ImperfectionCase.Group(6,'1') + Model.clientModel.service.finish_modification() - imp = Model.clientModel.service.get_imperfection_case(2) - assert imp.type == 'IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS' + imp = Model.clientModel.service.get_imperfection_case(1) + assert imp.type == ImperfectionType.IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS.name assert imp.assigned_to_load_cases == '2' + + imp = Model.clientModel.service.get_imperfection_case(2) + assert imp.type == ImperfectionType.IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS.name + + imp = Model.clientModel.service.get_imperfection_case(3) + assert imp.type == ImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY_VIA_TABLE.name + assert imp.level_imperfections.imperfection_case_level_imperfections[0].row.level == 3 + + imp = Model.clientModel.service.get_imperfection_case(4) + assert imp.type == ImperfectionType.IMPERFECTION_TYPE_NOTIONAL_LOADS_FROM_LOAD_CASE.name + assert imp.assigned_to_load_cases == '3' + + imp = Model.clientModel.service.get_imperfection_case(5) + assert imp.type == ImperfectionType.IMPERFECTION_TYPE_STATIC_DEFORMATION.name + assert imp.assigned_to_load_cases == '4' + + imp = Model.clientModel.service.get_imperfection_case(6) + assert imp.type == ImperfectionType.IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP.name + assert round(imp.imperfection_cases_items.imperfection_case_imperfection_cases_items[0].row.factor, 2) == 1.1 From 8eefa2636a6cd84851f4c2f2dcb4956220856cfa Mon Sep 17 00:00:00 2001 From: MichalO Date: Wed, 25 May 2022 07:46:42 +0200 Subject: [PATCH 13/14] MemberImperfection and memberSetImperfection updated incl. tests --- RFEM/BasicObjects/section.py | 1 + RFEM/Imperfections/memberImperfection.py | 302 ++++++++------------ RFEM/Imperfections/membersetImperfection.py | 157 +++++++++- RFEM/enums.py | 62 ++++ RFEM/initModel.py | 2 +- UnitTests/test_Export.py | 7 +- UnitTests/test_MemberSetLoad_test.py | 2 +- UnitTests/test_imperfectionCase.py | 44 ++- 8 files changed, 390 insertions(+), 187 deletions(-) diff --git a/RFEM/BasicObjects/section.py b/RFEM/BasicObjects/section.py index 861b1c54..acf0a383 100644 --- a/RFEM/BasicObjects/section.py +++ b/RFEM/BasicObjects/section.py @@ -16,6 +16,7 @@ def __init__(self, material_no (int): Tag of Material assigned to Section comment (str, optional): Comments params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance ''' # Client model | Section diff --git a/RFEM/Imperfections/memberImperfection.py b/RFEM/Imperfections/memberImperfection.py index a4234e4d..e7333b79 100644 --- a/RFEM/Imperfections/memberImperfection.py +++ b/RFEM/Imperfections/memberImperfection.py @@ -1,124 +1,39 @@ from RFEM.initModel import Model, clearAtributes, ConvertToDlString -from RFEM.enums import * +from RFEM.enums import MemberImperfectionType, MemberImperfectionDefinitionType +from RFEM.enums import ImperfectionDirection, ImperfectionDirection, MemberImperfectionActiveCriterion class MemberImperfection(): - ''' - Creates a member imperfection. - An imperfection case must be created before. - ''' def __init__(self, no: int = 1, - imperfection_case_no: int = 1, + imperfection_case: int = 1, members: str ='1', + imperfection_type = MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY, + definition_type = MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE, + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Z, + parameters: list = [0.035], comment: str = '', - params: dict = {}): - ''' - Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - comment (str, optional): Comments - params (dict, optional): Parameters - ''' - - # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - # Member Imperfection No. - clientObject.no = no - - # Member No. - clientObject.members = ConvertToDlString(members) - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - - - def InitialSwayRelative(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str = '1', - sway: float = 300.0, - imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, - comment: str = '', - params: dict = {}): - ''' - Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - sway (float): - imperfection_direction - comment (str, optional): Comments - params (dict, optional): Additional parameters - ''' - - # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) - - # Member Imperfection No. - clientObject.no = no - - # Member No. - clientObject.members = ConvertToDlString(members) - - # Sway - clientObject.basic_value_relative = sway - - # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name - - # Imperfection Type - clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_SWAY' + params: dict = None, + model = Model): + """ + Member Imperfection + An imperfection case must be created before. - # Imperfection Definition Type - clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - - def InitialBowRelative(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str = '1', - bow: float = 250.0, - imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, - comment: str = '', - params: dict = {}): - ''' Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - bow (float): - imperfection_direction + no (int, optional): Number + imperfection_case (int, optional): Imperfection case number + members (str, optional): Assigned to members + imperfection_type (enum, optional): Imperfection Type + definition_type (enum, optional): Definition Type + imperfection_direction (enum, optional): Imperfection direction + parameters (list, optional): Parameters depending on imperfection and definition type comment (str, optional): Comments - params (dict, optional): Additional parameters - ''' + params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance + """ # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') + clientObject = model.clientModel.factory.create('ns0:member_imperfection') # Clears object atributes | Sets all atributes to None clearAtributes(clientObject) @@ -126,91 +41,118 @@ def InitialBowRelative(self, # Member Imperfection No. clientObject.no = no - # Member No. - clientObject.members = ConvertToDlString(members) - - # Bow - clientObject.basic_value_relative = bow - - # Imperfection Direction - clientObject.imperfection_direction = imperfection_direction.name - - # Imperfection Type - clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW' - - # Imperfection Definition Type - clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' - - # Comment - clientObject.comment = comment - - # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] - - # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) - - def InitialBowRelativeAndCriterion(self, - no: int = 1, - imperfection_case_no: int = 1, - members: str = '1', - active_criterion = ImperfectionActivationCriterion.ACTIVITY_CRITERION_ALWAYS, - bow = [250.0], - imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Y, - comment: str = '', - params: dict = {}): - ''' - Args: - no (int): Member Imperfection Tag - imperfection_case_no (int): number of imperfection case for this member imperfection - members (str) : List of member numbers - bow (float): - active_criterion (): - imperfection_direction - comment (str, optional): Comments - params (dict, optional): Additional parameters - ''' - - # Client model | Imperfection Case - clientObject = Model.clientModel.factory.create('ns0:member_imperfection') - - # Clears object atributes | Sets all atributes to None - clearAtributes(clientObject) + # Member Imperfection Type + clientObject.imperfection_type = imperfection_type.name - # Member Imperfection No. - clientObject.no = no - - # Member No. + # Assigned to Members No. clientObject.members = ConvertToDlString(members) - # Criterion - clientObject.active_criterion = active_criterion.name + # Imperfection Case + clientObject.imperfection_case = imperfection_case - if active_criterion == ImperfectionActivationCriterion.ACTIVITY_CRITERION_DEFINE: - if len(bow) == 2: - clientObject.active_bow = bow[1] - else: - print('A second parameter in the bow list is required for this definition criterion. Eps must be specified, from which the imperfection is to take effect.') - - # Bow - clientObject.basic_value_relative = bow[0] + # Definition Type + clientObject.definition_type = definition_type.name # Imperfection Direction clientObject.imperfection_direction = imperfection_direction.name - # Imperfection Type - clientObject.imperfection_type = 'IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION' + # Parameters + if imperfection_type == MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY: + if definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_RELATIVE: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE: + clientObject.basic_value_absolute = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1992_1_1993_1: + clientObject.basic_value_relative = parameters[0] + clientObject.height = parameters[1] + clientObject.column_in_row = parameters[2] + clientObject.reduction_factor_h = parameters[3] + clientObject.reduction_factor_m = parameters[4] + clientObject.initial_sway = parameters[5] + clientObject.initial_sway_inverted = parameters[6] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1995_1_1: + clientObject.basic_value_relative = parameters[0] + clientObject.height = parameters[1] + clientObject.reduction_factor_h = parameters[2] + clientObject.initial_sway = parameters[3] + clientObject.initial_sway_inverted = parameters[4] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ANSI_CURRENT: + clientObject.basic_value_coefficient = parameters[0] + clientObject.standard_factor_enumeration = parameters[1].name + clientObject.standard_factor_number = parameters[2] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017_GRAVITY_LOAD: + clientObject.basic_value_coefficient = parameters[0] + clientObject.standard_factor_enumeration = parameters[1].name + clientObject.standard_factor_number = parameters[2] + clientObject.case_object = parameters[3] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_CURRENT: + clientObject.basic_value_coefficient = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_GRAVITY_LOAD: + clientObject.basic_value_coefficient = parameters[0] + clientObject.case_object = parameters[1] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017_CURRENT: + clientObject.basic_value_relative = parameters[0] + clientObject.height = parameters[1] + clientObject.number_of_floors = parameters[2] + clientObject.delta = parameters[3] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017_GRAVITY_LOAD: + clientObject.basic_value_coefficient = parameters[0] + clientObject.number_of_floors = parameters[1] + clientObject.case_object = parameters[2] + else: + assert False, 'Wrong MemberImperfectionDefinitionType for IMPERFECTION_TYPE_INITIAL_SWAY' + + elif imperfection_type == MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_BOW: + if definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_RELATIVE: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE: + clientObject.basic_value_absolute = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1993_1_1: + clientObject.section_design = parameters[0].name + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1995_1_1: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1999_1_1: + clientObject.section_design = parameters[0].name + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ANSI_CURRENT: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ANSI_GRAVITY_LOAD: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_CURRENT: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_GRAVITY_LOAD: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017: + #clientObject. = parameters[0] # TODO: possibly missing parameter Buckling Curve = a - d + pass + else: + assert False, 'Wrong MemberImperfectionDefinitionType for IMPERFECTION_TYPE_INITIAL_BOW' + + elif imperfection_type == MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION: + if definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_RELATIVE: + clientObject.basic_value_relative = parameters[0] + clientObject.active_criterion = parameters[1].name + if clientObject.active_criterion == MemberImperfectionActiveCriterion.ACTIVITY_CRITERION_DEFINE: + clientObject.active_bow = parameters[2] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE: + clientObject.basic_value_absolute = parameters[0] + clientObject.active_criterion = parameters[1].name + if clientObject.active_criterion == MemberImperfectionActiveCriterion.ACTIVITY_CRITERION_DEFINE: + clientObject.active_bow = parameters[2] + else: + assert False, 'Wrong MemberImperfectionDefinitionType for IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION' + else: + assert False, 'Wrong MemberImperfectionDefinitionType' - # Imperfection Definition Type - clientObject.definition_type = 'DEFINITION_TYPE_RELATIVE' + # Reference to List of Members + clientObject.reference_to_list_of_members # Comment clientObject.comment = comment # Adding optional parameters via dictionary - for key in params: - clientObject[key] = params[key] + if params: + for key in params: + clientObject[key] = params[key] # Add Member Imperfection to client model - Model.clientModel.service.set_member_imperfection(imperfection_case_no, clientObject) + model.clientModel.service.set_member_imperfection(imperfection_case, clientObject) diff --git a/RFEM/Imperfections/membersetImperfection.py b/RFEM/Imperfections/membersetImperfection.py index 8903f2e1..d5b88c71 100644 --- a/RFEM/Imperfections/membersetImperfection.py +++ b/RFEM/Imperfections/membersetImperfection.py @@ -1 +1,156 @@ -from RFEM.initModel import Model, clearAtributes, ConvertToDlString \ No newline at end of file +from RFEM.initModel import Model, clearAtributes, ConvertToDlString +from RFEM.enums import MemberImperfectionType, MemberImperfectionDefinitionType +from RFEM.enums import ImperfectionDirection, MemberImperfectionActiveCriterion + +class MemberSetImperfection(): + + def __init__(self, + no: int = 1, + imperfection_case: int = 1, + member_sets: str ='1', + imperfection_type = MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY, + definition_type = MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE, + imperfection_direction = ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Z, + parameters: list = [0.0022], + comment: str = '', + params: dict = None, + model = Model): + """ + Member Imperfection + An imperfection case must be created before. + + Args: + no (int, optional): Number + imperfection_case (int, optional): _description_. Defaults to 1. + member_sets (str, optional): _description_. Defaults to '1'. + imperfection_type (enum, optional): _description_. Defaults to MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY. + definition_type (enum, optional): _description_. Defaults to MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE. + imperfection_direction (enum, optional): _description_. Defaults to ImperfectionDirection.IMPERFECTION_DIRECTION_LOCAL_Z. + parameters (list, optional): _description_. Defaults to [0.035]. + comment (str, optional): Comments + params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary + model (class, optional): Model instance + """ + + # Client model | Imperfection Case + clientObject = model.clientModel.factory.create('ns0:member_set_imperfection') + + # Clears object atributes | Sets all atributes to None + clearAtributes(clientObject) + + # Member Imperfection No. + clientObject.no = no + + # Member Imperfection Type + clientObject.imperfection_type = imperfection_type.name + + # Assigned to Members No. + clientObject.member_sets = ConvertToDlString(member_sets) + + # Imperfection Case + clientObject.imperfection_case = imperfection_case + + # Definition Type + clientObject.definition_type = definition_type.name + + + # Imperfection Direction + clientObject.imperfection_direction = imperfection_direction.name + + # Parameters + if imperfection_type == MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY: + if definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_RELATIVE: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE: + clientObject.basic_value_absolute = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1992_1_1993_1: + clientObject.basic_value_relative = parameters[0] + clientObject.height = parameters[1] + clientObject.column_in_row = parameters[2] + clientObject.reduction_factor_h = parameters[3] + clientObject.reduction_factor_m = parameters[4] + clientObject.initial_sway = parameters[5] + clientObject.initial_sway_inverted = parameters[6] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1995_1_1: + clientObject.basic_value_relative = parameters[0] + clientObject.height = parameters[1] + clientObject.reduction_factor_h = parameters[2] + clientObject.initial_sway = parameters[3] + clientObject.initial_sway_inverted = parameters[4] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ANSI_CURRENT: + clientObject.basic_value_coefficient = parameters[0] + clientObject.standard_factor_enumeration = parameters[1].name + clientObject.standard_factor_number = parameters[2] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017_GRAVITY_LOAD: + clientObject.basic_value_coefficient = parameters[0] + clientObject.standard_factor_enumeration = parameters[1].name + clientObject.standard_factor_number = parameters[2] + clientObject.case_object = parameters[3] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_CURRENT: + clientObject.basic_value_coefficient = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_GRAVITY_LOAD: + clientObject.basic_value_coefficient = parameters[0] + clientObject.case_object = parameters[1] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017_CURRENT: + clientObject.basic_value_relative = parameters[0] + clientObject.height = parameters[1] + clientObject.number_of_floors = parameters[2] + clientObject.delta = parameters[3] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017_GRAVITY_LOAD: + clientObject.basic_value_coefficient = parameters[0] + clientObject.number_of_floors = parameters[1] + clientObject.case_object = parameters[2] + else: + assert False, 'Wrong MemberImperfectionDefinitionType for IMPERFECTION_TYPE_INITIAL_SWAY' + + elif imperfection_type == MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_BOW: + if definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_RELATIVE: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE: + clientObject.basic_value_absolute = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1993_1_1: + clientObject.section_design = parameters[0].name + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1995_1_1: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1999_1_1: + clientObject.section_design = parameters[0].name + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ANSI_CURRENT: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ANSI_GRAVITY_LOAD: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_CURRENT: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_CSA_GRAVITY_LOAD: + clientObject.basic_value_relative = parameters[0] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_GB_50017_2017: + #clientObject. = parameters[0] # TODO: possibly missing parameter Buckling Curve = a - d + pass + else: + assert False, 'Wrong MemberImperfectionDefinitionType for IMPERFECTION_TYPE_INITIAL_BOW' + + elif imperfection_type == MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION: + if definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_RELATIVE: + clientObject.basic_value_relative = parameters[0] + clientObject.active_criterion = parameters[1].name + if clientObject.active_criterion == MemberImperfectionActiveCriterion.ACTIVITY_CRITERION_DEFINE: + clientObject.active_bow = parameters[2] + elif definition_type == MemberImperfectionDefinitionType.DEFINITION_TYPE_ABSOLUTE: + clientObject.basic_value_absolute = parameters[0] + clientObject.active_criterion = parameters[1].name + if clientObject.active_criterion == MemberImperfectionActiveCriterion.ACTIVITY_CRITERION_DEFINE: + clientObject.active_bow = parameters[2] + else: + assert False, 'Wrong MemberImperfectionDefinitionType for IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION' + else: + assert False, 'Wrong MemberImperfectionDefinitionType' + + # Comment + clientObject.comment = comment + + # Adding optional parameters via dictionary + if params: + for key in params: + clientObject[key] = params[key] + + # Add Member Imperfection to client model + model.clientModel.service.set_member_set_imperfection(imperfection_case, clientObject) diff --git a/RFEM/enums.py b/RFEM/enums.py index bccd9974..b135ba46 100644 --- a/RFEM/enums.py +++ b/RFEM/enums.py @@ -1392,6 +1392,7 @@ class ModelCheckProcessOptionType(Enum): ''' CROSS_LINES, CROSS_MEMBERS, DELETE_UNUSED_NODES, UNITE_NODES_AND_DELETE_UNUSED_NODES = range(4) + class ImperfectionType(Enum): ''' Types for Imperfection @@ -1399,18 +1400,79 @@ class ImperfectionType(Enum): IMPERFECTION_TYPE_LOCAL_IMPERFECTIONS, IMPERFECTION_TYPE_INITIAL_SWAY_VIA_TABLE, IMPERFECTION_TYPE_NOTIONAL_LOADS_FROM_LOAD_CASE, IMPERFECTION_TYPE_STATIC_DEFORMATION, IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP, \ IMPERFECTION_TYPE_BUCKLING_MODE, IMPERFECTION_TYPE_DYNAMIC_EIGENMODE = range(7) + +class MemberImperfectionType(Enum): + ''' + Member Imperfection Type + ''' + IMPERFECTION_TYPE_INITIAL_SWAY, IMPERFECTION_TYPE_INITIAL_BOW, IMPERFECTION_TYPE_INITIAL_BOW_AND_CRITERION = range(3) + + +class ImperfectionDirection(Enum): + ''' + Direction of member imperfection + ''' + IMPERFECTION_DIRECTION_GLOBAL_X_OR_USER_DEFINED_U_TRUE, IMPERFECTION_DIRECTION_GLOBAL_Y_OR_USER_DEFINED_V_TRUE, IMPERFECTION_DIRECTION_GLOBAL_Z_OR_USER_DEFINED_W_TRUE, \ + IMPERFECTION_DIRECTION_LOCAL_Y, IMPERFECTION_DIRECTION_LOCAL_Y_NEGATIVE, IMPERFECTION_DIRECTION_LOCAL_Z, IMPERFECTION_DIRECTION_LOCAL_Z_NEGATIVE, IMPERFECTION_DIRECTION_PRINCIPAL_U, \ + IMPERFECTION_DIRECTION_PRINCIPAL_U_NEGATIVE, IMPERFECTION_DIRECTION_PRINCIPAL_V, IMPERFECTION_DIRECTION_PRINCIPAL_V_NEGATIVE = range(11) + + +class MemberImperfectionDefinitionType(Enum): + ''' + Member Imperfection Definition Type + ''' + DEFINITION_TYPE_RELATIVE, DEFINITION_TYPE_ABSOLUTE, DEFINITION_TYPE_NOTIONAL_LOAD, DEFINITION_TYPE_ANSI_CURRENT, DEFINITION_TYPE_ANSI_GRAVITY_LOAD, \ + DEFINITION_TYPE_EN_1993_1_1, DEFINITION_TYPE_EN_1999_1_1, DEFINITION_TYPE_CSA_CURRENT, DEFINITION_TYPE_CSA_GRAVITY_LOAD, DEFINITION_TYPE_EN_1992_1_1993_1, \ + DEFINITION_TYPE_EN_1995_1_1, DEFINITION_TYPE_GB_50017_2017, DEFINITION_TYPE_GB_50017_2017_CURRENT, DEFINITION_TYPE_GB_50017_2017_GRAVITY_LOAD = range(14) + + +class MemberImperfectionCoordinateSystem(Enum): + ''' + Member Imperfection Coordinate System + ''' + COORDINATE_SYSTEM_TYPE_LOCAL, COORDINATE_SYSTEM_TYPE_PRINCIPAL = range(2) + + +class MemberImperfectionSectionDesign(Enum): + ''' + Member Imperfection Section Design + ''' + SECTION_DESIGN_ELASTIC, SECTION_DESIGN_PLASTIC = range(2) + +class MemberImperfectionActiveCriterion(Enum): + ''' + Member Imperfection Active Criterion + ''' + ACTIVITY_CRITERION_ALWAYS, ACTIVITY_CRITERION_EN_1993, ACTIVITY_CRITERION_EN_1999, ACTIVITY_CRITERION_DIN_18800, ACTIVITY_CRITERION_DEFINE = range(5) + + +class MemberImperfectionStandardFactor(Enum): + ''' + Member Imperfection Standard Factor + ''' + STANDARD_FACTOR_LRFD, STANDARD_FACTOR_ASD = range(2) + +class ImperfectionActivationCriterion(Enum): + ''' + Activation criterion for bow + ''' + ACTIVITY_CRITERION_ALWAYS, ACTIVITY_CRITERION_DEFINE, ACTIVITY_CRITERION_DIN_18800, ACTIVITY_CRITERION_EN_1993, ACTIVITY_CRITERION_EN_1999 = range(5) + + class ImperfectionCaseSourceType(Enum): ''' Imperfection Case, Static Deformation Type, Source Type ''' SOURCE_TYPE_LOAD_CASE, SOURCE_TYPE_LOAD_COMBINATION = range(2) + class ImperfectionCaseAssignmentType(Enum): ''' Imperfection Case, Static Deformation Type, Magnitude Assignment Type ''' MAGNITUDE_ASSIGNMENT_SPECIFIC_NODE, MAGNITUDE_ASSIGNMENT_LOCATION_WITH_LARGEST_DISPLACEMENT = range(2) + class OptimizeOnType(Enum): ''' Optimization Settings Optimize On Type diff --git a/RFEM/initModel.py b/RFEM/initModel.py index cfbb160c..f0d6e26a 100644 --- a/RFEM/initModel.py +++ b/RFEM/initModel.py @@ -146,7 +146,7 @@ def closeModel(index_or_name, save_changes = False): if modelLs.name[i] == index_or_name: client.service.close_model(i, save_changes) else: - assert True, 'Parameter index_or_name must be int or string.' + assert False, 'Parameter index_or_name must be int or string.' def insertSpaces(lst: list): ''' diff --git a/UnitTests/test_Export.py b/UnitTests/test_Export.py index 2733077a..d7b6eebe 100644 --- a/UnitTests/test_Export.py +++ b/UnitTests/test_Export.py @@ -48,9 +48,10 @@ def test_export(): # supported formats formats = ['.xml','.xlsx', '.gltf', '.glb'] # export to .vtk doesn't work for i in formats: - ExportTo(os.path.join(dirname, 'export'+i)) - assert True, f'Export to {i} does not work!' - + try: + ExportTo(os.path.join(dirname, 'export'+i)) + except RuntimeError: + print(f'Export to {i} does not work!') Model.clientModel.service.finish_modification() diff --git a/UnitTests/test_MemberSetLoad_test.py b/UnitTests/test_MemberSetLoad_test.py index 49bef1cc..3853f0d8 100644 --- a/UnitTests/test_MemberSetLoad_test.py +++ b/UnitTests/test_MemberSetLoad_test.py @@ -14,7 +14,7 @@ from RFEM.BasicObjects.node import Node from RFEM.BasicObjects.section import Section from RFEM.BasicObjects.material import Material -from RFEM.initModel import Model, Calculate_all +from RFEM.initModel import Model from RFEM.enums import * if Model.clientModel is None: diff --git a/UnitTests/test_imperfectionCase.py b/UnitTests/test_imperfectionCase.py index fb73758b..464e1c9d 100644 --- a/UnitTests/test_imperfectionCase.py +++ b/UnitTests/test_imperfectionCase.py @@ -7,11 +7,20 @@ ) sys.path.append(PROJECT_ROOT) -from RFEM.enums import ImperfectionType, ImperfectionCaseAssignmentType, ActionCategoryType +from RFEM.enums import ImperfectionType, SetType, ImperfectionCaseAssignmentType from RFEM.initModel import Model +from RFEM.BasicObjects.node import Node +from RFEM.BasicObjects.member import Member +from RFEM.BasicObjects.section import Section +from RFEM.BasicObjects.material import Material +from RFEM.BasicObjects.memberSet import MemberSet from RFEM.Imperfections.imperfectionCase import ImperfectionCase +from RFEM.Imperfections.memberImperfection import MemberImperfection +from RFEM.Imperfections.memberSetImperfection import MemberSetImperfection from RFEM.LoadCasesAndCombinations.loadCase import LoadCase from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings +from RFEM.enums import MemberImperfectionType, MemberImperfectionDefinitionType + if Model.clientModel is None: Model() @@ -19,6 +28,33 @@ def test_imperfection_case(): Model.clientModel.service.delete_all() Model.clientModel.service.begin_modification() + + # Create Material + Material(1, 'S235') + + # Create Section + Section(1, 'IPE 300') + Section(2, 'CHS 100x4') + + # Create Nodes + Node(1, 0.0, 0.0, 0.0) + Node(2, 2, 0.0, 0.0) + Node(3, 4, 0, 0) + + Node(4, 0, 5, 0) + Node(5, 2, 5, 0) + Node(6, 4, 5, 0) + + # Create Member + Member(1, 1, 2, 0, 1) + Member(2, 2, 3, 0, 1) + Member(3, 4, 6, 0, 2) + Member(4, 6, 5, 0, 2) + + # Create Member Set + MemberSet(1, '1 2', SetType.SET_TYPE_CONTINUOUS) + MemberSet(2, '3 4', SetType.SET_TYPE_CONTINUOUS) + StaticAnalysisSettings() LoadCase(1, 'LC1') @@ -34,6 +70,12 @@ def test_imperfection_case(): ImperfectionCase.StaticDeformation(5,'4',magnitude_assignment_type = ImperfectionCaseAssignmentType.MAGNITUDE_ASSIGNMENT_LOCATION_WITH_LARGEST_DISPLACEMENT) ImperfectionCase.Group(6,'1') + MemberImperfection(1, 1) + MemberImperfection(2, 1,'2',MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY, MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1992_1_1993_1, parameters=[250, 0.002, 2, 1,1,0.006, 220]) + MemberImperfection(3, 1,'3',MemberImperfectionType.IMPERFECTION_TYPE_INITIAL_SWAY, MemberImperfectionDefinitionType.DEFINITION_TYPE_EN_1995_1_1, parameters=[220, 0.002,1, 0.006, 230]) + + MemberSetImperfection(1, 1) + Model.clientModel.service.finish_modification() imp = Model.clientModel.service.get_imperfection_case(1) From 623455a0be77f80bec7cae3335adbee3455f387a Mon Sep 17 00:00:00 2001 From: MichalO Date: Wed, 25 May 2022 07:49:57 +0200 Subject: [PATCH 14/14] quick fix --- UnitTests/test_imperfectionCase.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitTests/test_imperfectionCase.py b/UnitTests/test_imperfectionCase.py index 464e1c9d..06963176 100644 --- a/UnitTests/test_imperfectionCase.py +++ b/UnitTests/test_imperfectionCase.py @@ -1,4 +1,4 @@ -from importlib import import_module + import os import sys PROJECT_ROOT = os.path.abspath(os.path.join( @@ -16,7 +16,7 @@ from RFEM.BasicObjects.memberSet import MemberSet from RFEM.Imperfections.imperfectionCase import ImperfectionCase from RFEM.Imperfections.memberImperfection import MemberImperfection -from RFEM.Imperfections.memberSetImperfection import MemberSetImperfection +from RFEM.Imperfections.membersetImperfection import MemberSetImperfection from RFEM.LoadCasesAndCombinations.loadCase import LoadCase from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings from RFEM.enums import MemberImperfectionType, MemberImperfectionDefinitionType