Skip to content

Commit b0588c9

Browse files
Merge branch 'main' into heet-coordinateSystemUpdate
2 parents 5428924 + 61a5031 commit b0588c9

File tree

23 files changed

+723
-294
lines changed

23 files changed

+723
-294
lines changed

.vscode/launch.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"name": "Python: Current File",
9-
"type": "python",
10-
"request": "launch",
11-
"program": "${file}",
12-
"console": "integratedTerminal"
13-
},
14-
{
15-
"name": "Main",
16-
"type": "python",
17-
"request": "launch",
18-
"program": "main.py",
19-
"console": "integratedTerminal"
20-
}
21-
]
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal"
13+
},
14+
{
15+
"name": "Main",
16+
"type": "python",
17+
"request": "launch",
18+
"program": "main.py",
19+
"console": "integratedTerminal"
20+
}
21+
]
2222
}

Examples/Cantilever/Demo1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
# Calculate_all()
5353
messages = CalculateSelectedCases([1])
54-
if len(messages) != 0:
54+
if messages:
5555
print("Calculation finished unsuccessfully")
5656
print(messages)
5757
# for message in messages:

Examples/ConcreteBridge/concrete_bridge.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from RFEM.LoadCasesAndCombinations.loadCase import LoadCase
2626
from RFEM.Loads.surfaceLoad import SurfaceLoad
2727
from RFEM.Loads.freeLoad import FreeLoad
28-
from RFEM.Tools.PlausibilityCheck import PlausibilityCheck
2928

3029
if __name__ == "__main__":
3130
# ----------------INPUT PARAMETERS------------------#
@@ -190,6 +189,5 @@
190189
SurfaceLoad(1, 2, "1", 20000, "Road Traffic")
191190

192191
Model.clientModel.service.finish_modification()
193-
PlausibilityCheck()
194192
print("Calculating results.")
195193
Calculate_all()
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
import os
2+
import sys
3+
baseName = os.path.basename(__file__)
4+
dirName = os.path.dirname(__file__)
5+
print('basename: ', baseName)
6+
print('dirname: ', dirName)
7+
sys.path.append(dirName + r'/../..')
8+
9+
from RFEM.enums import *
10+
from RFEM.initModel import Model, insertSpaces, Calculate_all, SetAddonStatus
11+
from RFEM.BasicObjects.material import Material
12+
from RFEM.BasicObjects.section import Section
13+
from RFEM.BasicObjects.thickness import Thickness
14+
from RFEM.BasicObjects.node import Node
15+
from RFEM.BasicObjects.line import Line
16+
from RFEM.BasicObjects.member import Member
17+
from RFEM.BasicObjects.surface import Surface
18+
from RFEM.TypesForNodes.nodalSupport import NodalSupport
19+
from RFEM.TypesForLines.lineSupport import LineSupport
20+
from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings
21+
from RFEM.LoadCasesAndCombinations.loadCase import LoadCase
22+
from RFEM.LoadCasesAndCombinations.loadCombination import LoadCombination
23+
from RFEM.LoadCasesAndCombinations.designSituation import DesignSituation
24+
from RFEM.LoadCasesAndCombinations.loadCasesAndCombinations import LoadCasesAndCombinations
25+
from RFEM.LoadCasesAndCombinations.combinationWizard import CombinationWizard
26+
from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings
27+
from RFEM.LoadCasesAndCombinations.modalAnalysisSettings import ModalAnalysisSettings
28+
from RFEM.LoadCasesAndCombinations.spectralAnalysisSettings import SpectralAnalysisSettings
29+
from RFEM.DynamicLoads.responseSpectrum import ResponseSpectrum
30+
from RFEM.Loads.surfaceLoad import SurfaceLoad
31+
from RFEM.Results.resultTables import ResultTables
32+
33+
if __name__ == "__main__":
34+
# create structure
35+
Model(True, 'DynamicAnalysis.py')
36+
37+
Material(1, 'C35/45')
38+
Section(1, 'SQ_M1 0.25')
39+
Thickness(1, 'Ceiling', 1, uniform_thickness_d=0.4)
40+
Thickness(2, 'Walls', 1, uniform_thickness_d=0.25)
41+
length = 10.5
42+
width = 13
43+
height = 0
44+
j = 0
45+
k = 0
46+
l = 0
47+
48+
Model.clientModel.service.begin_modification()
49+
50+
SetAddonStatus(Model.clientModel, addOn=AddOn.modal_active, status=True)
51+
SetAddonStatus(Model.clientModel, addOn=AddOn.spectral_active, status=True)
52+
53+
for i in range(3):
54+
Node(1 + j, 0, 0, height)
55+
Node(2 + j, length, 0, height)
56+
Node(3 + j, 0, width, height)
57+
Node(4 + j, length, width,height)
58+
Node(5 + j, length/3, 0, height)
59+
Node(6 + j, length/3, width, height)
60+
Node(7 + j, 2 * length/3, 0, height)
61+
Node(8 + j, 2 * length/3, width, height)
62+
Node(9 + j, 0, width/3, height)
63+
Node(10 + j, 0, 2 * width/3, height)
64+
Node(11 + j, length, width/3, height)
65+
Node(12 + j, length, 2 * width/3, height)
66+
67+
j += 12
68+
height -= 5
69+
70+
j = 0
71+
for i in range(2):
72+
Line(1 + l, insertSpaces([13 + j, 14 + j]))
73+
Line(2+ l, insertSpaces([13 + j, 15 + j]))
74+
Line(3 + l, insertSpaces([14 + j, 16 + j]))
75+
Line(4 + l, insertSpaces([15 + j, 16 + j]))
76+
77+
l += 4
78+
j += 12
79+
80+
# vertical lines
81+
l = 0
82+
j = 0
83+
for i in range(2):
84+
Line(9 + l, insertSpaces([1 + j, 13 + j]))
85+
Line(10 + l, insertSpaces([2 + j, 14 + j]))
86+
Line(11 + l, insertSpaces([3 + j, 15 + j]))
87+
Line(12 + l, insertSpaces([5 + j, 17 + j]))
88+
Line(13 + l, insertSpaces([7 + j, 19 + j]))
89+
Line(14 + l, insertSpaces([11 + j, 23 + j]))
90+
Line(15 + l, insertSpaces([6 + j, 18 + j]))
91+
Line(16 + l, insertSpaces([10 + j, 22 + j]))
92+
Line(17 + l, insertSpaces([9 + j, 21 + j]))
93+
94+
l += 9
95+
j += 12
96+
97+
# horizontal lines
98+
j = 0
99+
l = 0
100+
for i in range(3):
101+
Line(33 + l, insertSpaces([1 + j, 5 + j]))
102+
Line(34 + l, insertSpaces([1 + j, 9 + j]))
103+
Line(35 + l, insertSpaces([2 + j, 7 + j]))
104+
Line(36 + l, insertSpaces([2 + j, 11 + j]))
105+
Line(37 + l, insertSpaces([3 + j, 6 + j]))
106+
Line(38 + l, insertSpaces([3 + j, 10 + j]))
107+
108+
l += 6
109+
j += 12
110+
111+
# surfaces
112+
l = 0
113+
m = 0
114+
j = 0
115+
for i in range(2):
116+
Surface(1 + k, insertSpaces([1 + m, 2 + m, 3 + m, 4 + m]), 1)
117+
Surface(2 + k, insertSpaces([17 + l, 40 + j, 9 + l, 34 + j]), 2)
118+
Surface(3 + k, insertSpaces([12 + l, 33 + j, 9 + l, 39 + j]), 2)
119+
Surface(4 + k, insertSpaces([35 + j, 10 + l, 13 + l, 41 + j]), 2)
120+
Surface(5 + k, insertSpaces([36 + j, 10 + l, 14 + l, 42 + j]), 2)
121+
Surface(6 + k, insertSpaces([37 + j, 11 + l, 15 + l, 43 + j]), 2)
122+
Surface(7 + k, insertSpaces([38 + j, 11 + l, 16 + l, 44 + j]), 2)
123+
124+
k += 7
125+
m += 4
126+
l += 9
127+
j += 6
128+
129+
j = 0
130+
l = 0
131+
for i in range(2):
132+
Member(1 + j, 8 + l, 20 + l, 0, 1, 1)
133+
Member(2 + j, 4 + l, 16 + l, 0, 1, 1)
134+
Member(3 + j, 12 + l, 24 + l, 0, 1, 1)
135+
j += 3
136+
l += 12
137+
138+
LineSupport(1, '33 34 35 36 37 38')
139+
NodalSupport(1, '4 8 12', NodalSupportType.HINGED)
140+
141+
# Load Cases and Combinations/Settings
142+
LoadCasesAndCombinations({'activate_combination_wizard':'True'})
143+
CombinationWizard(1, 'Combi1', 1, 1, False, False, None, None)
144+
145+
StaticAnalysisSettings(1)
146+
ModalAnalysisSettings(1)
147+
SpectralAnalysisSettings(1)
148+
149+
ResponseSpectrum(1, params={'definition_type':'ACCORDING_TO_STANDARD'})
150+
151+
LoadCase(1, 'Self-Weight', [True, 0, 0, 1], ActionCategoryType.ACTION_CATEGORY_PERMANENT_G)
152+
LoadCase(2, 'Dead Load', [False], ActionCategoryType.ACTION_CATEGORY_IMPOSED_LOADS_CATEGORY_A_DOMESTIC_RESIDENTIAL_AREAS_QI_A)
153+
LoadCase(3, 'Modal Analysis',action_category=ActionCategoryType.ACTION_CATEGORY_SEISMIC_ACTIONS_AE, params={'analysis_type':'ANALYSIS_TYPE_MODAL'})
154+
LoadCase(4, 'Spectral Analysis', action_category=ActionCategoryType.ACTION_CATEGORY_SEISMIC_ACTIONS_AE,
155+
params={
156+
'analysis_type':'ANALYSIS_TYPE_RESPONSE_SPECTRUM',
157+
'import_modal_analysis_from':'3',
158+
'response_spectrum_is_enabled_in_any_direction':'True',
159+
'response_spectrum_is_enabled_in_direction_x':'True',
160+
'response_spectrum_is_enabled_in_direction_y':'True',
161+
'response_spectrum_in_direction_x':'1',
162+
'response_spectrum_in_direction_y':'1',
163+
'response_spectrum_consider_accidental_torsion':'True',
164+
'response_spectrum_eccentricity_for_x_direction_relative':'0.05',
165+
'response_spectrum_eccentricity_for_y_direction_relative':'0.05'})
166+
167+
LoadCombination(1, AnalysisType.ANALYSIS_TYPE_STATIC, 1, '', 1, False, False, False, True, combination_items=[[1.35, 1, 0, False], [1.5, 2, 0, True]])
168+
DesignSituation(1, DesignSituationType.DESIGN_SITUATION_TYPE_EQU_PERMANENT_AND_TRANSIENT, True, params={'combination_wizard' :'1'})
169+
170+
SurfaceLoad(1, 2, '1', 5000)
171+
172+
Model.clientModel.service.finish_modification()
173+
174+
Calculate_all()
175+
176+
columnInternalForces = ResultTables.MembersInternalForces(loading_type=CaseObjectType.E_OBJECT_TYPE_DESIGN_SITUATION, loading_no=1)
177+
print(columnInternalForces)

Examples/SteelDesign/SteelDesignExcel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from RFEM.Loads.nodalLoad import NodalLoad
3030
from RFEM.Loads.memberLoad import MemberLoad
3131
from RFEM.Results.resultTables import ResultTables, GetMaxValue, GetMinValue
32-
from RFEM.Tools.PlausibilityCheck import PlausibilityCheck
3332

3433
try:
3534
import pandas
@@ -427,7 +426,6 @@ def main():
427426

428427
# Finish Model
429428
Model.clientModel.service.finish_modification()
430-
PlausibilityCheck()
431429

432430
# Calculation
433431
print("Calculation started...")

Examples/SteelDesign/SteelHall.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings
2525
from RFEM.Loads.nodalLoad import NodalLoad
2626
from RFEM.Loads.memberLoad import MemberLoad
27-
from RFEM.Tools.PlausibilityCheck import PlausibilityCheck
2827

2928
if __name__ == '__main__':
3029

@@ -314,7 +313,6 @@
314313
n, k = n+6, k+13
315314

316315
SteelDesignUltimateConfigurations(1, 'ULS1', 'All')
317-
PlausibilityCheck()
318316

319317
Model.clientModel.service.finish_modification()
320318
Calculate_all()

Examples/Timber_Design/timber_hall.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from RFEM.LoadCasesAndCombinations.staticAnalysisSettings import StaticAnalysisSettings
2929
from RFEM.LoadCasesAndCombinations.loadCase import LoadCase
3030
from RFEM.Loads.memberLoad import MemberLoad
31-
from RFEM.Tools.PlausibilityCheck import PlausibilityCheck
3231

3332
# importing modules requiered for timber design
3433
from RFEM.TimberDesign.timberUltimateConfigurations import TimberDesignUltimateConfigurations
@@ -223,7 +222,6 @@
223222

224223
# finishing modification and calculating the model
225224
Model.clientModel.service.finish_modification()
226-
PlausibilityCheck()
227225
Calculate_all()
228226

229227
# write outputs to an excel sheet

REVIEW_BEST_PRACTICES.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Review Best Practices
2+
3+
## Best practice for the author
4+
* Before submitting the code for review, the code author should perform the review himself. Read the entire code several times carefully. Code should have good structure, documentation and needs to be functional.
5+
* It is a good practice to also check the diff if all changes are in US/Bugfix scope. The diff helps to spot temporary code.
6+
* There needs to be a good reason for modifying code outside of scope.
7+
* It is better to review several small changes than one big change. Smaller changes are easier to navigate and better revised.
8+
* Have the code checked with linter or other type of static code analysis tool before code review.
9+
* On the review board, a brief description of changes, new functions and any notes on the solution needs to be added. The reviewer then finds his way around and understands the code way faster.
10+
* When correcting the code, the author must make changes himself to learn from the mistakes.
11+
12+
## Best practice for reviewer
13+
* New objections to the code can only be raised in the first round of corrections, in the next round of corrections it is possible to raise objections only to what was changed in the given round.
14+
* Ignore who is the author of the code. Even a senior programmer makes mistakes.
15+
16+
## Who should do the review?
17+
* In addition to monitoring the quality of the code, code review has the advantage that at least two programmers have gone through each part of the code and are familiar with it (have awareness).
18+
* It is advisable that the revisions are evenly distributed among the programmers in the team.
19+
* It is advisable that I junior do the revision
20+
21+
## Division of objections into three categories:
22+
* Nitpick - this category includes everything that is not important. Comment formatting etc.
23+
* Blocking - serious offenses that can cause the application to crash, break the existing code, do not meet the requirements of OOP.
24+
* To discuss – Category between Nitpick and Blocking. The code will work correctly even without fixing them. Bad use of libraries, incomplete adherence to architecture, bad naming of things, code structure.
25+
The author must fix all blocking comments, To discuss can be skipped, but he must create a bugfix for them when he fixes them in the future. A nitpick is fine to fix, but not required.
26+
27+
## What to check (in order of priority):
28+
* Serious errors like memory leak, unhandled exceptions, etc.
29+
* Isolation of changes – if the changes do not break some piece of code that is not changed.
30+
* Offenses against PPE and encapsulation, DRY
31+
* Offenses against the coding standard
32+
* Unclear or wrong naming of variables, methods, classes...
33+
* Unnecessarily complex code
34+
* Documentation: whether the more complex parts of the code are properly commented
35+
* Typos in comments and line breaks in the code (cases that are not described in the coding standard
36+
37+
## Communication:
38+
* Be constructive. If you criticize some part of the change, then in addition to the reason why it is good to write how the given thing could be done better and what will be solved by it.
39+
* Don't get personal. Always talk about the code, not the other person's skills. It is better to ask questions than to directly criticize. Because it is very difficult to know all the connections and reasons that led to writing a given piece of code, and there is a greater chance that the author knows it better than you. Even if you're sure, it's better to ask what the reason for this modification is than to just say it's unnecessary. It happens to the other person too, and then he takes it partially as his own idea, and most of all, he doesn't feel that he is being blamed for anything.
40+
* Don't be afraid to brag :-)

0 commit comments

Comments
 (0)