Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/main' into OndrejMichal_…
Browse files Browse the repository at this point in the history
…enable_editing_of_multiple_models

unit tests: 129 passed, 9 skipped in 221.96s
  • Loading branch information
MichalO committed Apr 13, 2022
2 parents b51ab7d + fe29de8 commit bd41c63
Show file tree
Hide file tree
Showing 18 changed files with 1,826 additions and 448 deletions.
2 changes: 2 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[commit]
template = ~/.gitmessage
5 changes: 5 additions & 0 deletions .gitmessage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Subject no more than 50 characters long>

<Description if needed>
Unit tests: <results e.g. 127 passed, 9 skipped in 152.67s>
Examples: <results e.g. passing>
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"comments": false,
"strings": false
},
"editor.formatOnSave": false,
"python.analysis.completeFunctionParens": true,
"python.disableInstallationCheck": true,
"python.linting.banditEnabled": true,
Expand Down
3 changes: 2 additions & 1 deletion Examples/Cantilever/Demo1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- 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)
Expand All @@ -27,6 +27,7 @@
Model(True, "Demo1") # crete new model called Demo1
Model.clientModel.service.begin_modification()


Material(1, 'S235')

Section(1, 'IPE 200')
Expand Down
50 changes: 50 additions & 0 deletions RFEM/BasicObjects/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def __init__(self,
end_section_no: int = 1,
start_member_hinge_no: int = 0,
end_member_hinge_no: int = 0,
line = None,
comment: str = '',
params: dict = None,
model = Model):
Expand All @@ -24,6 +25,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
"""
Expand Down Expand Up @@ -55,6 +57,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

Expand Down Expand Up @@ -83,6 +88,7 @@ def Beam(
start_section_no: int = 1,
end_section_no: int = 1,
distribution_parameters: list = None,
line = None,
comment: str = '',
params: dict = {'member_hinge_start':0, 'member_hinge_end': 0,
'member_eccentricity_start': 0, 'member_eccentricity_end': 0,
Expand Down Expand Up @@ -134,6 +140,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
Expand Down Expand Up @@ -280,6 +287,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,
Expand Down Expand Up @@ -341,6 +351,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,
Expand All @@ -363,6 +374,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
"""
Expand Down Expand Up @@ -426,6 +438,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

Expand All @@ -449,6 +464,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,
Expand All @@ -472,6 +488,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
Expand Down Expand Up @@ -555,6 +572,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

Expand All @@ -574,6 +594,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,
Expand Down Expand Up @@ -601,6 +622,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
"""
Expand Down Expand Up @@ -672,6 +694,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

Expand All @@ -691,6 +716,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,
Expand Down Expand Up @@ -718,6 +744,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
"""
Expand Down Expand Up @@ -789,6 +816,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

Expand All @@ -808,6 +838,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,
Expand Down Expand Up @@ -835,6 +866,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
"""
Expand Down Expand Up @@ -906,6 +938,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

Expand All @@ -925,6 +960,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,
Expand Down Expand Up @@ -952,6 +988,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
"""
Expand Down Expand Up @@ -1023,6 +1060,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

Expand All @@ -1042,6 +1082,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,
Expand Down Expand Up @@ -1069,6 +1110,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
"""
Expand Down Expand Up @@ -1140,6 +1182,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

Expand All @@ -1159,6 +1204,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,
Expand All @@ -1184,6 +1230,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
"""
Expand Down Expand Up @@ -1246,6 +1293,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

Expand Down
12 changes: 12 additions & 0 deletions RFEM/BasicObjects/surface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from RFEM.enums import SurfaceGeometry, SurfaceLoadDistributionDirection, SurfaceType
from RFEM.initModel import Model, clearAtributes, ConvertToDlString
import math

def CreateGeometryAndSetToModel(no, surface_type, boundary_lines_no, geometry_type, geometry_type_parameters, thickness = None, comment = None, params = None, model = Model):
'''
Expand All @@ -15,6 +16,8 @@ def CreateGeometryAndSetToModel(no, surface_type, boundary_lines_no, geometry_ty
geometry_type_parameters = None
for geometry_type == SurfaceGeometry.GEOMETRY_QUADRANGLE:
geometry_type_parameters = [quadrangle_corner_node_1, quadrangle_corner_node_2, quadrangle_corner_node_3, quadrangle_corner_node_4]
for geometry_type == SurfaceGeometry.GEOMETRY_ROTATED:
geometry_type_parameters = [rotated_angle_of_rotation, [rotated_point_p_x, rotated_point_p_y, rotated_point_p_z], [rotated_point_r_x, rotated_point_r_y, rotated_point_r_z], rotated_boundary_line]
thickness (int): Tag of Thickness assigned to Standard Surface
comment (str, optional): Comments
params (dict, optional): Any WS Parameter relevant to the object and its value in form of a dictionary
Expand Down Expand Up @@ -45,6 +48,15 @@ def CreateGeometryAndSetToModel(no, surface_type, boundary_lines_no, geometry_ty
clientObject.nurbs_order_in_direction_v = geometry_type_parameters[3]
elif geometry_type.name == 'GEOMETRY_PLANE':
geometry_type_parameters = None
elif geometry_type.name == 'GEOMETRY_ROTATED':
clientObject.rotated_angle_of_rotation = geometry_type_parameters[0] * (math.pi/180)
clientObject.rotated_point_p_x = geometry_type_parameters[1][0]
clientObject.rotated_point_p_y = geometry_type_parameters[1][1]
clientObject.rotated_point_p_z = geometry_type_parameters[1][2]
clientObject.rotated_point_r_x = geometry_type_parameters[2][0]
clientObject.rotated_point_r_y = geometry_type_parameters[2][1]
clientObject.rotated_point_r_z = geometry_type_parameters[2][2]
clientObject.rotated_boundary_line = geometry_type_parameters[3]
elif geometry_type.name == 'GEOMETRY_QUADRANGLE':
if len(geometry_type_parameters) != 4:
raise Exception('WARNING: The geometry type parameter needs to be of length 4. Kindly check list inputs for completeness and correctness.')
Expand Down
Loading

0 comments on commit bd41c63

Please sign in to comment.