From d6bfb05a54cfb73e4fea9050f666004c962d2d46 Mon Sep 17 00:00:00 2001 From: KaratasD Date: Tue, 5 Apr 2022 09:44:56 +0200 Subject: [PATCH 1/3] updated Member Class Line Assignment --- RFEM/BasicObjects/member.py | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/RFEM/BasicObjects/member.py b/RFEM/BasicObjects/member.py index a440862b..6ed52c3a 100644 --- a/RFEM/BasicObjects/member.py +++ b/RFEM/BasicObjects/member.py @@ -9,6 +9,7 @@ def __init__(self, rotation_angle: float = 0.0, start_section_no: int = 1, end_section_no: int = 1, + line = None, start_member_hinge_no: int = 0, end_member_hinge_no: int = 0, comment: str = '', @@ -23,6 +24,7 @@ def __init__(self, end_section_no (int): Tag of End Section start_member_hinge_no (int): Tag of Start Member Hinge end_member_hinge_no (int): Tag of End Member Hinge + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -54,6 +56,9 @@ def __init__(self, # End Section No. clientObject.section_end = end_section_no + # Assigned Line No. + clientObject.line = line + # Start Member Hinge No. clientObject.member_hinge_start = start_member_hinge_no @@ -81,6 +86,7 @@ def Beam( rotation_parameters = [0], start_section_no: int = 1, end_section_no: int = 1, + line = None, distribution_parameters = [], comment: str = '', params: dict = {'member_hinge_start':0, 'member_hinge_end': 0, @@ -132,6 +138,7 @@ def Beam( rotation_parameters = [rotation_surface, rotation_surface_plane_type] start_section_no (int): Tag of Start Section end_section_no (int): End of End Section + line (int, optional): Assigned Line distribution_parameters (list): Distribution Parameters comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary @@ -278,6 +285,9 @@ def Beam( # End Section No. clientObject.section_end = end_section_no + # Assigned Line No. + clientObject.line = line + # Update parameters params_up: dict = {'member_hinge_start':0, 'member_hinge_end': 0, 'member_eccentricity_start': 0, 'member_eccentricity_end': 0, @@ -339,6 +349,7 @@ def Rigid( end_node_no: int = 2, rotation_specification_type = MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, rotation_parameters = [0], + line = None, comment: str = '', params: dict = {'member_hinge_start':0, 'member_hinge_end': 0, 'member_eccentricity_start': 0, 'member_eccentricity_end': 0, @@ -360,6 +371,7 @@ def Rigid( rotation_parameters = [rotation_plane_type] for rotation_specification_type == MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_SURFACE: rotation_parameters = [rotation_surface, rotation_surface_plane_type] + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -423,6 +435,9 @@ def Rigid( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment @@ -446,6 +461,7 @@ def Rib( rib_surfaces_no = [], rib_alignment = MemberTypeRibAlignment.ALIGNMENT_ON_Z_SIDE_POSITIVE, reference_width_type = MemberReferenceLengthWidthType.REFERENCE_LENGTH_WIDTH_SIXTH, + line = None, comment: str = '', params: dict = {'member_hinge_start':0, 'member_hinge_end': 0, 'support':0, @@ -468,6 +484,7 @@ def Rib( rib_surfaces_no (list): Surfaces Tags Assigned to Rib rib_alignment (enum): Rib Alignment Enumeration reference_width_type (enum): Reference Width Type Enumeration + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary @@ -551,6 +568,9 @@ def Rib( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment @@ -570,6 +590,7 @@ def Truss( rotation_specification_type = MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, rotation_parameters = [0], section_no: int = 1, + line = None, comment: str = '', params: dict = {'member_eccentricity_start': 0, 'member_eccentricity_end': 0, 'member_nonlinearity': 0, @@ -596,6 +617,7 @@ def Truss( for rotation_specification_type == MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_SURFACE: rotation_parameters = [rotation_surface, rotation_surface_plane_type] section_no (int): Section Tag + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -667,6 +689,9 @@ def Truss( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment @@ -686,6 +711,7 @@ def TrussOnlyN( rotation_specification_type = MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, rotation_parameters = [0], section_no: int = 1, + line = None, comment: str = '', params: dict = {'member_eccentricity_start': 0, 'member_eccentricity_end': 0, 'member_nonlinearity': 0, @@ -712,6 +738,7 @@ def TrussOnlyN( for rotation_specification_type == MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_SURFACE: rotation_parameters = [rotation_surface, rotation_surface_plane_type] section_no (int): Section Tag + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -783,6 +810,9 @@ def TrussOnlyN( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment @@ -802,6 +832,7 @@ def Tension( rotation_specification_type = MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, rotation_parameters = [0], section_no: int = 1, + line = None, comment: str = '', params: dict = {'member_eccentricity_start': 0, 'member_eccentricity_end': 0, 'member_nonlinearity': 0, @@ -828,6 +859,7 @@ def Tension( for rotation_specification_type == MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_SURFACE: rotation_parameters = [rotation_surface, rotation_surface_plane_type] section_no (int): Section Tag + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -899,6 +931,9 @@ def Tension( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment @@ -918,6 +953,7 @@ def Compression( rotation_specification_type = MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, rotation_parameters = [0], section_no: int = 1, + line = None, comment: str = '', params: dict = {'member_eccentricity_start': 0, 'member_eccentricity_end': 0, 'member_nonlinearity': 0, @@ -944,6 +980,7 @@ def Compression( for rotation_specification_type == MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_SURFACE: rotation_parameters = [rotation_surface, rotation_surface_plane_type] section_no (int): Section Tag + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -1015,6 +1052,9 @@ def Compression( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment @@ -1034,6 +1074,7 @@ def Buckling( rotation_specification_type = MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, rotation_parameters = [0], section_no: int = 1, + line = None, comment: str = '', params: dict = {'member_eccentricity_start': 0, 'member_eccentricity_end': 0, 'member_nonlinearity': 0, @@ -1060,6 +1101,7 @@ def Buckling( for rotation_specification_type == MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_SURFACE: rotation_parameters = [rotation_surface, rotation_surface_plane_type] section_no (int): Section Tag + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -1131,6 +1173,9 @@ def Buckling( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment @@ -1150,6 +1195,7 @@ def Cable( rotation_specification_type = MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, rotation_parameters = [0], section_no: int = 1, + line = None, comment: str = '', params: dict = {'end_modifications_member_start_extension': 0, 'end_modifications_member_start_slope_y': 0, @@ -1174,6 +1220,7 @@ def Cable( for rotation_specification_type == MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_SURFACE: rotation_parameters = [rotation_surface, rotation_surface_plane_type] section_no (int): Section Tag + line (int, optional): Assigned Line comment (str, optional): Comment params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary """ @@ -1236,6 +1283,9 @@ def Cable( # Deactivation for Calculation clientObject.is_deactivated_for_calculation = params_up['is_deactivated_for_calculation'] + # Assigned Line No. + clientObject.line = line + # Comment clientObject.comment = comment From c2c528c63710c178add09d4738f496cc066bf459 Mon Sep 17 00:00:00 2001 From: MichalO Date: Tue, 12 Apr 2022 12:29:27 +0200 Subject: [PATCH 2/3] New parameter on wrong place unit tests: 127 passed, 9 skipped in 152.67s --- .gitconfig | 2 ++ .gitmessage | 5 +++++ RFEM/BasicObjects/member.py | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .gitconfig create mode 100644 .gitmessage diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 00000000..969cd730 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,2 @@ +[commit] + template = ~/.gitmessage \ No newline at end of file diff --git a/.gitmessage b/.gitmessage new file mode 100644 index 00000000..c901d10b --- /dev/null +++ b/.gitmessage @@ -0,0 +1,5 @@ + + + +Unit tests: +Examples: \ No newline at end of file diff --git a/RFEM/BasicObjects/member.py b/RFEM/BasicObjects/member.py index 6ed52c3a..17b82c33 100644 --- a/RFEM/BasicObjects/member.py +++ b/RFEM/BasicObjects/member.py @@ -9,9 +9,9 @@ def __init__(self, rotation_angle: float = 0.0, start_section_no: int = 1, end_section_no: int = 1, - line = None, start_member_hinge_no: int = 0, end_member_hinge_no: int = 0, + line = None, comment: str = '', params: dict = None): """ @@ -86,8 +86,8 @@ def Beam( rotation_parameters = [0], start_section_no: int = 1, end_section_no: int = 1, - line = None, distribution_parameters = [], + line = None, comment: str = '', params: dict = {'member_hinge_start':0, 'member_hinge_end': 0, 'member_eccentricity_start': 0, 'member_eccentricity_end': 0, From 031c1e62566c846eb7f25def54a1c5635e1aeec2 Mon Sep 17 00:00:00 2001 From: MichalO Date: Tue, 12 Apr 2022 12:49:39 +0200 Subject: [PATCH 3/3] style fix --- Examples/Cantilever/Demo1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/Cantilever/Demo1.py b/Examples/Cantilever/Demo1.py index 5ad863eb..9a7e33b2 100644 --- a/Examples/Cantilever/Demo1.py +++ b/Examples/Cantilever/Demo1.py @@ -2,13 +2,13 @@ # -*- coding: utf-8 -*- import os import sys -baseName = os.path.basename(__file__) +baseName = os.path.basename(__file__)5 dirName = os.path.dirname(__file__) print('basename: ', baseName) print('dirname: ', dirName) sys.path.append(dirName + r'/../..') -from RFEM.enums import * +from RFEM.enums import NodalSupportType, LoadDirectionType from RFEM.initModel import Model, Calculate_all from RFEM.BasicObjects.material import Material from RFEM.BasicObjects.section import Section