kib-lap 0.5__cp313-cp313-win_amd64.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.
- Examples/Cross_Section_Thin.py +61 -0
- Examples/__init__.py +0 -0
- KIB_LAP/Betonbau/Bemessung_Polygon.py +667 -0
- KIB_LAP/Betonbau/Bemessung_Zust_II.py +648 -0
- KIB_LAP/Betonbau/Cross_Section_Kappa.py +925 -0
- KIB_LAP/Betonbau/Druckglied_KGV.py +179 -0
- KIB_LAP/Betonbau/Iterative_Design.py +723 -0
- KIB_LAP/Betonbau/Materialkennwerte_Beton.py +196 -0
- KIB_LAP/Betonbau/Querschnittsbreite.py +194 -0
- KIB_LAP/Betonbau/Querschnittsbreite_Kreis.py +63 -0
- KIB_LAP/Betonbau/__init__.py +2 -0
- KIB_LAP/Betonbau/beam_plate_T.py +921 -0
- KIB_LAP/Betonbau/beam_plate_T_reverse.py +915 -0
- KIB_LAP/Betonbau/beam_rectangular.py +635 -0
- KIB_LAP/Betonbau/beam_sub_section.py +9 -0
- KIB_LAP/Dynamik/Cross_Section_Properties.py +155 -0
- KIB_LAP/Dynamik/Deformation_Method.py +587 -0
- KIB_LAP/Dynamik/Duhamel_SDOF.py +221 -0
- KIB_LAP/Dynamik/FFT.py +87 -0
- KIB_LAP/Dynamik/Kontinuum_Eigenmodes.py +418 -0
- KIB_LAP/Dynamik/Kontinuum_Schwingung.py +757 -0
- KIB_LAP/Dynamik/Pendulum_Spring_Linearized.py +91 -0
- KIB_LAP/Dynamik/Pendulum_Spring_Problem.py +94 -0
- KIB_LAP/Dynamik/__init__.py +0 -0
- KIB_LAP/Examples/Cross_Section_Thin.py +61 -0
- KIB_LAP/Examples/Cross_Section_Thin_2.py +14 -0
- KIB_LAP/Examples/Plattentragwerke.py +39 -0
- KIB_LAP/Examples/Plattentragwerke_2.py +60 -0
- KIB_LAP/Examples/ShearDesign.py +28 -0
- KIB_LAP/Examples/__init__.py +0 -0
- KIB_LAP/Plattenbeulen/Plate_Design.py +276 -0
- KIB_LAP/Plattenbeulen/Ritz_Optimiert.py +658 -0
- KIB_LAP/Plattenbeulen/__init__.py +2 -0
- KIB_LAP/Plattenbeulen/dist/__init__.py +0 -0
- KIB_LAP/Plattenbeulen/plate_buckling.cpp +561 -0
- KIB_LAP/Plattenbeulen/plate_buckling_cpp.cp313-win_amd64.pyd +0 -0
- KIB_LAP/Plattenbeulen/plate_buckling_cpp.cpp +561 -0
- KIB_LAP/Plattenbeulen/setup.py +35 -0
- KIB_LAP/Plattentragwerke/Functions.cpp +326 -0
- KIB_LAP/Plattentragwerke/Functions.h +41 -0
- KIB_LAP/Plattentragwerke/NumInte.cpp +23 -0
- KIB_LAP/Plattentragwerke/NumericalIntegration.cpp +23 -0
- KIB_LAP/Plattentragwerke/PlateBendingKirchhoff.py +843 -0
- KIB_LAP/Plattentragwerke/__init__.py +1 -0
- KIB_LAP/Plattentragwerke/plate_bending.cpp +341 -0
- KIB_LAP/Plattentragwerke/plate_bending_cpp.cp313-win_amd64.pyd +0 -0
- KIB_LAP/Plattentragwerke/setup.py +39 -0
- KIB_LAP/Querschnittswerte/Querschnitt_Duenn.py +526 -0
- KIB_LAP/Querschnittswerte/__init__.py +1 -0
- KIB_LAP/STABRAUM/InputData.py +92 -0
- KIB_LAP/STABRAUM/Programm.py +1403 -0
- KIB_LAP/STABRAUM/Steifigkeitsmatrix.py +275 -0
- KIB_LAP/STABRAUM/__init__.py +3 -0
- KIB_LAP/Stahlbau/__init__.py +0 -0
- KIB_LAP/Verbundbau/Verbundtraeger_Bemessung.py +766 -0
- KIB_LAP/Verbundbau/__init__.py +0 -0
- KIB_LAP/__init__.py +4 -0
- KIB_LAP/main.py +2 -0
- KIB_LAP/plate_bending_cpp.cp313-win_amd64.pyd +0 -0
- KIB_LAP/plate_buckling_cpp.cp313-win_amd64.pyd +0 -0
- kib_lap-0.5.dist-info/METADATA +25 -0
- kib_lap-0.5.dist-info/RECORD +64 -0
- kib_lap-0.5.dist-info/WHEEL +5 -0
- kib_lap-0.5.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
// plate_buckling.cpp
|
|
2
|
+
|
|
3
|
+
#define _USE_MATH_DEFINES // Für M_PI unter Windows
|
|
4
|
+
|
|
5
|
+
#include <pybind11/pybind11.h>
|
|
6
|
+
#include <pybind11/numpy.h>
|
|
7
|
+
#include <cmath>
|
|
8
|
+
#include <vector>
|
|
9
|
+
#include <iostream>
|
|
10
|
+
|
|
11
|
+
#ifdef _OPENMP
|
|
12
|
+
#include <omp.h>
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
namespace py = pybind11;
|
|
16
|
+
|
|
17
|
+
// Angepasste Funktion zur Berechnung der reinen Plattensteifigkeit D_plate (ohne Steifenbeiträge)
|
|
18
|
+
double calculate_D(double x, double y, double D_plate)
|
|
19
|
+
{
|
|
20
|
+
return D_plate;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Funktion zur numerischen Integration des Matrixelements K_ij (Plattenbeitrag)
|
|
24
|
+
double integrate_K_element_cpp(int m_i, int n_i, int m_j, int n_j,
|
|
25
|
+
double a, double b,
|
|
26
|
+
double D_plate, double nu,
|
|
27
|
+
double E)
|
|
28
|
+
{
|
|
29
|
+
// Anzahl der Unterteilungen
|
|
30
|
+
const int n_x = 100;
|
|
31
|
+
const int n_y = 100;
|
|
32
|
+
double dx = a / n_x;
|
|
33
|
+
double dy = b / n_y;
|
|
34
|
+
double integral = 0.0;
|
|
35
|
+
|
|
36
|
+
for (int i = 0; i <= n_x; ++i)
|
|
37
|
+
{
|
|
38
|
+
double x = i * dx;
|
|
39
|
+
for (int j = 0; j <= n_y; ++j)
|
|
40
|
+
{
|
|
41
|
+
double y = j * dy;
|
|
42
|
+
|
|
43
|
+
// Berechnung der reinen Plattensteifigkeit D(x, y)
|
|
44
|
+
double D_xy = calculate_D(x / a, y / b, D_plate);
|
|
45
|
+
|
|
46
|
+
// Ansatzfunktionen und deren Ableitungen
|
|
47
|
+
double sin_m_i_x = sin(m_i * M_PI * x / a);
|
|
48
|
+
double sin_n_i_y = sin(n_i * M_PI * y / b);
|
|
49
|
+
double sin_m_j_x = sin(m_j * M_PI * x / a);
|
|
50
|
+
double sin_n_j_y = sin(n_j * M_PI * y / b);
|
|
51
|
+
|
|
52
|
+
double cos_m_i_x = cos(m_i * M_PI * x / a);
|
|
53
|
+
double cos_n_i_y = cos(n_i * M_PI * y / b);
|
|
54
|
+
double cos_m_j_x = cos(m_j * M_PI * x / a);
|
|
55
|
+
double cos_n_j_y = cos(n_j * M_PI * y / b);
|
|
56
|
+
|
|
57
|
+
double d2phi_i_dx2 = -pow(m_i * M_PI / a, 2) * sin_m_i_x * sin_n_i_y;
|
|
58
|
+
double d2phi_i_dy2 = -pow(n_i * M_PI / b, 2) * sin_m_i_x * sin_n_i_y;
|
|
59
|
+
double d2phi_i_dxdy = (m_i * M_PI / a) * (n_i * M_PI / b) * cos_m_i_x * cos_n_i_y;
|
|
60
|
+
|
|
61
|
+
double d2phi_j_dx2 = -pow(m_j * M_PI / a, 2) * sin_m_j_x * sin_n_j_y;
|
|
62
|
+
double d2phi_j_dy2 = -pow(n_j * M_PI / b, 2) * sin_m_j_x * sin_n_j_y;
|
|
63
|
+
double d2phi_j_dxdy = (m_j * M_PI / a) * (n_j * M_PI / b) * cos_m_j_x * cos_n_j_y;
|
|
64
|
+
|
|
65
|
+
// Integrand mit allen Termen
|
|
66
|
+
double integrand = D_xy * (d2phi_i_dx2 * d2phi_j_dx2 +
|
|
67
|
+
d2phi_i_dy2 * d2phi_j_dy2 +
|
|
68
|
+
2 * nu * d2phi_i_dx2 * d2phi_j_dy2 +
|
|
69
|
+
2 * (1 - nu) * d2phi_i_dxdy * d2phi_j_dxdy);
|
|
70
|
+
|
|
71
|
+
// Gewichte für Trapezregel
|
|
72
|
+
double wx = (i == 0 || i == n_x) ? 0.5 : 1.0;
|
|
73
|
+
double wy = (j == 0 || j == n_y) ? 0.5 : 1.0;
|
|
74
|
+
|
|
75
|
+
integral += integrand * wx * wy;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
integral *= dx * dy;
|
|
79
|
+
|
|
80
|
+
return integral;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
double integrate_longitudinal_stiffener_energy_cpp(int m_i, int n_i, int m_j, int n_j,
|
|
84
|
+
double a, double b,
|
|
85
|
+
double E, double I_S,
|
|
86
|
+
double L_S, double x_stiffener)
|
|
87
|
+
{
|
|
88
|
+
double x_s = x_stiffener;
|
|
89
|
+
|
|
90
|
+
// Vorberechnung der konstanten Werte
|
|
91
|
+
double sin_m_i_x = sin(m_i * M_PI * x_s / a);
|
|
92
|
+
double sin_m_j_x = sin(m_j * M_PI * x_s / a);
|
|
93
|
+
double coef_n_i = (n_i * M_PI / b);
|
|
94
|
+
double coef_n_j = (n_j * M_PI / b);
|
|
95
|
+
|
|
96
|
+
double constant_terms = pow(coef_n_i * coef_n_j, 2) * sin_m_i_x * sin_m_j_x;
|
|
97
|
+
|
|
98
|
+
double A = coef_n_i;
|
|
99
|
+
double B = coef_n_j;
|
|
100
|
+
|
|
101
|
+
double integral_y = 0.0;
|
|
102
|
+
|
|
103
|
+
if (n_i == n_j)
|
|
104
|
+
{
|
|
105
|
+
// Fall n_i == n_j
|
|
106
|
+
integral_y = 0.5 * (L_S - sin(2 * A * L_S) / (2 * A));
|
|
107
|
+
}
|
|
108
|
+
else
|
|
109
|
+
{
|
|
110
|
+
// Fall n_i != n_j
|
|
111
|
+
integral_y = 0.5 * (sin((A - B) * L_S) / (A - B) -
|
|
112
|
+
sin((A + B) * L_S) / (A + B));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
double integral = E * I_S * constant_terms * integral_y;
|
|
116
|
+
|
|
117
|
+
return integral;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
//_______________________________ INTEGRALLÖSUNG ANFANG_______________________________________________
|
|
121
|
+
|
|
122
|
+
// // Funktion zur Berechnung der Steifenenergie (Längssteifen)
|
|
123
|
+
// double integrate_longitudinal_stiffener_energy_cpp(int m_i, int n_i, int m_j, int n_j,
|
|
124
|
+
// double a, double b,
|
|
125
|
+
// double E, double I_S,
|
|
126
|
+
// double L_S, double x_stiffener)
|
|
127
|
+
// {
|
|
128
|
+
// double integral = 0.0;
|
|
129
|
+
|
|
130
|
+
// // Anzahl der Unterteilungen entlang der Steife
|
|
131
|
+
// const int n_steps = 1000;
|
|
132
|
+
// double dy = L_S / n_steps;
|
|
133
|
+
|
|
134
|
+
// // Position der Längssteife
|
|
135
|
+
// double x_s = x_stiffener; // Kann auch als Parameter übergeben werden
|
|
136
|
+
|
|
137
|
+
// // Vorberechnung der konstanten Werte
|
|
138
|
+
// double sin_m_i_x = sin(m_i * M_PI * x_s / a);
|
|
139
|
+
// double sin_m_j_x = sin(m_j * M_PI * x_s / a);
|
|
140
|
+
// double coef_n_i = pow(n_i * M_PI / b, 2);
|
|
141
|
+
// double coef_n_j = pow(n_j * M_PI / b, 2);
|
|
142
|
+
|
|
143
|
+
// for (int i = 0; i <= n_steps; ++i)
|
|
144
|
+
// {
|
|
145
|
+
// double y = i * dy;
|
|
146
|
+
|
|
147
|
+
// double sin_n_i_y = sin(n_i * M_PI * y / b);
|
|
148
|
+
// double sin_n_j_y = sin(n_j * M_PI * y / b);
|
|
149
|
+
|
|
150
|
+
// double d2phi_i_dy2 = -coef_n_i * sin_m_i_x * sin_n_i_y;
|
|
151
|
+
// double d2phi_j_dy2 = -coef_n_j * sin_m_j_x * sin_n_j_y;
|
|
152
|
+
|
|
153
|
+
// double integrand = d2phi_i_dy2 * d2phi_j_dy2;
|
|
154
|
+
|
|
155
|
+
// // Gewichte für die Trapezregel
|
|
156
|
+
// double weight = 1.0;
|
|
157
|
+
// if (i == 0 || i == n_steps)
|
|
158
|
+
// weight = 0.5;
|
|
159
|
+
|
|
160
|
+
// integral += integrand * weight;
|
|
161
|
+
// }
|
|
162
|
+
|
|
163
|
+
// integral *= E * I_S * dy;
|
|
164
|
+
|
|
165
|
+
// return integral;
|
|
166
|
+
// }
|
|
167
|
+
|
|
168
|
+
// double integrate_transverse_stiffener_energy_cpp(int m_i, int n_i, int m_j, int n_j,
|
|
169
|
+
// double a, double b,
|
|
170
|
+
// double E, double I_T,
|
|
171
|
+
// double L_T, double y_stiffener)
|
|
172
|
+
// {
|
|
173
|
+
// const int n_steps = 1000;
|
|
174
|
+
// double dx = L_T / n_steps;
|
|
175
|
+
// double y_s = y_stiffener; // Position der Quersteife
|
|
176
|
+
|
|
177
|
+
// double sin_n_i_y = sin(n_i * M_PI * y_s / b);
|
|
178
|
+
// double sin_n_j_y = sin(n_j * M_PI * y_s / b);
|
|
179
|
+
|
|
180
|
+
// double integral = 0.0;
|
|
181
|
+
|
|
182
|
+
// for (int i = 0; i <= n_steps; ++i)
|
|
183
|
+
// {
|
|
184
|
+
// double x = i * dx;
|
|
185
|
+
|
|
186
|
+
// // Berechnung der Sinusfunktionen in x-Richtung
|
|
187
|
+
// double sin_m_i_x = sin(m_i * M_PI * x / a);
|
|
188
|
+
// double sin_m_j_x = sin(m_j * M_PI * x / a);
|
|
189
|
+
|
|
190
|
+
// // Zweite Ableitungen der Basisfunktionen
|
|
191
|
+
// double d2phi_i_dx2 = -pow(m_i * M_PI / a, 2) * sin_m_i_x * sin_n_i_y;
|
|
192
|
+
// double d2phi_j_dx2 = -pow(m_j * M_PI / a, 2) * sin_m_j_x * sin_n_j_y;
|
|
193
|
+
|
|
194
|
+
// double integrand = d2phi_i_dx2 * d2phi_j_dx2;
|
|
195
|
+
|
|
196
|
+
// // Trapezregel: Gewichte
|
|
197
|
+
// double weight = 1.0;
|
|
198
|
+
// if (i == 0 || i == n_steps)
|
|
199
|
+
// weight = 0.5;
|
|
200
|
+
|
|
201
|
+
// integral += integrand * weight;
|
|
202
|
+
// }
|
|
203
|
+
|
|
204
|
+
// integral *= E * I_T * dx;
|
|
205
|
+
|
|
206
|
+
// return integral;
|
|
207
|
+
// }
|
|
208
|
+
|
|
209
|
+
// double integrate_G_longi_stiffener_energy(int m_i, int n_i, int m_j, int n_j,
|
|
210
|
+
// double a, double b,
|
|
211
|
+
// double E, double A_L, double sig_i,
|
|
212
|
+
// double L_T, double y_stiffener)
|
|
213
|
+
// {
|
|
214
|
+
// const int n_steps = 1000;
|
|
215
|
+
// double dx = L_T / n_steps;
|
|
216
|
+
// double y_s = y_stiffener; // Position der Quersteife
|
|
217
|
+
|
|
218
|
+
// double sin_n_i_y = sin(n_i * M_PI * y_s / b);
|
|
219
|
+
// double sin_n_j_y = sin(n_j * M_PI * y_s / b);
|
|
220
|
+
|
|
221
|
+
// double integral = 0.0;
|
|
222
|
+
|
|
223
|
+
// for (int i = 0; i <= n_steps; ++i)
|
|
224
|
+
// {
|
|
225
|
+
// double x = i * dx;
|
|
226
|
+
|
|
227
|
+
// // Berechnung der Sinusfunktionen in x-Richtung
|
|
228
|
+
// double cos_m_i_x = cos(m_i * M_PI * x / a);
|
|
229
|
+
// double cos_m_j_x = cos(m_j * M_PI * x / a);
|
|
230
|
+
|
|
231
|
+
// // Zweite Ableitungen der Basisfunktionen
|
|
232
|
+
// double d2phi_i_dx = m_i * M_PI / a * cos_m_i_x * sin_n_i_y;
|
|
233
|
+
// double d2phi_j_dx = m_j * M_PI / a * cos_m_j_x * sin_n_j_y;
|
|
234
|
+
|
|
235
|
+
// double integrand = d2phi_i_dx * d2phi_j_dx;
|
|
236
|
+
|
|
237
|
+
// // Trapezregel: Gewichte
|
|
238
|
+
// double weight = 1.0;
|
|
239
|
+
// if (i == 0 || i == n_steps)
|
|
240
|
+
// weight = 0.5;
|
|
241
|
+
|
|
242
|
+
// integral += integrand * weight;
|
|
243
|
+
// }
|
|
244
|
+
|
|
245
|
+
// integral *= A_L * sig_i * dx;
|
|
246
|
+
|
|
247
|
+
// return integral;
|
|
248
|
+
// }
|
|
249
|
+
|
|
250
|
+
//_______________________________ INTEGRALLÖSUNG ENDE_______________________________________________
|
|
251
|
+
|
|
252
|
+
double integrate_transverse_stiffener_energy_cpp(int m_i, int n_i, int m_j, int n_j,
|
|
253
|
+
double a, double b,
|
|
254
|
+
double E, double I_T,
|
|
255
|
+
double L_T, double y_stiffener)
|
|
256
|
+
{
|
|
257
|
+
// Analytisch integrierte Funktionen für die Längssteifen.
|
|
258
|
+
|
|
259
|
+
double y_s = y_stiffener;
|
|
260
|
+
|
|
261
|
+
double sin_n_i_y = sin(n_i * M_PI * y_s / b);
|
|
262
|
+
double sin_n_j_y = sin(n_j * M_PI * y_s / b);
|
|
263
|
+
|
|
264
|
+
double k_i = m_i * M_PI / a;
|
|
265
|
+
double k_j = m_j * M_PI / a;
|
|
266
|
+
|
|
267
|
+
double K = pow(k_i * k_j, 2) * sin_n_i_y * sin_n_j_y;
|
|
268
|
+
|
|
269
|
+
double integral;
|
|
270
|
+
|
|
271
|
+
if (m_i != m_j)
|
|
272
|
+
{
|
|
273
|
+
double alpha = (k_i - k_j);
|
|
274
|
+
double beta = (k_i + k_j);
|
|
275
|
+
|
|
276
|
+
double term1 = sin(alpha * L_T) / alpha;
|
|
277
|
+
double term2 = sin(beta * L_T) / beta;
|
|
278
|
+
|
|
279
|
+
integral = (term1 - term2) * (K / 2.0);
|
|
280
|
+
}
|
|
281
|
+
else
|
|
282
|
+
{
|
|
283
|
+
double term1 = L_T / 2.0;
|
|
284
|
+
double term2 = sin(2 * k_i * L_T) / (4 * k_i);
|
|
285
|
+
|
|
286
|
+
integral = (term1 - term2) * K;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
integral *= E * I_T;
|
|
290
|
+
|
|
291
|
+
return integral;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
double integrate_G_longi_stiffener_energy(int m_i, int n_i, int m_j, int n_j,
|
|
295
|
+
double a, double b,
|
|
296
|
+
double E, double A_L, double sig_i,
|
|
297
|
+
double L_T, double y_stiffener)
|
|
298
|
+
{
|
|
299
|
+
double y_s = y_stiffener;
|
|
300
|
+
|
|
301
|
+
// Vorberechnung der konstanten Werte
|
|
302
|
+
double sin_n_i_y = sin(n_i * M_PI * y_s / b);
|
|
303
|
+
double sin_n_j_y = sin(n_j * M_PI * y_s / b);
|
|
304
|
+
|
|
305
|
+
double coef_m_i = m_i * M_PI / a;
|
|
306
|
+
double coef_m_j = m_j * M_PI / a;
|
|
307
|
+
|
|
308
|
+
double constant_terms = coef_m_i * coef_m_j * sin_n_i_y * sin_n_j_y;
|
|
309
|
+
|
|
310
|
+
double integral_x = 0.0;
|
|
311
|
+
|
|
312
|
+
if (m_i == m_j)
|
|
313
|
+
{
|
|
314
|
+
// Fall m_i == m_j
|
|
315
|
+
double term1 = L_T / 2.0;
|
|
316
|
+
double term2 = sin(2.0 * m_i * M_PI * L_T / a) * (a / (4.0 * M_PI * m_i));
|
|
317
|
+
integral_x = term1 + term2;
|
|
318
|
+
}
|
|
319
|
+
else
|
|
320
|
+
{
|
|
321
|
+
// Fall m_i != m_j
|
|
322
|
+
double delta_m = m_i - m_j;
|
|
323
|
+
double sum_m = m_i + m_j;
|
|
324
|
+
|
|
325
|
+
double term1 = sin(delta_m * M_PI * L_T / a) / (2.0 * delta_m * M_PI / a);
|
|
326
|
+
double term2 = sin(sum_m * M_PI * L_T / a) / (2.0 * sum_m * M_PI / a);
|
|
327
|
+
|
|
328
|
+
integral_x = term1 + term2;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
double integral = A_L * sig_i * constant_terms * integral_x;
|
|
332
|
+
|
|
333
|
+
return integral;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Funktion zur numerischen Integration des Matrixelements G_ij mit Simpson-Methode
|
|
337
|
+
double integrate_G_element_cpp(int m_i, int n_i, int m_j, int n_j,
|
|
338
|
+
double dphi_i_dx, double dphi_i_dy,
|
|
339
|
+
double dphi_j_dx, double dphi_j_dy,
|
|
340
|
+
double a, double b,
|
|
341
|
+
double Nx0, double Nx1, double Ny0, double Ny1, double Nxy)
|
|
342
|
+
{
|
|
343
|
+
// Anzahl der Unterteilungen in x- und y-Richtung (müssen gerade sein)
|
|
344
|
+
int n_x = 100;
|
|
345
|
+
int n_y = 100;
|
|
346
|
+
|
|
347
|
+
// Sicherstellen, dass n_x und n_y gerade sind
|
|
348
|
+
if (n_x % 2 != 0)
|
|
349
|
+
n_x += 1;
|
|
350
|
+
if (n_y % 2 != 0)
|
|
351
|
+
n_y += 1;
|
|
352
|
+
|
|
353
|
+
double dx = a / n_x;
|
|
354
|
+
double dy = b / n_y;
|
|
355
|
+
|
|
356
|
+
double integral = 0.0;
|
|
357
|
+
|
|
358
|
+
for (int i = 0; i <= n_x; ++i)
|
|
359
|
+
{
|
|
360
|
+
double x = i * dx;
|
|
361
|
+
|
|
362
|
+
double sin_m_i_x = sin(m_i * M_PI * x / a);
|
|
363
|
+
double cos_m_i_x = cos(m_i * M_PI * x / a);
|
|
364
|
+
double sin_m_j_x = sin(m_j * M_PI * x / a);
|
|
365
|
+
double cos_m_j_x = cos(m_j * M_PI * x / a);
|
|
366
|
+
|
|
367
|
+
// Gewichte für Simpson-Regel in x-Richtung
|
|
368
|
+
double wx;
|
|
369
|
+
if (i == 0 || i == n_x)
|
|
370
|
+
wx = 1.0;
|
|
371
|
+
else if (i % 2 == 0)
|
|
372
|
+
wx = 2.0;
|
|
373
|
+
else
|
|
374
|
+
wx = 4.0;
|
|
375
|
+
|
|
376
|
+
for (int j = 0; j <= n_y; ++j)
|
|
377
|
+
{
|
|
378
|
+
double y = j * dy;
|
|
379
|
+
|
|
380
|
+
// Korrekte Definition von Nx und Ny
|
|
381
|
+
double Nx = Nx0 + Nx1 / b * y;
|
|
382
|
+
double Ny = Ny0 + Ny1 / a * x;
|
|
383
|
+
|
|
384
|
+
// Gewichte für Simpson-Regel in y-Richtung
|
|
385
|
+
double wy;
|
|
386
|
+
if (j == 0 || j == n_y)
|
|
387
|
+
wy = 1.0;
|
|
388
|
+
else if (j % 2 == 0)
|
|
389
|
+
wy = 2.0;
|
|
390
|
+
else
|
|
391
|
+
wy = 4.0;
|
|
392
|
+
|
|
393
|
+
// Ansatzfunktionen und deren Ableitungen
|
|
394
|
+
double sin_n_i_y = sin(n_i * M_PI * y / b);
|
|
395
|
+
double cos_n_i_y = cos(n_i * M_PI * y / b);
|
|
396
|
+
double sin_n_j_y = sin(n_j * M_PI * y / b);
|
|
397
|
+
double cos_n_j_y = cos(n_j * M_PI * y / b);
|
|
398
|
+
|
|
399
|
+
double phi_i_dx = dphi_i_dx * cos_m_i_x * sin_n_i_y;
|
|
400
|
+
double phi_i_dy = dphi_i_dy * sin_m_i_x * cos_n_i_y;
|
|
401
|
+
double phi_j_dx = dphi_j_dx * cos_m_j_x * sin_n_j_y;
|
|
402
|
+
double phi_j_dy = dphi_j_dy * sin_m_j_x * cos_n_j_y;
|
|
403
|
+
|
|
404
|
+
// Beiträge zur geometrischen Steifigkeit
|
|
405
|
+
double term_x = Nx * phi_i_dx * phi_j_dx;
|
|
406
|
+
double term_y = Ny * phi_i_dy * phi_j_dy;
|
|
407
|
+
double term_xy = Nxy * (phi_i_dx * phi_j_dy + phi_i_dy * phi_j_dx);
|
|
408
|
+
|
|
409
|
+
double integrand = (term_x + term_y + term_xy);
|
|
410
|
+
|
|
411
|
+
integral += integrand * wx * wy;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
integral *= (dx * dy) / 9.0;
|
|
416
|
+
|
|
417
|
+
return integral;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Funktion zur Assemblierung der Matrizen K und G mit Berücksichtigung von Längs- und Quersteifen
|
|
421
|
+
void assemble_matrices_with_stiffeners_cpp(py::array_t<int> m_list,
|
|
422
|
+
py::array_t<int> n_list,
|
|
423
|
+
double a, double b,
|
|
424
|
+
double Nx0, double Nx1, double Ny0, double Ny1, double Nxy,
|
|
425
|
+
double E, double t, double nu,
|
|
426
|
+
py::array_t<double> x_s_positions,
|
|
427
|
+
py::array_t<double> I_s_values,
|
|
428
|
+
py::array_t<double> A_s_values,
|
|
429
|
+
py::array_t<double> y_s_positions,
|
|
430
|
+
py::array_t<double> I_t_values,
|
|
431
|
+
py::array_t<double> A_t_values,
|
|
432
|
+
py::array_t<double> K_flat,
|
|
433
|
+
py::array_t<double> G_flat)
|
|
434
|
+
{
|
|
435
|
+
auto m_list_unchecked = m_list.unchecked<1>();
|
|
436
|
+
auto n_list_unchecked = n_list.unchecked<1>();
|
|
437
|
+
auto K_flat_unchecked = K_flat.mutable_unchecked<1>();
|
|
438
|
+
auto G_flat_unchecked = G_flat.mutable_unchecked<1>();
|
|
439
|
+
|
|
440
|
+
auto x_s_positions_unchecked = x_s_positions.unchecked<1>();
|
|
441
|
+
auto I_s_values_unchecked = I_s_values.unchecked<1>();
|
|
442
|
+
auto A_s_values_unchecked = A_s_values.unchecked<1>();
|
|
443
|
+
|
|
444
|
+
auto y_s_positions_unchecked = y_s_positions.unchecked<1>();
|
|
445
|
+
auto I_t_values_unchecked = I_t_values.unchecked<1>();
|
|
446
|
+
auto A_t_values_unchecked = A_t_values.unchecked<1>();
|
|
447
|
+
|
|
448
|
+
double sig_i = 0;
|
|
449
|
+
|
|
450
|
+
// Extrahieren der Steifenpositionen und -werte in Vektoren
|
|
451
|
+
std::vector<double> x_s_positions_vec(x_s_positions.size());
|
|
452
|
+
std::vector<double> I_s_values_vec(I_s_values.size());
|
|
453
|
+
std::vector<double> A_s_values_vec(A_s_values.size());
|
|
454
|
+
|
|
455
|
+
for (size_t i = 0; i < x_s_positions.size(); ++i)
|
|
456
|
+
{
|
|
457
|
+
x_s_positions_vec[i] = x_s_positions_unchecked(i);
|
|
458
|
+
I_s_values_vec[i] = I_s_values_unchecked(i);
|
|
459
|
+
A_s_values_vec[i] = A_s_values_unchecked(i);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
std::vector<double> y_s_positions_vec(y_s_positions.size());
|
|
463
|
+
std::vector<double> I_t_values_vec(I_t_values.size());
|
|
464
|
+
std::vector<double> A_t_values_vec(A_t_values.size());
|
|
465
|
+
|
|
466
|
+
for (size_t i = 0; i < y_s_positions.size(); ++i)
|
|
467
|
+
{
|
|
468
|
+
y_s_positions_vec[i] = y_s_positions_unchecked(i);
|
|
469
|
+
I_t_values_vec[i] = I_t_values_unchecked(i);
|
|
470
|
+
A_t_values_vec[i] = A_t_values_unchecked(i);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
int num_terms = static_cast<int>(m_list.size());
|
|
474
|
+
double D_plate = E * pow(t, 3) / (12 * (1 - nu * nu));
|
|
475
|
+
|
|
476
|
+
#pragma omp parallel for
|
|
477
|
+
for (int idx_i = 0; idx_i < num_terms; ++idx_i)
|
|
478
|
+
{
|
|
479
|
+
int m_i = m_list_unchecked(idx_i);
|
|
480
|
+
int n_i = n_list_unchecked(idx_i);
|
|
481
|
+
|
|
482
|
+
double dphi_i_dx = m_i * M_PI / a;
|
|
483
|
+
double dphi_i_dy = n_i * M_PI / b;
|
|
484
|
+
|
|
485
|
+
for (int idx_j = 0; idx_j < num_terms; ++idx_j)
|
|
486
|
+
{
|
|
487
|
+
int m_j = m_list_unchecked(idx_j);
|
|
488
|
+
int n_j = n_list_unchecked(idx_j);
|
|
489
|
+
int idx = idx_i * num_terms + idx_j;
|
|
490
|
+
|
|
491
|
+
// Steifigkeitsmatrix K (Plattenbeitrag)
|
|
492
|
+
double K_ij = integrate_K_element_cpp(
|
|
493
|
+
m_i, n_i, m_j, n_j,
|
|
494
|
+
a, b,
|
|
495
|
+
D_plate, nu,
|
|
496
|
+
E);
|
|
497
|
+
|
|
498
|
+
// Integration der Steifenenergie (Längssteifen)
|
|
499
|
+
for (size_t s = 0; s < x_s_positions_vec.size(); ++s)
|
|
500
|
+
{
|
|
501
|
+
double I_S = I_s_values_vec[s];
|
|
502
|
+
double L_S = b; // Länge der Längssteife entlang y-Richtung
|
|
503
|
+
double x_stiff = x_s_positions_vec[s];
|
|
504
|
+
K_ij += integrate_longitudinal_stiffener_energy_cpp(
|
|
505
|
+
m_i, n_i, m_j, n_j,
|
|
506
|
+
a, b,
|
|
507
|
+
E, I_S,
|
|
508
|
+
L_S, x_stiff);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// Integration der Steifenenergie (Quersteifen)
|
|
512
|
+
for (size_t r = 0; r < y_s_positions_vec.size(); ++r)
|
|
513
|
+
{
|
|
514
|
+
double I_T = I_t_values_vec[r];
|
|
515
|
+
double y_stiff = y_s_positions_vec[r];
|
|
516
|
+
double L_T = a; // Länge der Quersteife entlang x-Richtung
|
|
517
|
+
|
|
518
|
+
K_ij += integrate_transverse_stiffener_energy_cpp(
|
|
519
|
+
m_i, n_i, m_j, n_j,
|
|
520
|
+
a, b,
|
|
521
|
+
E, I_T,
|
|
522
|
+
L_T, y_stiff);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
K_flat_unchecked(idx) = K_ij;
|
|
526
|
+
|
|
527
|
+
// Geometrische Steifigkeitsmatrix G
|
|
528
|
+
double dphi_j_dx = m_j * M_PI / a;
|
|
529
|
+
double dphi_j_dy = n_j * M_PI / b;
|
|
530
|
+
|
|
531
|
+
double G_ij = integrate_G_element_cpp(
|
|
532
|
+
m_i, n_i, m_j, n_j,
|
|
533
|
+
dphi_i_dx, dphi_i_dy, dphi_j_dx, dphi_j_dy,
|
|
534
|
+
a, b, Nx0, Nx1, Ny0, Ny1, Nxy);
|
|
535
|
+
|
|
536
|
+
// Integration der Steifenenergie (Längssteifen)
|
|
537
|
+
for (size_t r = 0; r < y_s_positions_vec.size(); ++r)
|
|
538
|
+
{
|
|
539
|
+
double A_L = A_t_values_vec[r];
|
|
540
|
+
double y_stiff = y_s_positions_vec[r];
|
|
541
|
+
double L_T = a; // Länge der Quersteife entlang x-Richtung
|
|
542
|
+
|
|
543
|
+
double sig_i_l = (Nx0 + Nx1 * y_stiff / b) / t;
|
|
544
|
+
|
|
545
|
+
G_ij += integrate_G_longi_stiffener_energy(
|
|
546
|
+
m_i, n_i, m_j, n_j,
|
|
547
|
+
a, b,
|
|
548
|
+
E, A_L, sig_i_l, L_T, y_stiff);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
G_flat_unchecked(idx) = G_ij;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// Pybind11-Moduldefinition
|
|
557
|
+
PYBIND11_MODULE(plate_buckling_cpp, m)
|
|
558
|
+
{
|
|
559
|
+
m.def("assemble_matrices_with_stiffeners_cpp", &assemble_matrices_with_stiffeners_cpp,
|
|
560
|
+
"Assemblierung der Matrizen K und G mit Berücksichtigung von Längs- und Quersteifen");
|
|
561
|
+
}
|
|
Binary file
|