ourocode 1.6.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.

Potentially problematic release.


This version of ourocode might be problematic. Click here for more details.

Files changed (53) hide show
  1. ourocode/__init__.py +0 -0
  2. ourocode/__version__.py +1 -0
  3. ourocode/data/caracteristique_meca_acier.csv +33 -0
  4. ourocode/data/caracteristique_meca_bois.csv +59 -0
  5. ourocode/data/carte_action_region.csv +36722 -0
  6. ourocode/data/coeff_psy.csv +13 -0
  7. ourocode/data/exploitation.csv +17 -0
  8. ourocode/data/gammaM.csv +14 -0
  9. ourocode/data/kdef.csv +11 -0
  10. ourocode/data/kfi.csv +10 -0
  11. ourocode/data/kmod.csv +16 -0
  12. ourocode/data/limite_fleche.csv +9 -0
  13. ourocode/data/qualite_acier.csv +18 -0
  14. ourocode/data/screenshot/C90_def.png +0 -0
  15. ourocode/data/screenshot/Kv_def.png +0 -0
  16. ourocode/data/screenshot/fleche.png +0 -0
  17. ourocode/data/screenshot/sign_convention.png +0 -0
  18. ourocode/data/section_boulon.csv +12 -0
  19. ourocode/data/vent/vent_Cp_toiture_isolee_1_versant.csv +22 -0
  20. ourocode/data/vent/vent_Cp_toiture_isolee_1_versant.png +0 -0
  21. ourocode/data/vent/vent_Cp_toiture_isolee_2_versants.csv +31 -0
  22. ourocode/data/vent/vent_Cp_toiture_isolee_2_versants.png +0 -0
  23. ourocode/data/vent/vent_Cpe_mur_verticaux.csv +11 -0
  24. ourocode/data/vent/vent_Cpe_mur_verticaux.png +0 -0
  25. ourocode/data/vent/vent_Cpe_toiture_1_versant.png +0 -0
  26. ourocode/data/vent/vent_Cpe_toiture_1_versant_0_degres.csv +13 -0
  27. ourocode/data/vent/vent_Cpe_toiture_1_versant_180_degres.csv +13 -0
  28. ourocode/data/vent/vent_Cpe_toiture_1_versant_90_degres.csv +13 -0
  29. ourocode/data/vent/vent_Cpe_toiture_2_versants.png +0 -0
  30. ourocode/data/vent/vent_Cpe_toiture_2_versants_0_degres.csv +21 -0
  31. ourocode/data/vent/vent_Cpe_toiture_2_versants_90_degres.csv +21 -0
  32. ourocode/data/vent/vent_Cpe_toiture_terrasse.csv +21 -0
  33. ourocode/data/vent/vent_Cpe_toiture_terrasse.png +0 -0
  34. ourocode/data/vent/vent_Ffr.png +0 -0
  35. ourocode/eurocode/A0_Projet.py +1408 -0
  36. ourocode/eurocode/EC0_Combinaison.py +1763 -0
  37. ourocode/eurocode/EC1_Exploitation.py +103 -0
  38. ourocode/eurocode/EC1_Neige.py +385 -0
  39. ourocode/eurocode/EC1_Vent.py +1388 -0
  40. ourocode/eurocode/EC3_Assemblage.py +466 -0
  41. ourocode/eurocode/EC3_Element_droit.py +302 -0
  42. ourocode/eurocode/EC5_Assemblage.py +1760 -0
  43. ourocode/eurocode/EC5_Element_droit.py +1740 -0
  44. ourocode/eurocode/EC5_Feu.py +922 -0
  45. ourocode/eurocode/EC8_Sismique.py +2 -0
  46. ourocode/eurocode/__init__.py +0 -0
  47. ourocode/eurocode/logical.py +83 -0
  48. ourocode/eurocode/objet.py +263 -0
  49. ourocode-1.6.0.dist-info/METADATA +331 -0
  50. ourocode-1.6.0.dist-info/RECORD +53 -0
  51. ourocode-1.6.0.dist-info/WHEEL +5 -0
  52. ourocode-1.6.0.dist-info/licenses/LICENSE +201 -0
  53. ourocode-1.6.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1763 @@
1
+ # coding in UTF-8
2
+ # by Anthony PARISOT
3
+ import os, sys
4
+ import numpy as np
5
+ import pandas as pd
6
+
7
+ # sys.path.append(os.path.join(os.getcwd(), "ourocode"))
8
+ # # from A0_Projet import Bar_generator
9
+ from ourocode.eurocode.A0_Projet import Projet, Model_generator
10
+
11
+
12
+ class Combinaison(Projet):
13
+ CAT_TYPE = (
14
+ "Aucune",
15
+ "Cat A : habitation",
16
+ "Cat B : bureaux",
17
+ "Cat C : lieu de réunion",
18
+ "Cat D : zones commerciales",
19
+ "Cat E : stockage",
20
+ "Cat F : véhicule <= 30kN",
21
+ "Cat G : véhicule <= 160kN",
22
+ "Cat H : toits",
23
+ )
24
+ COEF_G = (1, 1.35) # Ginf, Gsup
25
+ COEF_Q = 1.5 # Qsup
26
+ ANALYZE_TYPE = ("Général", "Linéaire", "Second ordre")
27
+
28
+ def __init__(
29
+ self,
30
+ model_generator: object,
31
+ ELU_STR: bool = ("True", "False"),
32
+ ELU_STR_ACC: bool = ("True", "False"),
33
+ ELS_C: bool = ("True", "False"),
34
+ ELS_QP: bool = ("True", "False"),
35
+ cat: str = CAT_TYPE,
36
+ kdef: float = None,
37
+ type_psy_2: str = ["Court terme", "Moyen terme", "Long terme"],
38
+ **kwargs,
39
+ ):
40
+ """Créer une classe Combinaison qui génère les combinaisons d'action suivant les actions données.
41
+ Cette classe est hérité de la classe Projet du module A0_Projet.py.
42
+ Elle nécessite toutefois la création d'un modèle de calcul avant d'être instanciée.
43
+ Le modèle de calcul est créé par la classe Model_generator dans le module A0_Projet.py.
44
+
45
+ Args:
46
+ model_generator (Model_generator): le modèle de calcul à utiliser pour la génération des combinaisons d'action.
47
+ ELU_STR (bool): combiner les charges à l'ELU structure, si vrai -> True, sinon False.
48
+ ELU_STR_ACC (bool): combiner les charges à l'ELU accidentel, si vrai -> True, sinon False.
49
+ ELS_C (bool): combiner les charges à l'ELS carctéristique, si vrai -> True, sinon False.
50
+ ELS_QP (bool): combiner les charges à l'ELS quasi permananent, si vrai -> True, sinon False.
51
+ cat (str): catégorie d'exploitation de la zone considéré. Defaults to "Aucune".
52
+ kdef (float): Coefficient permettant de prendre en compte le fluage du bois en fonction de sa classe de service.
53
+ Si le matériaux est autre que du bois laisser vide.
54
+ type_psy_2: détermine le type de psy 2 à récupérer notamment pour le calcul de la flèche dans le bois.
55
+ Court terme = 0, Moyen terme = calcul du psy en fonction de l'action donnant le psy le plus élevé, Long terme = 1.
56
+ """
57
+ super().__init__(**kwargs)
58
+ self._combo_tags = []
59
+ self._model_generator = model_generator
60
+ self._model_generator.generate_model()
61
+ self.elu_STR = ELU_STR
62
+ self.elu_STR_ACC = ELU_STR_ACC
63
+ self.els_C = ELS_C
64
+ self.els_QP = ELS_QP
65
+ self.cat = cat
66
+ self._name_combination = []
67
+ self._generate_combinaison()
68
+ if kdef:
69
+ self.type_psy_2 = type_psy_2
70
+ self._els_fleche_bois(kdef)
71
+
72
+ def _generate_combinaison(self):
73
+ """Génère les combinaisons de chargement si une liste de chargement à été définit précédement."""
74
+ self.combiActionVariable = [0] * 7
75
+ for load in self._model_generator.get_all_loads().values():
76
+ action = load["Action"]
77
+ if action == "Permanente G":
78
+ self.combiActionVariable[0] = "G"
79
+
80
+ elif action == "Exploitation Q":
81
+ self.combiActionVariable[1] = "Q"
82
+
83
+ elif action == "Neige normale Sn":
84
+ self.combiActionVariable[2] = "Sn"
85
+
86
+ elif action == "Vent pression W+":
87
+ self.combiActionVariable[3] = "W+"
88
+
89
+ elif action == "Vent dépression W-":
90
+ self.combiActionVariable[4] = "W-"
91
+
92
+ elif action == "Neige accidentelle Sx":
93
+ self.combiActionVariable[5] = "Sx"
94
+
95
+ else:
96
+ self.combiActionVariable[6] = "Ae"
97
+
98
+ if self.elu_STR:
99
+ self._ELU_STR()
100
+ self._combo_tags.append("ELU_STR")
101
+ if self.elu_STR_ACC:
102
+ self._ELU_STR_ACC()
103
+ self._combo_tags.append("ELU_STR_ACC")
104
+ if self.els_C:
105
+ self._ELS_C()
106
+ self._combo_tags.append("ELS_C")
107
+ if self.els_QP:
108
+ self._ELS_QP()
109
+ self._combo_tags.append("ELS_QP")
110
+
111
+ @property
112
+ def coef_psy(self):
113
+ """Retourne les caractéristiques psy sous forme de dictionnaire"""
114
+ dict_psy = {self.cat: {}, "Vent": {}, "Température": {}}
115
+ if self.alt.value > 1000:
116
+ dict_psy["Neige > 1000m"] = {}
117
+ else:
118
+ dict_psy["Neige <= 1000m"] = {}
119
+
120
+ data_csv_psy = self._data_from_csv("coeff_psy.csv")
121
+ psy_columns = data_csv_psy.columns.to_list()
122
+
123
+ for psy_i in psy_columns:
124
+ for key in dict_psy.keys():
125
+ dict_psy[key][psy_i] = data_csv_psy.loc[key].loc[psy_i]
126
+ return dict_psy
127
+
128
+ def _key_action_psy(self, action_variable):
129
+ if action_variable == "Q":
130
+ index = self.cat
131
+ elif action_variable == "Sn":
132
+ if self.alt.value > 1000:
133
+ index = "Neige > 1000m"
134
+ else:
135
+ index = "Neige <= 1000m"
136
+
137
+ elif action_variable == "W+" or action_variable == "W-":
138
+ index = "Vent"
139
+ else:
140
+ index = "Température"
141
+ return index
142
+
143
+ def _create_array_load(
144
+ self,
145
+ name: str,
146
+ index: str,
147
+ factor_load: float,
148
+ load: float | dict,
149
+ load_dict: dict,
150
+ array,
151
+ ):
152
+ load = np.array(
153
+ [
154
+ name,
155
+ str(index),
156
+ load_dict["N° barre"],
157
+ load_dict["Nom"],
158
+ load_dict["Action"],
159
+ load_dict["Type de charge"],
160
+ factor_load,
161
+ load,
162
+ load_dict["Position"],
163
+ load_dict["Axe"],
164
+ ],
165
+ dtype=object,
166
+ )
167
+ array = np.append(array, [load], axis=0)
168
+ return array
169
+
170
+ def _create_dataframe_load(self, array_load):
171
+ df_load = pd.DataFrame(
172
+ array_load,
173
+ columns=[
174
+ "Combinaison",
175
+ "Index",
176
+ "N° de barre",
177
+ "Nom",
178
+ "Action",
179
+ "Type",
180
+ "Facteur de charge",
181
+ "Charge combinée",
182
+ "Position",
183
+ "Axe",
184
+ ],
185
+ )
186
+ # print(df_load)
187
+ return df_load
188
+
189
+ def _create_analyze_type(self, tag: str, df_type_load: pd.DataFrame):
190
+ """Génère les load combo dans le modèle FEM
191
+
192
+ Args:
193
+ tag (str): combo_tag à donner dans le modèle
194
+ df_type_load (pd.Dataframe): dataframe des combinaisons associé au tag (ex: ELU_STR, ELS_C)
195
+ """
196
+ unique_combinations = df_type_load["Combinaison"].unique()
197
+ combo_dict = {}
198
+ for combo_name in unique_combinations:
199
+ combo_dict[combo_name] = self._get_combi_factor_load(combo_name)
200
+ self._model_generator._add_load_combos_to_model(combo_dict, tag)
201
+
202
+
203
+ def _calcs_combined_load(self, factor: float, load: float):
204
+ """Convertit la valeur de la charge en fonction du type de charge."""
205
+ if isinstance(load, dict):
206
+ return {"start": load["start"] * factor, "end": load["end"] * factor}
207
+ else:
208
+ return load * factor
209
+
210
+ def _create_list_combination(self, nameCombi: str):
211
+ if nameCombi not in self._name_combination:
212
+ self._name_combination.append(nameCombi)
213
+
214
+ def _add_combination(self, combi_name: str, index_load: str, factor: float, value: float| dict, load_dict: dict, array_load):
215
+ """Ajoute une combinaison et met à jour array_load."""
216
+ self._create_list_combination(combi_name)
217
+ return self._create_array_load(combi_name, index_load, factor, value, load_dict, array_load)
218
+
219
+ def _ELU_STR(self):
220
+ """Combinaison à l'ELU STR"""
221
+ array_load = np.empty((0, 10))
222
+
223
+ for index_load, load in self._model_generator.get_all_loads().items():
224
+ load_action = self.DICO_COMBI_ACTION[load["Action"]]
225
+ if (
226
+ load_action
227
+ not in self.combiActionVariable[5:7]
228
+ ):
229
+ name = "ELU_STR " + load_action
230
+ array_load = self._add_combination(name, index_load, 1, load["Charge"], load, array_load)
231
+
232
+ for var_action in self.combiActionVariable:
233
+ if not var_action in ("Sx", "Ae"):
234
+ if load["Action"] == "Permanente G" and var_action == "G":
235
+ name = "ELU_STR " + str(self.COEF_G[1]) + "G"
236
+ value = self._calcs_combined_load(
237
+ self.COEF_G[1], load["Charge"]
238
+ )
239
+ array_load = self._add_combination(name, index_load, self.COEF_G[1], value, load, array_load)
240
+
241
+ elif var_action != 0 and var_action != "G":
242
+ if var_action != "W-":
243
+ name = "ELU_STR 1.35G + " + str(self.COEF_Q) + var_action
244
+ self._create_list_combination(name)
245
+
246
+ if (
247
+ load["Action"] != "Permanente G"
248
+ and load_action == var_action
249
+ ):
250
+ if var_action == "W-":
251
+ name = "ELU_STR 1G" + " + " + str(self.COEF_Q) + var_action
252
+ self._create_list_combination(name)
253
+ value = self._calcs_combined_load(
254
+ self.COEF_Q, load["Charge"]
255
+ )
256
+ array_load = self._create_array_load(
257
+ name, index_load, self.COEF_Q, value, load, array_load
258
+ )
259
+
260
+ elif load["Action"] == "Permanente G":
261
+ if var_action == "W-":
262
+ name = "ELU_STR 1G" + " + " + str(self.COEF_Q) + var_action
263
+ self._create_list_combination(name)
264
+ factor = self.COEF_G[0]
265
+ value = self._calcs_combined_load(
266
+ factor, load["Charge"]
267
+ )
268
+ else:
269
+ factor = self.COEF_G[1]
270
+ value = self._calcs_combined_load(
271
+ factor, load["Charge"]
272
+ )
273
+ array_load = self._create_array_load(
274
+ name, index_load, factor, value, load, array_load
275
+ )
276
+
277
+ for index in range(1, 4):
278
+ if (
279
+ var_action != self.combiActionVariable[index]
280
+ and var_action != "W-"
281
+ ):
282
+ # selon AN EC1 on ne doit pas combiner les charges d'entretien avec les charges de neige et de vent en toiture
283
+ if (
284
+ var_action == "Q"
285
+ or self.combiActionVariable[index] == "Q"
286
+ ) and self.cat == "Cat H : toits":
287
+ continue
288
+ if self.combiActionVariable[index] != 0:
289
+ key_psy = self._key_action_psy(
290
+ self.combiActionVariable[index]
291
+ )
292
+ name = (
293
+ "ELU_STR 1.35G + "
294
+ + str(self.COEF_Q)
295
+ + var_action
296
+ + " + "
297
+ + str(
298
+ round(
299
+ self.coef_psy[key_psy]["psy0"]
300
+ * self.COEF_Q,
301
+ 2,
302
+ )
303
+ )
304
+ + self.combiActionVariable[index]
305
+ )
306
+ self._create_list_combination(name)
307
+
308
+ if load["Action"] == "Permanente G":
309
+ value = self._calcs_combined_load(
310
+ self.COEF_G[1], load["Charge"]
311
+ )
312
+ array_load = self._create_array_load(
313
+ name,
314
+ index_load,
315
+ self.COEF_G[1],
316
+ value,
317
+ load,
318
+ array_load,
319
+ )
320
+
321
+ elif (
322
+ load_action
323
+ == self.combiActionVariable[index]
324
+ ):
325
+ factor = (
326
+ float(self.coef_psy[key_psy]["psy0"])
327
+ * self.COEF_Q
328
+ )
329
+ value = self._calcs_combined_load(
330
+ factor, load["Charge"]
331
+ )
332
+ array_load = self._create_array_load(
333
+ name,
334
+ index_load,
335
+ factor,
336
+ value,
337
+ load,
338
+ array_load,
339
+ )
340
+
341
+ elif (
342
+ load_action == var_action
343
+ ):
344
+ value = self._calcs_combined_load(
345
+ self.COEF_Q, load["Charge"]
346
+ )
347
+ array_load = self._create_array_load(
348
+ name,
349
+ index_load,
350
+ self.COEF_Q,
351
+ value,
352
+ load,
353
+ array_load,
354
+ )
355
+
356
+ for index2 in range(1, 4):
357
+ if var_action != self.combiActionVariable[index2]:
358
+ if (
359
+ self.combiActionVariable[index]
360
+ != self.combiActionVariable[index2]
361
+ ):
362
+ if self.combiActionVariable.index(
363
+ self.combiActionVariable[index]
364
+ ) < self.combiActionVariable.index(
365
+ self.combiActionVariable[index2]
366
+ ):
367
+ if (
368
+ self.combiActionVariable[index2]
369
+ != 0
370
+ ):
371
+ key_psy2 = self._key_action_psy(
372
+ self.combiActionVariable[
373
+ index2
374
+ ]
375
+ )
376
+ name = (
377
+ "ELU_STR 1.35G + "
378
+ + str(self.COEF_Q)
379
+ + var_action
380
+ + " + "
381
+ + str(
382
+ round(
383
+ self.coef_psy[
384
+ key_psy
385
+ ]["psy0"]
386
+ * self.COEF_Q,
387
+ 2,
388
+ )
389
+ )
390
+ + self.combiActionVariable[
391
+ index
392
+ ]
393
+ + " + "
394
+ + str(
395
+ round(
396
+ self.coef_psy[
397
+ key_psy2
398
+ ]["psy0"]
399
+ * self.COEF_Q,
400
+ 2,
401
+ )
402
+ )
403
+ + self.combiActionVariable[
404
+ index2
405
+ ]
406
+ )
407
+ self._create_list_combination(
408
+ name
409
+ )
410
+
411
+ if (
412
+ load["Action"]
413
+ == "Permanente G"
414
+ ):
415
+ value = self._calcs_combined_load(
416
+ self.COEF_G[1],
417
+ load["Charge"],
418
+ )
419
+ array_load = (
420
+ self._create_array_load(
421
+ name,
422
+ index_load,
423
+ self.COEF_G[1],
424
+ value,
425
+ load,
426
+ array_load,
427
+ )
428
+ )
429
+
430
+ elif (
431
+ self.DICO_COMBI_ACTION[
432
+ load["Action"]
433
+ ]
434
+ == self.combiActionVariable[
435
+ index2
436
+ ]
437
+ ):
438
+ factor = (
439
+ float(
440
+ self.coef_psy[
441
+ key_psy2
442
+ ]["psy0"]
443
+ )
444
+ * self.COEF_Q
445
+ )
446
+ self._calcs_combined_load(
447
+ factor,
448
+ load["Charge"],
449
+ )
450
+ array_load = (
451
+ self._create_array_load(
452
+ name,
453
+ index_load,
454
+ factor,
455
+ value,
456
+ load,
457
+ array_load,
458
+ )
459
+ )
460
+
461
+ elif (
462
+ self.DICO_COMBI_ACTION[
463
+ load["Action"]
464
+ ]
465
+ == self.combiActionVariable[
466
+ index
467
+ ]
468
+ ):
469
+ factor = (
470
+ float(
471
+ self.coef_psy[
472
+ key_psy
473
+ ]["psy0"]
474
+ )
475
+ * self.COEF_Q
476
+ )
477
+ value = self._calcs_combined_load(
478
+ factor,
479
+ load["Charge"],
480
+ )
481
+ array_load = (
482
+ self._create_array_load(
483
+ name,
484
+ index_load,
485
+ factor,
486
+ value,
487
+ load,
488
+ array_load,
489
+ )
490
+ )
491
+
492
+ elif (
493
+ self.DICO_COMBI_ACTION[
494
+ load["Action"]
495
+ ]
496
+ == var_action
497
+ ):
498
+ value = self._calcs_combined_load(
499
+ self.COEF_Q,
500
+ load["Charge"],
501
+ )
502
+ array_load = (
503
+ self._create_array_load(
504
+ name,
505
+ index_load,
506
+ self.COEF_Q,
507
+ value,
508
+ load,
509
+ array_load,
510
+ )
511
+ )
512
+ array_load = array_load[array_load[:, 0].argsort()]
513
+ self._df_load_ELU_STR = self._create_dataframe_load(array_load)
514
+ self._create_analyze_type("ELU_STR", self._df_load_ELU_STR)
515
+
516
+ def get_ELU_STR_loads(self):
517
+ """Retourne les charges des combinaisons ELU STR"""
518
+ return self._df_load_ELU_STR
519
+
520
+ def _return_combi_ELUSTR(self, combi):
521
+ return self._df_load_ELU_STR.loc[self._df_load_ELU_STR["Combinaison"] == combi]
522
+
523
+ def _ELU_STR_ACC(self):
524
+ """Combinaison à l'ELU STR ACC"""
525
+ array_load = np.empty((0, 10))
526
+ acc_action = ("Sx", "Ae")
527
+
528
+ for index_load, load in self._model_generator.get_all_loads().items():
529
+ if (
530
+ self.DICO_COMBI_ACTION[load["Action"]]
531
+ not in self.combiActionVariable[1:5]
532
+ ):
533
+ name = "ELU_STR_ACC " + self.DICO_COMBI_ACTION[load["Action"]]
534
+ self._create_list_combination(name)
535
+ array_load = self._create_array_load(
536
+ name, index_load, 1, load["Charge"], load, array_load
537
+ )
538
+
539
+ for action in self.combiActionVariable:
540
+ # if action not in ("W-",):
541
+ if action not in (0, "G"):
542
+ key_psy_action = self._key_action_psy(action)
543
+ if action in acc_action:
544
+ name = "ELU_STR_ACC G + " + action
545
+ elif self.coef_psy[key_psy_action]["psy1"] != 0:
546
+ name = (
547
+ "ELU_STR_ACC_FIRE G + "
548
+ + str(self.coef_psy[key_psy_action]["psy1"])
549
+ + action
550
+ )
551
+
552
+ if name:
553
+ self._create_list_combination(name)
554
+ if (
555
+ load["Action"] != "Permanente G"
556
+ and self.DICO_COMBI_ACTION[load["Action"]] == action
557
+ ):
558
+ if action in acc_action:
559
+ array_load = self._create_array_load(
560
+ name,
561
+ index_load,
562
+ 1,
563
+ load["Charge"],
564
+ load,
565
+ array_load,
566
+ )
567
+ else:
568
+ factor = float(self.coef_psy[key_psy_action]["psy1"])
569
+ value = self._calcs_combined_load(
570
+ factor, load["Charge"]
571
+ )
572
+ array_load = self._create_array_load(
573
+ name, index_load, factor, value, load, array_load
574
+ )
575
+
576
+ elif load["Action"] == "Permanente G":
577
+ array_load = self._create_array_load(
578
+ name, index_load, 1, load["Charge"], load, array_load
579
+ )
580
+
581
+ for index in range(1, 4):
582
+ if action != self.combiActionVariable[index]:
583
+ if self.combiActionVariable[index] != 0 and action not in (
584
+ "W-",
585
+ ):
586
+ # selon AN EC1 on ne doit pas combiner les charges d'entretien avec les charges de neige et de vent en toiture
587
+ if (
588
+ action == "Q"
589
+ or self.combiActionVariable[index] == "Q"
590
+ ) and self.cat == "Cat H : toits":
591
+ continue
592
+ key_psy = self._key_action_psy(
593
+ self.combiActionVariable[index]
594
+ )
595
+ if self.coef_psy[key_psy]["psy2"] != 0:
596
+ if action in acc_action:
597
+ name_2 = (
598
+ "ELU_STR_ACC G + "
599
+ + action
600
+ + " + "
601
+ + str(self.coef_psy[key_psy]["psy2"])
602
+ + self.combiActionVariable[index]
603
+ )
604
+ else:
605
+ name_2 = (
606
+ "ELU_STR_ACC_FIRE G + "
607
+ + str(self.coef_psy[key_psy_action]["psy1"])
608
+ + action
609
+ + " + "
610
+ + str(self.coef_psy[key_psy]["psy2"])
611
+ + self.combiActionVariable[index]
612
+ )
613
+
614
+ try:
615
+ self._create_list_combination(name_2)
616
+ if load["Action"] == "Permanente G":
617
+ array_load = self._create_array_load(
618
+ name_2,
619
+ index_load,
620
+ 1,
621
+ load["Charge"],
622
+ load,
623
+ array_load,
624
+ )
625
+
626
+ elif (
627
+ self.DICO_COMBI_ACTION[load["Action"]]
628
+ == self.combiActionVariable[index]
629
+ ):
630
+ factor = float(
631
+ self.coef_psy[key_psy]["psy2"]
632
+ )
633
+ value = self._calcs_combined_load(
634
+ factor, load["Charge"]
635
+ )
636
+ array_load = self._create_array_load(
637
+ name_2,
638
+ index_load,
639
+ factor,
640
+ value,
641
+ load,
642
+ array_load,
643
+ )
644
+
645
+ elif (
646
+ self.DICO_COMBI_ACTION[load["Action"]]
647
+ == action
648
+ ):
649
+ if action in acc_action:
650
+ array_load = self._create_array_load(
651
+ name_2,
652
+ index_load,
653
+ 1,
654
+ load["Charge"],
655
+ load,
656
+ array_load,
657
+ )
658
+ else:
659
+ factor = float(
660
+ self.coef_psy[key_psy_action][
661
+ "psy1"
662
+ ]
663
+ )
664
+ value = self._calcs_combined_load(
665
+ factor, load["Charge"]
666
+ )
667
+ array_load = self._create_array_load(
668
+ name_2,
669
+ index_load,
670
+ factor,
671
+ value,
672
+ load,
673
+ array_load,
674
+ )
675
+ except:
676
+ pass
677
+
678
+ for index2 in range(1, 4):
679
+ if action != self.combiActionVariable[
680
+ index2
681
+ ] and action not in ("W-",):
682
+ if (
683
+ self.combiActionVariable[index]
684
+ != self.combiActionVariable[index2]
685
+ ):
686
+ if self.combiActionVariable.index(
687
+ self.combiActionVariable[index]
688
+ ) < self.combiActionVariable.index(
689
+ self.combiActionVariable[index2]
690
+ ):
691
+ if (
692
+ self.combiActionVariable[index2]
693
+ != 0
694
+ ):
695
+ key_psy2 = self._key_action_psy(
696
+ self.combiActionVariable[
697
+ index2
698
+ ]
699
+ )
700
+ if (
701
+ self.coef_psy[key_psy2][
702
+ "psy2"
703
+ ]
704
+ != 0
705
+ ):
706
+ if action in acc_action:
707
+ name_3 = (
708
+ "ELU_STR_ACC G + "
709
+ + action
710
+ + " + "
711
+ + str(
712
+ self.coef_psy[
713
+ key_psy
714
+ ]["psy2"]
715
+ )
716
+ + self.combiActionVariable[
717
+ index
718
+ ]
719
+ + " + "
720
+ + str(
721
+ self.coef_psy[
722
+ key_psy2
723
+ ]["psy2"]
724
+ )
725
+ + self.combiActionVariable[
726
+ index2
727
+ ]
728
+ )
729
+ else:
730
+ name_3 = (
731
+ "ELU_STR_ACC_FIRE G + "
732
+ + str(
733
+ self.coef_psy[
734
+ key_psy_action
735
+ ]["psy1"]
736
+ )
737
+ + action
738
+ + " + "
739
+ + str(
740
+ self.coef_psy[
741
+ key_psy
742
+ ]["psy2"]
743
+ )
744
+ + self.combiActionVariable[
745
+ index
746
+ ]
747
+ + " + "
748
+ + str(
749
+ self.coef_psy[
750
+ key_psy2
751
+ ]["psy2"]
752
+ )
753
+ + self.combiActionVariable[
754
+ index2
755
+ ]
756
+ )
757
+
758
+ try:
759
+ self._create_list_combination(
760
+ name_3
761
+ )
762
+
763
+ if (
764
+ load["Action"]
765
+ == "Permanente G"
766
+ ):
767
+ array_load = self._create_array_load(
768
+ name_3,
769
+ index_load,
770
+ 1,
771
+ load["Charge"],
772
+ load,
773
+ array_load,
774
+ )
775
+
776
+ elif (
777
+ self.DICO_COMBI_ACTION[
778
+ load["Action"]
779
+ ]
780
+ == self.combiActionVariable[
781
+ index2
782
+ ]
783
+ ):
784
+ factor = float(
785
+ self.coef_psy[
786
+ key_psy2
787
+ ]["psy2"]
788
+ )
789
+ value = self._calcs_combined_load(
790
+ factor,
791
+ load["Charge"],
792
+ )
793
+ array_load = self._create_array_load(
794
+ name_3,
795
+ index_load,
796
+ factor,
797
+ value,
798
+ load,
799
+ array_load,
800
+ )
801
+
802
+ elif (
803
+ self.DICO_COMBI_ACTION[
804
+ load["Action"]
805
+ ]
806
+ == self.combiActionVariable[
807
+ index
808
+ ]
809
+ ):
810
+ factor = float(
811
+ self.coef_psy[
812
+ key_psy
813
+ ]["psy2"]
814
+ )
815
+ value = self._calcs_combined_load(
816
+ factor,
817
+ load["Charge"],
818
+ )
819
+ array_load = self._create_array_load(
820
+ name_3,
821
+ index_load,
822
+ factor,
823
+ value,
824
+ load,
825
+ array_load,
826
+ )
827
+
828
+ elif (
829
+ self.DICO_COMBI_ACTION[
830
+ load["Action"]
831
+ ]
832
+ == action
833
+ ):
834
+ if (
835
+ action
836
+ in acc_action
837
+ ):
838
+ array_load = self._create_array_load(
839
+ name_3,
840
+ index_load,
841
+ 1,
842
+ load[
843
+ "Charge"
844
+ ],
845
+ load,
846
+ array_load,
847
+ )
848
+ else:
849
+ factor = float(
850
+ self.coef_psy[
851
+ key_psy_action
852
+ ][
853
+ "psy1"
854
+ ]
855
+ )
856
+ value = self._calcs_combined_load(
857
+ factor,
858
+ load[
859
+ "Charge"
860
+ ],
861
+ )
862
+ array_load = self._create_array_load(
863
+ name_3,
864
+ index_load,
865
+ factor,
866
+ value,
867
+ load,
868
+ array_load,
869
+ )
870
+ except:
871
+ pass
872
+ array_load = array_load[array_load[:, 0].argsort()]
873
+ self._df_load_ELU_STR_ACC = self._create_dataframe_load(array_load)
874
+ self._create_analyze_type("ELU_STR_ACC", self._df_load_ELU_STR_ACC)
875
+
876
+ def get_ELU_STR_ACC_loads(self):
877
+ """Retourne les charges de la combinaison ELU STR ACC"""
878
+ return self._df_load_ELU_STR_ACC
879
+
880
+ def _return_combi_ELU_STR_ACC(self, combi):
881
+ return self._df_load_ELU_STR_ACC.loc[
882
+ self._df_load_ELU_STR_ACC["Combinaison"] == combi
883
+ ]
884
+
885
+ def _ELS_C(self):
886
+ array_load = np.empty((0, 10))
887
+
888
+ for index_load, load in self._model_generator.get_all_loads().items():
889
+ for action in self.combiActionVariable:
890
+ if not action in ("Sx", "Ae"):
891
+
892
+ if load["Action"] == "Permanente G" and action == "G":
893
+ name = "ELS_C G"
894
+ self._create_list_combination(name)
895
+ array_load = self._create_array_load(
896
+ name, index_load, 1, load["Charge"], load, array_load
897
+ )
898
+
899
+ elif action != 0 and action != "G":
900
+ name = "ELS_C G + " + action
901
+ self._create_list_combination(name)
902
+
903
+ if (
904
+ load["Action"] != "Permanente G"
905
+ and self.DICO_COMBI_ACTION[load["Action"]] == action
906
+ ):
907
+ array_load = self._create_array_load(
908
+ name, index_load, 1, load["Charge"], load, array_load
909
+ )
910
+
911
+ elif load["Action"] == "Permanente G":
912
+ array_load = self._create_array_load(
913
+ name, index_load, 1, load["Charge"], load, array_load
914
+ )
915
+
916
+ for index in range(1, 4):
917
+ if (
918
+ action != self.combiActionVariable[index]
919
+ and action != "W-"
920
+ ):
921
+ # selon AN EC1 on ne doit pas combiner les charges d'entretien avec les charges de neige et de vent en toiture
922
+ if (
923
+ action == "Q"
924
+ or self.combiActionVariable[index] == "Q"
925
+ ) and self.cat == "Cat H : toits":
926
+ continue
927
+ key_psy = self._key_action_psy(
928
+ self.combiActionVariable[index]
929
+ )
930
+
931
+ if (
932
+ self.combiActionVariable[index] != 0
933
+ and float(self.coef_psy[key_psy]["psy0"]) != 0
934
+ ):
935
+ name = (
936
+ "ELS_C G + "
937
+ + action
938
+ + " + "
939
+ + str(round(self.coef_psy[key_psy]["psy0"], 2))
940
+ + self.combiActionVariable[index]
941
+ )
942
+ self._create_list_combination(name)
943
+
944
+ if load["Action"] == "Permanente G":
945
+ array_load = self._create_array_load(
946
+ name,
947
+ index_load,
948
+ 1,
949
+ load["Charge"],
950
+ load,
951
+ array_load,
952
+ )
953
+
954
+ elif (
955
+ self.DICO_COMBI_ACTION[load["Action"]]
956
+ == self.combiActionVariable[index]
957
+ ):
958
+ factor = float(self.coef_psy[key_psy]["psy0"])
959
+ value = self._calcs_combined_load(
960
+ factor, load["Charge"]
961
+ )
962
+ array_load = self._create_array_load(
963
+ name,
964
+ index_load,
965
+ factor,
966
+ value,
967
+ load,
968
+ array_load,
969
+ )
970
+
971
+ elif (
972
+ self.DICO_COMBI_ACTION[load["Action"]] == action
973
+ ):
974
+ array_load = self._create_array_load(
975
+ name,
976
+ index_load,
977
+ 1,
978
+ load["Charge"],
979
+ load,
980
+ array_load,
981
+ )
982
+
983
+ for index2 in range(1, 4):
984
+ if action != self.combiActionVariable[index2]:
985
+ if (
986
+ self.combiActionVariable[index]
987
+ != self.combiActionVariable[index2]
988
+ ):
989
+ if self.combiActionVariable.index(
990
+ self.combiActionVariable[index]
991
+ ) < self.combiActionVariable.index(
992
+ self.combiActionVariable[index2]
993
+ ):
994
+ if (
995
+ self.combiActionVariable[index2]
996
+ != 0
997
+ ):
998
+ key_psy2 = self._key_action_psy(
999
+ self.combiActionVariable[
1000
+ index2
1001
+ ]
1002
+ )
1003
+ name = (
1004
+ "ELS_C G + "
1005
+ + action
1006
+ + " + "
1007
+ + str(
1008
+ round(
1009
+ self.coef_psy[
1010
+ key_psy
1011
+ ]["psy0"],
1012
+ 2,
1013
+ )
1014
+ )
1015
+ + self.combiActionVariable[
1016
+ index
1017
+ ]
1018
+ + " + "
1019
+ + str(
1020
+ round(
1021
+ self.coef_psy[
1022
+ key_psy2
1023
+ ]["psy0"],
1024
+ 2,
1025
+ )
1026
+ )
1027
+ + self.combiActionVariable[
1028
+ index2
1029
+ ]
1030
+ )
1031
+ self._create_list_combination(
1032
+ name
1033
+ )
1034
+
1035
+ if (
1036
+ load["Action"]
1037
+ == "Permanente G"
1038
+ ):
1039
+ array_load = (
1040
+ self._create_array_load(
1041
+ name,
1042
+ index_load,
1043
+ 1,
1044
+ load["Charge"],
1045
+ load,
1046
+ array_load,
1047
+ )
1048
+ )
1049
+
1050
+ elif (
1051
+ self.DICO_COMBI_ACTION[
1052
+ load["Action"]
1053
+ ]
1054
+ == self.combiActionVariable[
1055
+ index2
1056
+ ]
1057
+ ):
1058
+ factor = float(
1059
+ self.coef_psy[key_psy2][
1060
+ "psy0"
1061
+ ]
1062
+ )
1063
+ value = self._calcs_combined_load(
1064
+ factor, load["Charge"]
1065
+ )
1066
+ array_load = (
1067
+ self._create_array_load(
1068
+ name,
1069
+ index_load,
1070
+ factor,
1071
+ value,
1072
+ load,
1073
+ array_load,
1074
+ )
1075
+ )
1076
+
1077
+ elif (
1078
+ self.DICO_COMBI_ACTION[
1079
+ load["Action"]
1080
+ ]
1081
+ == self.combiActionVariable[
1082
+ index
1083
+ ]
1084
+ ):
1085
+ factor = float(
1086
+ self.coef_psy[key_psy][
1087
+ "psy0"
1088
+ ]
1089
+ )
1090
+ value = self._calcs_combined_load(
1091
+ factor, load["Charge"]
1092
+ )
1093
+ array_load = (
1094
+ self._create_array_load(
1095
+ name,
1096
+ index_load,
1097
+ factor,
1098
+ value,
1099
+ load,
1100
+ array_load,
1101
+ )
1102
+ )
1103
+
1104
+ elif (
1105
+ self.DICO_COMBI_ACTION[
1106
+ load["Action"]
1107
+ ]
1108
+ == action
1109
+ ):
1110
+ value = load["Charge"]
1111
+ array_load = (
1112
+ self._create_array_load(
1113
+ name,
1114
+ index_load,
1115
+ 1,
1116
+ load["Charge"],
1117
+ load,
1118
+ array_load,
1119
+ )
1120
+ )
1121
+
1122
+ array_load = array_load[array_load[:, 0].argsort()]
1123
+ self._df_load_ELScarac = self._create_dataframe_load(array_load)
1124
+ self._create_analyze_type("ELS_C", self._df_load_ELScarac)
1125
+
1126
+ def get_ELS_C_loads(self):
1127
+ """Retourne les charges des combinaisons ELS CARACTERISTIQUE"""
1128
+ return self._df_load_ELScarac
1129
+
1130
+ def _return_combi_ELScarac(self, combi):
1131
+ return self._df_load_ELScarac.loc[self._df_load_ELScarac["Combinaison"] == combi]
1132
+
1133
+ def _ELS_QP(self):
1134
+ array_load = np.empty((0, 10))
1135
+
1136
+ for index_load, load in self._model_generator.get_all_loads().items():
1137
+ for action in self.combiActionVariable:
1138
+
1139
+ if load["Action"] == "Permanente G" and action == "G":
1140
+ name = "ELS_QP G"
1141
+ self._create_list_combination(name)
1142
+ array_load = self._create_array_load(
1143
+ name, index_load, 1, load["Charge"], load, array_load
1144
+ )
1145
+
1146
+ elif action != 0 and action != "G":
1147
+
1148
+ key_psy = self._key_action_psy(action)
1149
+ if float(self.coef_psy[key_psy]["psy2"]) != 0:
1150
+ name = (
1151
+ "ELS_QP G + "
1152
+ + str(round(self.coef_psy[key_psy]["psy2"], 2))
1153
+ + action
1154
+ )
1155
+ self._create_list_combination(name)
1156
+
1157
+ if (
1158
+ load["Action"] != "Permanente G"
1159
+ and self.DICO_COMBI_ACTION[load["Action"]] == action
1160
+ ):
1161
+ factor = float(self.coef_psy[key_psy]["psy2"])
1162
+ value = self._calcs_combined_load(factor, load["Charge"])
1163
+ array_load = self._create_array_load(
1164
+ name, index_load, factor, value, load, array_load
1165
+ )
1166
+
1167
+ elif load["Action"] == "Permanente G":
1168
+ array_load = self._create_array_load(
1169
+ name, index_load, 1, load["Charge"], load, array_load
1170
+ )
1171
+
1172
+ for index in range(1, 4):
1173
+ if (
1174
+ action != self.combiActionVariable[index]
1175
+ and action != "W-"
1176
+ ):
1177
+ if self.combiActionVariable.index(
1178
+ action
1179
+ ) < self.combiActionVariable.index(
1180
+ self.combiActionVariable[index]
1181
+ ):
1182
+ if self.combiActionVariable[index] != 0:
1183
+ key_psy1 = self._key_action_psy(
1184
+ self.combiActionVariable[index]
1185
+ )
1186
+ if float(self.coef_psy[key_psy1]["psy2"]) != 0:
1187
+ name = (
1188
+ "ELS_QP G + "
1189
+ + str(
1190
+ round(
1191
+ self.coef_psy[key_psy]["psy2"],
1192
+ 2,
1193
+ )
1194
+ )
1195
+ + action
1196
+ + " + "
1197
+ + str(
1198
+ round(
1199
+ self.coef_psy[key_psy1]["psy2"],
1200
+ 2,
1201
+ )
1202
+ )
1203
+ + self.combiActionVariable[index]
1204
+ )
1205
+ self._create_list_combination(name)
1206
+ if load["Action"] == "Permanente G":
1207
+ array_load = self._create_array_load(
1208
+ name,
1209
+ index_load,
1210
+ 1,
1211
+ load["Charge"],
1212
+ load,
1213
+ array_load,
1214
+ )
1215
+
1216
+ elif (
1217
+ self.DICO_COMBI_ACTION[load["Action"]]
1218
+ == self.combiActionVariable[index]
1219
+ ):
1220
+ factor = float(
1221
+ self.coef_psy[key_psy1]["psy2"]
1222
+ )
1223
+ value = self._calcs_combined_load(
1224
+ factor, load["Charge"]
1225
+ )
1226
+ array_load = self._create_array_load(
1227
+ name,
1228
+ index_load,
1229
+ factor,
1230
+ value,
1231
+ load,
1232
+ array_load,
1233
+ )
1234
+
1235
+ elif (
1236
+ self.DICO_COMBI_ACTION[load["Action"]]
1237
+ == action
1238
+ ):
1239
+ factor = float(
1240
+ self.coef_psy[key_psy]["psy2"]
1241
+ )
1242
+ value = self._calcs_combined_load(
1243
+ factor, load["Charge"]
1244
+ )
1245
+ array_load = self._create_array_load(
1246
+ name,
1247
+ index_load,
1248
+ factor,
1249
+ value,
1250
+ load,
1251
+ array_load,
1252
+ )
1253
+
1254
+ for index2 in range(1, 4):
1255
+ if (
1256
+ action
1257
+ != self.combiActionVariable[index2]
1258
+ ):
1259
+ if (
1260
+ self.combiActionVariable[index]
1261
+ != self.combiActionVariable[
1262
+ index2
1263
+ ]
1264
+ ):
1265
+ if self.combiActionVariable.index(
1266
+ self.combiActionVariable[
1267
+ index
1268
+ ]
1269
+ ) < self.combiActionVariable.index(
1270
+ self.combiActionVariable[
1271
+ index2
1272
+ ]
1273
+ ):
1274
+ if (
1275
+ self.combiActionVariable[
1276
+ index2
1277
+ ]
1278
+ != 0
1279
+ ):
1280
+ key_psy2 = self._key_action_psy(
1281
+ self.combiActionVariable[
1282
+ index2
1283
+ ]
1284
+ )
1285
+ if (
1286
+ float(
1287
+ self.coef_psy[
1288
+ key_psy2
1289
+ ]["psy2"]
1290
+ )
1291
+ != 0
1292
+ ):
1293
+ name = (
1294
+ "ELS_QP G + "
1295
+ + action
1296
+ + " + "
1297
+ + str(
1298
+ round(
1299
+ self.coef_psy[
1300
+ key_psy1
1301
+ ][
1302
+ "psy2"
1303
+ ],
1304
+ 2,
1305
+ )
1306
+ )
1307
+ + self.combiActionVariable[
1308
+ index
1309
+ ]
1310
+ + " + "
1311
+ + str(
1312
+ round(
1313
+ self.coef_psy[
1314
+ key_psy2
1315
+ ][
1316
+ "psy2"
1317
+ ],
1318
+ 2,
1319
+ )
1320
+ )
1321
+ + self.combiActionVariable[
1322
+ index2
1323
+ ]
1324
+ )
1325
+ self._create_list_combination(
1326
+ name
1327
+ )
1328
+
1329
+ if (
1330
+ load["Action"]
1331
+ == "Permanente G"
1332
+ ):
1333
+ array_load = self._create_array_load(
1334
+ name,
1335
+ index_load,
1336
+ 1,
1337
+ load[
1338
+ "Charge"
1339
+ ],
1340
+ load,
1341
+ array_load,
1342
+ )
1343
+
1344
+ elif (
1345
+ self.DICO_COMBI_ACTION[
1346
+ load[
1347
+ "Action"
1348
+ ]
1349
+ ]
1350
+ == self.combiActionVariable[
1351
+ index2
1352
+ ]
1353
+ ):
1354
+ factor = float(
1355
+ self.coef_psy[
1356
+ key_psy2
1357
+ ][
1358
+ "psy2"
1359
+ ]
1360
+ )
1361
+ value = self._calcs_combined_load(
1362
+ factor,
1363
+ load[
1364
+ "Charge"
1365
+ ],
1366
+ )
1367
+ array_load = self._create_array_load(
1368
+ name,
1369
+ index_load,
1370
+ factor,
1371
+ value,
1372
+ load,
1373
+ array_load,
1374
+ )
1375
+
1376
+ elif (
1377
+ self.DICO_COMBI_ACTION[
1378
+ load[
1379
+ "Action"
1380
+ ]
1381
+ ]
1382
+ == self.combiActionVariable[
1383
+ index
1384
+ ]
1385
+ ):
1386
+ factor = float(
1387
+ self.coef_psy[
1388
+ key_psy1
1389
+ ][
1390
+ "psy2"
1391
+ ]
1392
+ )
1393
+ value = self._calcs_combined_load(
1394
+ factor,
1395
+ load[
1396
+ "Charge"
1397
+ ],
1398
+ )
1399
+ array_load = self._create_array_load(
1400
+ name,
1401
+ index_load,
1402
+ factor,
1403
+ value,
1404
+ load,
1405
+ array_load,
1406
+ )
1407
+
1408
+ elif (
1409
+ self.DICO_COMBI_ACTION[
1410
+ load[
1411
+ "Action"
1412
+ ]
1413
+ ]
1414
+ == action
1415
+ ):
1416
+ factor = float(
1417
+ self.coef_psy[
1418
+ key_psy
1419
+ ][
1420
+ "psy2"
1421
+ ]
1422
+ )
1423
+ value = self._calcs_combined_load(
1424
+ factor,
1425
+ load[
1426
+ "Charge"
1427
+ ],
1428
+ )
1429
+ array_load = self._create_array_load(
1430
+ name,
1431
+ index_load,
1432
+ factor,
1433
+ value,
1434
+ load,
1435
+ array_load,
1436
+ )
1437
+
1438
+ array_load = array_load[array_load[:, 0].argsort()]
1439
+ self._df_load_ELSqp = self._create_dataframe_load(array_load)
1440
+ self._create_analyze_type("ELS_QP", self._df_load_ELSqp)
1441
+
1442
+ def get_ELS_QP_loads(self):
1443
+ """Retourne les charges des combinaisons ELS Quasi Permanente"""
1444
+ return self._df_load_ELSqp
1445
+
1446
+ def _return_combi_ELSqp(self, combi):
1447
+ return self._df_load_ELSqp.loc[self._df_load_ELSqp["Combinaison"] == combi]
1448
+
1449
+ def get_psy_2_by_combination(self, name: str):
1450
+ """Récupère le psy 2 en fonction de l'action la plus défavorable soit le psy2 le plus élevé
1451
+
1452
+ Args:
1453
+ name (str): nom de la combinaison
1454
+ """
1455
+ match self.type_psy_2:
1456
+ case "Court terme":
1457
+ psy_2 = 0
1458
+ case "Long terme":
1459
+ psy_2 = 1
1460
+ case _:
1461
+ psy_2 = 0
1462
+ if name[0:6] == "ELS_QP":
1463
+ for action in ["Q", "S"]:
1464
+ try:
1465
+ if name[8:].index(action):
1466
+ key_psy = self._key_action_psy(action)
1467
+ psy_2 = max(psy_2, self.coef_psy[key_psy]["psy2"])
1468
+ except ValueError:
1469
+ pass
1470
+ return psy_2
1471
+
1472
+ def _els_fleche_bois(self, kdef: float):
1473
+ """Génère l'association des combinaisons ELS caractéristique + quasi permanente (fluage, intégrant le Kdef) pour le calcul d'un élément en bois."""
1474
+
1475
+ if self.els_C:
1476
+ self._combo_tags.append("W_inst_Q")
1477
+ # On détermine W_inst(Q), pour cela on enlève W_inst_G
1478
+ self._df_W_inst_Q = self._df_load_ELScarac[
1479
+ self._df_load_ELScarac["Action"] != "Permanente G"
1480
+ ]
1481
+ for index in range(self._df_W_inst_Q.shape[0]):
1482
+ name = self._df_W_inst_Q.iloc[index, 0]
1483
+ name_combi = "W_inst " + name[10:]
1484
+ self._df_W_inst_Q.iloc[index, 0] = name_combi
1485
+ self._create_list_combination(name_combi)
1486
+ self._create_analyze_type("W_inst_Q", self._df_W_inst_Q)
1487
+ # print(self._df_W_inst_Q)
1488
+
1489
+ if self.els_QP:
1490
+ self._combo_tags.append("W_net_fin")
1491
+ combi_qp = {}
1492
+ combi_c = {}
1493
+ value_search = ["Q", "S"]
1494
+
1495
+ for name in self._name_combination:
1496
+ if name[0:6] == "ELS_QP":
1497
+ typeQP = [0] * 2
1498
+ for i in range(len(value_search)):
1499
+ try:
1500
+ if name[8:].index(value_search[i]):
1501
+ typeQP[i] = value_search[i]
1502
+ except ValueError:
1503
+ pass
1504
+ combi_qp[name] = typeQP
1505
+
1506
+ elif name[0:5] == "ELS_C":
1507
+ typeC = [0] * 2
1508
+ for i in range(len(value_search)):
1509
+ try:
1510
+ if name[7:].index(value_search[i]):
1511
+ if (
1512
+ value_search[i] == "Q"
1513
+ and self.cat == "Cat H : toits"
1514
+ ):
1515
+ pass
1516
+ elif (
1517
+ value_search[i] == "S"
1518
+ and self.alt.value <= 1000
1519
+ ):
1520
+ pass
1521
+ else:
1522
+ typeC[i] = value_search[i]
1523
+ except ValueError:
1524
+ pass
1525
+ combi_c[name] = typeC
1526
+
1527
+ list_of_key = list(combi_qp.keys())
1528
+ list_of_value = list(combi_qp.values())
1529
+
1530
+ array_load = np.empty((0, 10))
1531
+ for name_combi_C, val in combi_c.items():
1532
+ position = list_of_value.index(val)
1533
+ name_combi_QP = list_of_key[position]
1534
+ name_combi = "W_net_fin " + name_combi_C + " & " + name_combi_QP
1535
+ psy_2 = self.get_psy_2_by_combination(name_combi_QP)
1536
+
1537
+ df_c = self._df_load_ELScarac[
1538
+ self._df_load_ELScarac["Combinaison"] == name_combi_C
1539
+ ]
1540
+ df_qp = self._df_load_ELSqp[
1541
+ self._df_load_ELSqp["Combinaison"] == name_combi_QP
1542
+ ]
1543
+ for index in range(df_c.shape[0]):
1544
+ index_c = df_c.iloc[index, 1]
1545
+ beam_number = df_c.iloc[index, 2]
1546
+ name_load = df_c.iloc[index, 3]
1547
+ action_load = df_c.iloc[index, 4]
1548
+ type_load = df_c.iloc[index, 5]
1549
+ factor_c = df_c.iloc[index, 6]
1550
+ valeur_c = df_c.iloc[index, 7]
1551
+ position = df_c.iloc[index, 8]
1552
+ axe = df_c.iloc[index, 9]
1553
+ if len(df_qp[df_qp["Index"] == index_c]):
1554
+ # On multiplie les combinaisons quasi permanente par Kdef pour trouver Wcreep et par la formule 2.3.2.2 equ 2.7/2.10 pour modifier artificiellement E,mean en E,mean,fin
1555
+ factor_kdef = (1 + kdef * psy_2) * kdef
1556
+ factor_qp = df_qp[df_qp["Index"] == index_c].iloc[0, 6]
1557
+ total_factor = factor_c + factor_kdef * factor_qp
1558
+ if type_load == "Distribuée":
1559
+ valeur = {"start": 0, "end": 0}
1560
+ for pos, load in df_qp[df_qp["Index"] == index_c].iloc[0, 7].items():
1561
+ valeur_qp = load * factor_kdef
1562
+ valeur[pos] += (valeur_qp + valeur_c[pos])
1563
+
1564
+ else:
1565
+ valeur_qp = (
1566
+ df_qp[df_qp["Index"] == index_c].iloc[0, 7]
1567
+ * factor_kdef
1568
+ )
1569
+ valeur = valeur_c + valeur_qp
1570
+
1571
+ else:
1572
+ valeur = valeur_c
1573
+ total_factor = factor_c
1574
+ load = np.array(
1575
+ [
1576
+ name_combi,
1577
+ index_c,
1578
+ beam_number,
1579
+ name_load,
1580
+ action_load,
1581
+ type_load,
1582
+ total_factor,
1583
+ valeur,
1584
+ position,
1585
+ axe,
1586
+ ],
1587
+ dtype=object,
1588
+ )
1589
+ array_load = np.append(array_load, [load], axis=0)
1590
+ self._create_list_combination(name_combi)
1591
+
1592
+ array_load = array_load[array_load[:, 0].argsort()]
1593
+ self._df_W_net_fin = self._create_dataframe_load(array_load)
1594
+ self._create_analyze_type("W_net_fin", self._df_W_net_fin)
1595
+ # print(self._df_W_net_fin)
1596
+
1597
+ def get_W_inst_Q_loads(self):
1598
+ """Retourne les charges des combinaisons Winst (Q)"""
1599
+ if hasattr(self, "_df_W_inst_Q"):
1600
+ return self._df_W_inst_Q
1601
+ return None
1602
+
1603
+ def _return_combi_W_inst_Q(self, combi):
1604
+ return self._df_W_inst_Q.loc[self._df_W_inst_Q["Combinaison"] == combi]
1605
+
1606
+ def get_W_net_fin_loads(self):
1607
+ """Retourne les charges des combinaisons Wnet fin"""
1608
+ if hasattr(self, "_df_W_net_fin"):
1609
+ return self._df_W_net_fin
1610
+ return None
1611
+
1612
+ def _return_combi_W_net_fin(self, combi):
1613
+ return self._df_W_net_fin.loc[self._df_W_net_fin["Combinaison"] == combi]
1614
+
1615
+ @property
1616
+ def list_combination(self):
1617
+ """Retourne un data frame avec toute les combinaison créer"""
1618
+ self._name_combination.sort()
1619
+ return pd.DataFrame(self._name_combination, columns=["Combinaison"])
1620
+
1621
+ def get_list_combination(self, type: str=("Toutes", "ELU_ALL", "ELU_STR", "ELU_STR_ACC", "ELS_ALL", "ELS_C", "ELS_QP", "W")):
1622
+ """Retourne la liste des combinaisons pour le type sélectionné.
1623
+
1624
+ Args:
1625
+ type (str): Le type de combinaison à retourner. Defaults to ("Toutes", "ELU_ALL", "ELU_STR", "ELU_STR_ACC", "ELS_ALL", "ELS_C", "ELS_QP", "Flèche bois").
1626
+
1627
+ Returns:
1628
+ list: Liste des combinaisons
1629
+ """
1630
+ match type:
1631
+ case "Toutes":
1632
+ return self._name_combination
1633
+ case "ELU_ALL":
1634
+ return [name for name in self._name_combination if name.startswith("ELU")]
1635
+ case "ELU_STR":
1636
+ return [name for name in self._name_combination if name.startswith("ELU_STR ")]
1637
+ case "ELU_STR_ACC":
1638
+ return [name for name in self._name_combination if name.startswith("ELU_STR_ACC")]
1639
+ case "ELS_ALL":
1640
+ return [name for name in self._name_combination if name.startswith(("ELS", "W"))]
1641
+ case "ELS_C":
1642
+ return [name for name in self._name_combination if name.startswith("ELS_C")]
1643
+ case "ELS_QP":
1644
+ return [name for name in self._name_combination if name.startswith("ELS_QP")]
1645
+ case "Flèche bois":
1646
+ return [name for name in self._name_combination if name.startswith("W")]
1647
+
1648
+ def _choice_combi_df(self):
1649
+ shape = len(self.list_combination)
1650
+ dict_load_combi = {}
1651
+
1652
+ for i in range(shape):
1653
+ combi = self.list_combination.iloc[i, 0]
1654
+
1655
+ if self.elu_STR_ACC and combi[0:11] == "ELU_STR_ACC":
1656
+ df_combi = self._return_combi_ELU_STR_ACC(combi)
1657
+
1658
+ elif self.elu_STR and combi[0:7] == "ELU_STR":
1659
+ df_combi = self._return_combi_ELUSTR(combi)
1660
+
1661
+ elif self.els_C and combi[0:5] == "ELS_C":
1662
+ df_combi = self._return_combi_ELScarac(combi)
1663
+
1664
+ elif self.els_QP and combi[0:6] == "ELS_QP":
1665
+ df_combi = self._return_combi_ELSqp(combi)
1666
+
1667
+ elif self.els_C and combi[0:6] == "W_inst":
1668
+ df_combi = self._return_combi_W_inst_Q(combi)
1669
+
1670
+ elif self.els_C and self.els_QP and combi[0:9] == "W_net_fin":
1671
+ df_combi = self._return_combi_W_net_fin(combi)
1672
+
1673
+ df_combi = df_combi.drop(labels=["Combinaison"], axis=1)
1674
+ load_list_combi = df_combi.values.tolist()
1675
+ dict_load_combi[combi] = load_list_combi
1676
+
1677
+ return dict_load_combi
1678
+
1679
+ def get_combi_list_load(self, nom: str):
1680
+ """Retourne la liste des charges combinées pour la combinaison sélectionné
1681
+
1682
+ Args:
1683
+ nom (str): nom de la combinaison à récupérer. Defaults to "Sélectionner tout".
1684
+ """
1685
+ self.list_loads = self._choice_combi_df()[nom]
1686
+ return self.list_loads
1687
+
1688
+ def _get_combi_factor_load(self, nom: str) -> dict:
1689
+ """Retourne la liste des facteurs de charge pour la combinaison sélectionné
1690
+
1691
+ Args:
1692
+ nom (str): nom des la combinaison à récupérer. Defaults to "Sélectionner tout".
1693
+ """
1694
+ self.list_loads = self.get_combi_list_load(nom)
1695
+ dict_loads = {}
1696
+ for load in self.list_loads:
1697
+ key_load = self.DICO_COMBI_ACTION[load[3]]
1698
+ dict_loads[key_load] = load[5]
1699
+ return dict_loads
1700
+
1701
+
1702
+ def min_type_load(self, name_combi: str) -> str:
1703
+ """Retourne le type de chargement de plus courte durée
1704
+
1705
+ Args:
1706
+ name_combi (str): Combinaison à analyser
1707
+ """
1708
+
1709
+ dictName = {
1710
+ "G": "Permanente",
1711
+ "Q": "Moyen terme",
1712
+ "Sn": "Court terme",
1713
+ "W+": "Instantanee",
1714
+ "W-": "Instantanee",
1715
+ "Sx": "Instantanee",
1716
+ "Ae": "Instantanee",
1717
+ }
1718
+ for action in self.combiActionVariable:
1719
+ if action:
1720
+ indexAction = name_combi[8:].find(action)
1721
+ if indexAction > -1:
1722
+ if action == "Sn" and self.alt.value >= 1000:
1723
+ name_load_type = dictName["Q"]
1724
+ elif action == "Sn" and self.cat == "Cat H : toits":
1725
+ name_load_type = dictName["Sn"]
1726
+ else:
1727
+ name_load_type = dictName[action]
1728
+ return name_load_type
1729
+
1730
+
1731
+ if __name__ == "__main__":
1732
+
1733
+ _dict_loads = [
1734
+ [1, "G", "Permanente G", -10, "0/4000", "Z"],
1735
+ [2, "", "Neige accidentelle Sx", -200, "0/6000", "Z"],
1736
+ [2, "", "Neige normale Sn", -200, "0/6000", "Z"],
1737
+ [3, "", "Exploitation Q", -100, 3610, "Z"],
1738
+ ]
1739
+ projet = Projet("AP", "6018.0", "", "", 73215, "France", 1200)
1740
+ chargement = Model_generator._from_parent_class(projet)
1741
+ chargement.create_load_by_list(_dict_loads)
1742
+ # "Cat A : habitation"
1743
+ # "Cat H : toits"
1744
+ c1 = Combinaison._from_parent_class(
1745
+ chargement,
1746
+ ELU_STR=True,
1747
+ ELU_STR_ACC=False,
1748
+ ELS_C=True,
1749
+ ELS_QP=True,
1750
+ cat="Cat H : toits",
1751
+ kdef=0.6,
1752
+ type_psy_2="Moyen terme",
1753
+ )
1754
+ rcombi = "ELS_QP G + 0.3Q"
1755
+ # print(c1._return_combi_ELUSTR(rcombi))
1756
+ print(pd.DataFrame(c1.coef_psy))
1757
+ # print(c1._df_load_ELScarac)
1758
+ # print(c1._df_load_ELSqp)
1759
+ # print(c1._df_W_inst_Q)
1760
+ # print(c1._df_load_ELU_STR_ACC)
1761
+
1762
+ print(c1.list_combination)
1763
+ print(c1.get_combi_list_load("ELU_STR 1.35G + 1.5Q"))