ANYstructure 5.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. anystruct/ANYstructure_documentation.pdf +0 -0
  2. anystruct/SN_curve_parameters.py +35 -0
  3. anystruct/__init__.py +0 -0
  4. anystruct/__main__.py +24 -0
  5. anystruct/api.py +772 -0
  6. anystruct/buckling_calc_external.py +120 -0
  7. anystruct/bulb_anglebar_tbar_flatbar.csv +677 -0
  8. anystruct/calc_loads.py +526 -0
  9. anystruct/calc_structure.py +4838 -0
  10. anystruct/compartment_window.py +176 -0
  11. anystruct/example_data.py +532 -0
  12. anystruct/example_data_puls.py +46 -0
  13. anystruct/excel_inteface.py +244 -0
  14. anystruct/fatigue_window.py +352 -0
  15. anystruct/grid_window.py +307 -0
  16. anystruct/gui.py +24 -0
  17. anystruct/helper.py +623 -0
  18. anystruct/images/ANYstructure_logo.jpg +0 -0
  19. anystruct/images/Buckling_Strength_of_Shells.png +0 -0
  20. anystruct/images/Panel_geometry_definitions.png +0 -0
  21. anystruct/images/current_comps_NONE.png +0 -0
  22. anystruct/images/fls_button.gif +0 -0
  23. anystruct/images/img_T_L_FB.gif +0 -0
  24. anystruct/images/img_axial_stresses.gif +0 -0
  25. anystruct/images/img_ext_pressure_button.gif +0 -0
  26. anystruct/images/img_ext_pressure_button_def.gif +0 -0
  27. anystruct/images/img_fixation_parameters.gif +0 -0
  28. anystruct/images/img_generate_report.gif +0 -0
  29. anystruct/images/img_int_pressure_button.gif +0 -0
  30. anystruct/images/img_int_pressure_button_search.gif +0 -0
  31. anystruct/images/img_multi_opt.gif +0 -0
  32. anystruct/images/img_optimize.gif +0 -0
  33. anystruct/images/img_plate_and_stiffener.gif +0 -0
  34. anystruct/images/img_stf_button.gif +0 -0
  35. anystruct/images/img_stiffener.gif +0 -0
  36. anystruct/images/img_stress_button.gif +0 -0
  37. anystruct/images/img_title.gif +0 -0
  38. anystruct/images/img_transverse_stress.gif +0 -0
  39. anystruct/load_factor_window.py +166 -0
  40. anystruct/load_window.py +721 -0
  41. anystruct/main_application.py +7918 -0
  42. anystruct/make_grid_numpy.py +506 -0
  43. anystruct/make_queue.py +52 -0
  44. anystruct/make_stack.py +52 -0
  45. anystruct/ml_files/CL_CSR-Tank_req_cl_predictor.pickle +0 -0
  46. anystruct/ml_files/CL_CSR-Tank_req_cl_scaler.pickle +0 -0
  47. anystruct/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle +0 -0
  48. anystruct/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_scaler.pickle +0 -0
  49. anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_1_SP.pickle +0 -0
  50. anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_1_UP.pickle +0 -0
  51. anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
  52. anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
  53. anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_1_SP.pickle +0 -0
  54. anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_1_UP.pickle +0 -0
  55. anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
  56. anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
  57. anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_1_SP.pickle +0 -0
  58. anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_1_UP.pickle +0 -0
  59. anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
  60. anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
  61. anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_1_SP.pickle +0 -0
  62. anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_1_UP.pickle +0 -0
  63. anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
  64. anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
  65. anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_1_SP.pickle +0 -0
  66. anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_1_UP.pickle +0 -0
  67. anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
  68. anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
  69. anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_1_SP.pickle +0 -0
  70. anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_1_UP.pickle +0 -0
  71. anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
  72. anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
  73. anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_1_SP.pickle +0 -0
  74. anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_1_UP.pickle +0 -0
  75. anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
  76. anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
  77. anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_1_SP.pickle +0 -0
  78. anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_1_UP.pickle +0 -0
  79. anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
  80. anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
  81. anystruct/opt_problem.py +31 -0
  82. anystruct/optimize.py +1680 -0
  83. anystruct/optimize_cylinder.py +898 -0
  84. anystruct/optimize_geometry.py +1708 -0
  85. anystruct/optimize_multiple_window.py +1507 -0
  86. anystruct/optimize_window.py +1117 -0
  87. anystruct/pl_stf_window.py +572 -0
  88. anystruct/report_generator.py +912 -0
  89. anystruct/sections.csv +202 -0
  90. anystruct/sesam_interface.py +115 -0
  91. anystruct/ship_section_example.txt +1 -0
  92. anystruct/stresses_window.py +269 -0
  93. anystruct/testCalc.py +118 -0
  94. anystructure-5.2.0.dist-info/METADATA +86 -0
  95. anystructure-5.2.0.dist-info/RECORD +99 -0
  96. anystructure-5.2.0.dist-info/WHEEL +5 -0
  97. anystructure-5.2.0.dist-info/entry_points.txt +2 -0
  98. anystructure-5.2.0.dist-info/licenses/LICENSE +21 -0
  99. anystructure-5.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,176 @@
1
+ # Compartments are created here.
2
+ # NOT USED YET
3
+
4
+ import tkinter as tk
5
+ from matplotlib import pyplot as plt
6
+ from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
7
+ try:
8
+ import anystruct.test
9
+ except ModuleNotFoundError:
10
+ import ANYstructure.anystruct.test
11
+ import numpy as np
12
+
13
+ class CreateCompartmentWindow():
14
+
15
+ def __init__(self, master,app=None):
16
+ super(CreateCompartmentWindow, self).__init__()
17
+
18
+ if __name__ == '__main__':
19
+ base_canvas_dim = [1000, 720]
20
+ self.canvas_origo = [50, base_canvas_dim[1] - 50]
21
+ self.grid = test.get_grid(origo=self.canvas_origo,base_canvas_dim=base_canvas_dim)
22
+ self.parent_dimensions = base_canvas_dim
23
+ self.to_draw = test.get_to_draw()
24
+ else:
25
+ self.app = app
26
+ self.grid = app._main_grid
27
+ self.parent_dimensions = app._canvas_dim
28
+ self.to_draw = app._pending_grid_draw
29
+ self.parent_origo = app._canvas_origo
30
+
31
+ frame_dim = (1500,980)
32
+ self.canvas_origo = (50,720-50)
33
+ self.canvas_dim = (1000,720)
34
+
35
+ self.frame = master
36
+ self.frame.wm_title("Load properties")
37
+ self.frame.geometry(str(frame_dim[0])+'x'+str(frame_dim[1]))
38
+ self.frame.grab_set()
39
+
40
+ self.points_child = {}
41
+ self.child_dimensions = (self.parent_dimensions[0]-self.parent_dimensions[0]+1, self.parent_dimensions[1]+1)
42
+
43
+ for line,point in self.to_draw.items():
44
+ point1 = (int(point[0][0]),int(point[0][1]))
45
+ point2 = (int(point[1][0]),int(point[1][1]))
46
+ self.points_child[line] = [point1,point2]
47
+
48
+ for line, points in self.points_child.items():
49
+ for point in self.grid.get_points_along_line(points[0],points[1]):
50
+ self.grid.set_barrier(point[0],point[1])
51
+
52
+ fig = plt.figure()
53
+ self.draw_grid()
54
+ self.canvas_plt = FigureCanvasTkAgg(fig,self.frame)
55
+ self.canvas_plt.show()
56
+ self.canvas_plt.get_tk_widget().place(relx=0.5,rely=0.5)
57
+
58
+
59
+ #self.draw_grid()
60
+ tk.Button(self.frame,text='DRAW',command=self.draw_grid).place(relx=0.1,rely=0.1)
61
+
62
+ def __str__(self):
63
+ return 'class CreateCompartmentWindow(): Compartment string not implemented'
64
+
65
+ def draw_grid(self):
66
+ '''
67
+ Drawing grid
68
+ EMPTY = yellow
69
+ FULL = red
70
+ :return:
71
+ '''
72
+
73
+ def discrete_matshow(data):
74
+ # get discrete colormap
75
+ cmap = plt.get_cmap('RdBu', np.max(data) - np.min(data) + 1)
76
+ # set limits .5 outside true range
77
+ mat = plt.matshow(data, cmap=cmap, vmin=np.min(data) - .5, vmax=np.max(data) + .5)
78
+ # tell the colorbar to tick at integers
79
+ cax = plt.colorbar(mat, ticks=np.arange(np.min(data), np.max(data) + 1))
80
+ # # generate data
81
+ # a = np.random.randint(1, 20, size=(10, 10))
82
+ discrete_matshow(self.grid.get_matrix())
83
+ plt.suptitle('Tanks defined by numbers from 2 and up.')
84
+ return plt
85
+ #plt.show()
86
+
87
+ def search_dfs(self):
88
+ '''
89
+ Depth first search method.
90
+ :return:
91
+ '''
92
+ start = (0,0)
93
+ stack = make_stack.Stack()
94
+ stack.push_item(start)
95
+
96
+ while len(stack) != 0:
97
+ cell = stack.pop_item()
98
+ if self.grid.is_empty(cell[0], cell[1]):
99
+ self.grid.set_full(cell[0], cell[1])
100
+ for item in self.grid.four_neighbors(cell[0], cell[1]):
101
+ stack.push_item(item)
102
+
103
+ def search_bfs(self):
104
+ '''
105
+ Bredth first search method.
106
+
107
+ Searcing evry 20th pixel for empty places in the grid. When a empty cell is found, the search starts.
108
+ The search ends when no more empty cells are found in the boudnary regions (circular expansion of search).
109
+
110
+ USE GRID CONVENSION HERE. NOT POINTS.
111
+
112
+ grid(row,col) is same as grid(y,x)
113
+
114
+ points uses
115
+
116
+ point(x , y) is same as grid(col,row)
117
+ :return:
118
+ '''
119
+ compartment_count = 1
120
+ cells = 0
121
+ el_max = ''
122
+ el_min = ''
123
+ compartments = {}
124
+
125
+ for startrow in range(0, self.child_dimensions[1], 20):
126
+ for startcol in range(0, self.child_dimensions[0], 20):
127
+ if self.grid.is_empty(startrow,startcol):
128
+ el_max = ''
129
+ el_min = ''
130
+ cells = 0
131
+ boundary = deque()
132
+ boundary.append((startrow,startcol))
133
+ corners = []
134
+
135
+ while len(boundary) != 0:
136
+ current_cell = boundary.pop()
137
+ #find the min/max elevation, counting cells in tank
138
+ if el_max == '':
139
+ el_max = current_cell[0]
140
+ el_min = current_cell[0]
141
+ else:
142
+ if current_cell[0] < el_max:
143
+ el_max = current_cell[0]
144
+ if current_cell[0] > el_min:
145
+ el_min = current_cell[0]
146
+ cells += 1
147
+ neighbors = self.grid.eight_neighbors(current_cell[0], current_cell[1])
148
+
149
+ #doing serach operations and looking for corners
150
+ no_of_barriers = 0
151
+ for neighbor in neighbors[0:4]:
152
+ if self.grid.get_value(neighbor[0], neighbor[1]) == -1: no_of_barriers += 1
153
+ else: pass
154
+
155
+ if self.grid.is_empty(neighbor[0], neighbor[1]):
156
+ self.grid.set_value(neighbor[0], neighbor[1],compartment_count)
157
+ boundary.append(neighbor)
158
+
159
+ #finding corners on diagonal cells
160
+ for neighbor in neighbors[4:]:
161
+ if self.grid.get_value(neighbor[0], neighbor[1]) == -1: no_of_barriers += 1
162
+ else: pass
163
+
164
+ if no_of_barriers > 4:
165
+ corners.append((neighbor[0], neighbor[1]))
166
+
167
+ # returning values to the program
168
+ compartments[compartment_count] = cells, corners
169
+ compartment_count += 1
170
+
171
+ return compartments
172
+
173
+ if __name__ == '__main__':
174
+ root = tk.Tk()
175
+ my_app = CreateCompartmentWindow(master=root)
176
+ root.mainloop()