midas-civil 0.2.0__py3-none-any.whl → 0.2.2__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 midas-civil might be problematic. Click here for more details.
- midas_civil/_element.py +21 -4
- midas_civil/_load.py +32 -27
- midas_civil/_tendon.py +9 -10
- {midas_civil-0.2.0.dist-info → midas_civil-0.2.2.dist-info}/METADATA +1 -1
- {midas_civil-0.2.0.dist-info → midas_civil-0.2.2.dist-info}/RECORD +8 -8
- {midas_civil-0.2.0.dist-info → midas_civil-0.2.2.dist-info}/WHEEL +0 -0
- {midas_civil-0.2.0.dist-info → midas_civil-0.2.2.dist-info}/licenses/LICENSE +0 -0
- {midas_civil-0.2.0.dist-info → midas_civil-0.2.2.dist-info}/top_level.txt +0 -0
midas_civil/_element.py
CHANGED
|
@@ -231,7 +231,10 @@ class Element:
|
|
|
231
231
|
_ADD(self)
|
|
232
232
|
|
|
233
233
|
@staticmethod
|
|
234
|
-
def SDL(s_loc:list,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0): #CHANGE TO TUPLE
|
|
234
|
+
def SDL(s_loc:list|Node,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0): #CHANGE TO TUPLE
|
|
235
|
+
if isinstance(s_loc,Node):
|
|
236
|
+
s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
|
|
237
|
+
|
|
235
238
|
beam_nodes =[]
|
|
236
239
|
beam_obj = []
|
|
237
240
|
s_locc = np.array(s_loc)
|
|
@@ -251,7 +254,12 @@ class Element:
|
|
|
251
254
|
|
|
252
255
|
|
|
253
256
|
@staticmethod
|
|
254
|
-
def SE(s_loc:list,e_loc:list,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
|
|
257
|
+
def SE(s_loc:list|Node,e_loc:list|Node,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
|
|
258
|
+
if isinstance(s_loc,Node):
|
|
259
|
+
s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
|
|
260
|
+
if isinstance(e_loc,Node):
|
|
261
|
+
s_loc = (e_loc.X,e_loc.Y,e_loc.Z)
|
|
262
|
+
|
|
255
263
|
beam_nodes =[]
|
|
256
264
|
beam_obj = []
|
|
257
265
|
i_loc = np.linspace(s_loc,e_loc,n+1)
|
|
@@ -302,7 +310,10 @@ class Element:
|
|
|
302
310
|
_ADD(self)
|
|
303
311
|
|
|
304
312
|
@staticmethod
|
|
305
|
-
def SDL(s_loc:list,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
|
|
313
|
+
def SDL(s_loc:list|Node,dir:list,l:float,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
|
|
314
|
+
if isinstance(s_loc,Node):
|
|
315
|
+
s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
|
|
316
|
+
|
|
306
317
|
beam_nodes =[]
|
|
307
318
|
beam_obj =[]
|
|
308
319
|
s_locc = np.array(s_loc)
|
|
@@ -322,7 +333,13 @@ class Element:
|
|
|
322
333
|
|
|
323
334
|
|
|
324
335
|
@staticmethod
|
|
325
|
-
def SE(s_loc:list,e_loc:list,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
|
|
336
|
+
def SE(s_loc:list|Node,e_loc:list|Node,n:int=1,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0):
|
|
337
|
+
|
|
338
|
+
if isinstance(s_loc,Node):
|
|
339
|
+
s_loc = (s_loc.X,s_loc.Y,s_loc.Z)
|
|
340
|
+
if isinstance(e_loc,Node):
|
|
341
|
+
s_loc = (e_loc.X,e_loc.Y,e_loc.Z)
|
|
342
|
+
|
|
326
343
|
beam_nodes =[]
|
|
327
344
|
beam_obj = []
|
|
328
345
|
i_loc = np.linspace(s_loc,e_loc,n+1)
|
midas_civil/_load.py
CHANGED
|
@@ -420,45 +420,52 @@ class Load:
|
|
|
420
420
|
|
|
421
421
|
#20 Class to add Load to Mass:
|
|
422
422
|
class LoadToMass:
|
|
423
|
-
"""
|
|
424
|
-
|
|
423
|
+
"""
|
|
424
|
+
Creates load-to-mass conversion entries and converts them to JSON format.
|
|
425
|
+
|
|
426
|
+
Example:
|
|
427
|
+
Load.LoadToMass("Z", ["DL", "LL"], [1.0, 0.5])
|
|
428
|
+
|
|
429
|
+
Args:
|
|
430
|
+
dir (str):
|
|
431
|
+
Mass Direction - "X", "Y", "Z", "XY", "YZ", "XZ", "XYZ".
|
|
432
|
+
If invalid, defaults to "XYZ".
|
|
433
|
+
load_case (list | str):
|
|
434
|
+
List of load case names or a single case name as string.
|
|
435
|
+
load_factor (list | float, optional):
|
|
436
|
+
List of scale factors corresponding to `load_case`.
|
|
437
|
+
If None or shorter than `load_case`, remaining factors default to 1.0.
|
|
438
|
+
nodal_load (bool, optional):
|
|
439
|
+
Include nodal loads. Defaults to True.
|
|
440
|
+
beam_load (bool, optional):
|
|
441
|
+
Include beam loads. Defaults to True.
|
|
442
|
+
floor_load (bool, optional):
|
|
443
|
+
Include floor loads. Defaults to True.
|
|
444
|
+
pressure (bool, optional):
|
|
445
|
+
Include pressure loads. Defaults to True.
|
|
446
|
+
gravity (float, optional):
|
|
447
|
+
Gravity acceleration. Defaults to 9.806.
|
|
425
448
|
"""
|
|
426
449
|
data = []
|
|
427
450
|
|
|
428
451
|
def __init__(self, dir, load_case, load_factor=None, nodal_load=True, beam_load=True,
|
|
429
452
|
floor_load=True, pressure=True, gravity=9.806):
|
|
430
|
-
|
|
431
|
-
dir (str): Mass Direction - "X", "Y", "Z", "XY", "YZ", "XZ", "XYZ"
|
|
432
|
-
load_case (list): List of load case names
|
|
433
|
-
load_factor (list, optional): List of scale factors corresponding to load cases.
|
|
434
|
-
If None or shorter than load_case, remaining factors default to 1.0
|
|
435
|
-
nodal_load (bool): Include nodal loads. Defaults to True
|
|
436
|
-
beam_load (bool): Include beam loads. Defaults to True
|
|
437
|
-
floor_load (bool): Include floor loads. Defaults to True
|
|
438
|
-
pressure (bool): Include pressure loads. Defaults to True
|
|
439
|
-
gravity (float): Gravity acceleration. Defaults to 9.806
|
|
440
|
-
"""
|
|
441
|
-
|
|
442
|
-
# Validate direction
|
|
453
|
+
|
|
443
454
|
valid_directions = ["X", "Y", "Z", "XY", "YZ", "XZ", "XYZ"]
|
|
444
455
|
if dir not in valid_directions:
|
|
445
|
-
dir = "XYZ"
|
|
456
|
+
dir = "XYZ"
|
|
446
457
|
|
|
447
|
-
# Ensure load_case is a list
|
|
448
458
|
if not isinstance(load_case, list):
|
|
449
459
|
load_case = [load_case]
|
|
450
460
|
|
|
451
|
-
# Handle load_factor - ensure it matches load_case length
|
|
452
461
|
if load_factor is None:
|
|
453
462
|
load_factor = [1.0] * len(load_case)
|
|
454
463
|
elif not isinstance(load_factor, list):
|
|
455
464
|
load_factor = [load_factor]
|
|
456
465
|
|
|
457
|
-
# Pad load_factor with 1.0 if shorter than load_case
|
|
458
466
|
while len(load_factor) < len(load_case):
|
|
459
467
|
load_factor.append(1.0)
|
|
460
468
|
|
|
461
|
-
# Check if load cases exist - give warning if not
|
|
462
469
|
for case in load_case:
|
|
463
470
|
chk = 0
|
|
464
471
|
for i in Load_Case.cases:
|
|
@@ -482,8 +489,7 @@ class Load:
|
|
|
482
489
|
def json(cls):
|
|
483
490
|
json_data = {"Assign": {}}
|
|
484
491
|
|
|
485
|
-
for load_obj in enumerate(cls.data):
|
|
486
|
-
# Create vLC array with load case names and factors
|
|
492
|
+
for idx, load_obj in enumerate(cls.data, start=1):
|
|
487
493
|
vlc_array = []
|
|
488
494
|
for i, case_name in enumerate(load_obj.LOAD_CASE):
|
|
489
495
|
vlc_array.append({
|
|
@@ -491,7 +497,7 @@ class Load:
|
|
|
491
497
|
"FACTOR": load_obj.LOAD_FACTOR[i]
|
|
492
498
|
})
|
|
493
499
|
|
|
494
|
-
json_data["Assign"][
|
|
500
|
+
json_data["Assign"][str(idx)] = {
|
|
495
501
|
"DIR": load_obj.DIR,
|
|
496
502
|
"bNODAL": load_obj.NODAL,
|
|
497
503
|
"bBEAM": load_obj.BEAM,
|
|
@@ -500,7 +506,7 @@ class Load:
|
|
|
500
506
|
"GRAV": load_obj.GRAVITY,
|
|
501
507
|
"vLC": vlc_array
|
|
502
508
|
}
|
|
503
|
-
|
|
509
|
+
|
|
504
510
|
return json_data
|
|
505
511
|
|
|
506
512
|
@classmethod
|
|
@@ -523,15 +529,13 @@ class Load:
|
|
|
523
529
|
|
|
524
530
|
if response != {'message': ''}:
|
|
525
531
|
for key, item_data in response.get('LTOM', {}).items():
|
|
526
|
-
# Extract load cases and factors from vLC array
|
|
527
532
|
load_cases = []
|
|
528
533
|
load_factors = []
|
|
529
534
|
|
|
530
|
-
for lc_item in item_data.get('vLC'):
|
|
535
|
+
for lc_item in item_data.get('vLC', []):
|
|
531
536
|
load_cases.append(lc_item.get('LCNAME'))
|
|
532
537
|
load_factors.append(lc_item.get('FACTOR'))
|
|
533
538
|
|
|
534
|
-
# Create LoadToMass object
|
|
535
539
|
Load.LoadToMass(
|
|
536
540
|
dir=item_data.get('DIR'),
|
|
537
541
|
load_case=load_cases,
|
|
@@ -543,6 +547,7 @@ class Load:
|
|
|
543
547
|
gravity=item_data.get('GRAV')
|
|
544
548
|
)
|
|
545
549
|
|
|
550
|
+
|
|
546
551
|
#-----------------------------------------------------------NodalMass-----------------
|
|
547
552
|
#21NodalMass
|
|
548
553
|
|
midas_civil/_tendon.py
CHANGED
|
@@ -201,7 +201,7 @@ class Tendon:
|
|
|
201
201
|
Tendon.Property.create()
|
|
202
202
|
if Tendon.Profile.profiles !=[]:
|
|
203
203
|
Tendon.Profile.create()
|
|
204
|
-
if Tendon.Prestress.
|
|
204
|
+
if Tendon.Prestress.loads !=[]:
|
|
205
205
|
Tendon.Prestress.create()
|
|
206
206
|
|
|
207
207
|
class Relaxation:
|
|
@@ -880,10 +880,9 @@ class Tendon:
|
|
|
880
880
|
|
|
881
881
|
|
|
882
882
|
class Prestress:
|
|
883
|
-
"""
|
|
884
|
-
Example: Load_Node(101, "LC1", "Group1", FZ = 10)
|
|
883
|
+
"""Prestress Loading for Tendons.
|
|
885
884
|
"""
|
|
886
|
-
|
|
885
|
+
loads = []
|
|
887
886
|
ids = []
|
|
888
887
|
def __init__(self, profile_name, load_case, load_group = "", prestress_type = "STRESS", jack_step = "BEGIN", jack_begin = 0, jack_end=0, grouting_stage = 0, id = 0):
|
|
889
888
|
|
|
@@ -904,7 +903,7 @@ class Tendon:
|
|
|
904
903
|
if jack_step not in ['BEGIN' , 'END' , 'BOTH']: jack_step = 'BEGIN'
|
|
905
904
|
|
|
906
905
|
self.TDN_ID = 0
|
|
907
|
-
if id == 0: id = len(Tendon.Prestress.
|
|
906
|
+
if id == 0: id = len(Tendon.Prestress.loads) + 1
|
|
908
907
|
self.ID = id
|
|
909
908
|
else:
|
|
910
909
|
self.TDN_ID = -id//100000
|
|
@@ -924,14 +923,14 @@ class Tendon:
|
|
|
924
923
|
|
|
925
924
|
|
|
926
925
|
|
|
927
|
-
Tendon.Prestress.
|
|
926
|
+
Tendon.Prestress.loads.append(self)
|
|
928
927
|
Tendon.Prestress.ids.append(self.ID)
|
|
929
928
|
|
|
930
929
|
|
|
931
930
|
@classmethod
|
|
932
931
|
def json(cls):
|
|
933
932
|
json = {"Assign": {}}
|
|
934
|
-
for self in cls.
|
|
933
|
+
for self in cls.loads:
|
|
935
934
|
|
|
936
935
|
# Finding Tendon ID
|
|
937
936
|
tdn_id = self.TDN_ID
|
|
@@ -943,7 +942,7 @@ class Tendon:
|
|
|
943
942
|
tdn_check=1
|
|
944
943
|
break
|
|
945
944
|
if not tdn_check:
|
|
946
|
-
print(f'⚠️ "{self.TDN_NAME}"
|
|
945
|
+
print(f'⚠️ "{self.TDN_NAME}" Tendon name is not found for Prestress load application. Prestress load skipped.\n📑 Try Tendon.Profile.sync() to retrieve Profile Names first')
|
|
947
946
|
continue
|
|
948
947
|
|
|
949
948
|
|
|
@@ -973,12 +972,12 @@ class Tendon:
|
|
|
973
972
|
|
|
974
973
|
@classmethod
|
|
975
974
|
def delete(cls):
|
|
976
|
-
cls.
|
|
975
|
+
cls.loads=[]
|
|
977
976
|
return MidasAPI("DELETE", "/db/TDPL")
|
|
978
977
|
|
|
979
978
|
@classmethod
|
|
980
979
|
def sync(cls):
|
|
981
|
-
cls.
|
|
980
|
+
cls.loads = []
|
|
982
981
|
a = cls.get()
|
|
983
982
|
if a != {'message': ''}:
|
|
984
983
|
for i in a['TDPL'].keys():
|
|
@@ -2,9 +2,9 @@ midas_civil/__init__.py,sha256=t0XkmZiEBYodUkU2gJWLQmqrpQdZc8ikPM3Z0xrSVPg,575
|
|
|
2
2
|
midas_civil/_boundary.py,sha256=s5mgZIc1b0-P7AdWuaPAQ5cIbHL5CR1YRKJA7KE4W_U,32958
|
|
3
3
|
midas_civil/_construction.py,sha256=q9C3gGdvky5t7jCDzd6lBRv6pm8cMycI91xfkgDV37Y,40673
|
|
4
4
|
midas_civil/_construction_backup.py,sha256=Pj7V-NYCkkT-aMjKXfs1jKa9klsGh48UXDLwn3BLYTY,18225
|
|
5
|
-
midas_civil/_element.py,sha256=
|
|
5
|
+
midas_civil/_element.py,sha256=hlH6NZfSBOrKQO7R22wZYbmLA20MB8rX7g_Td6G4mgo,27544
|
|
6
6
|
midas_civil/_group.py,sha256=9EsPGW8lWpzJBW25Gfd-G5S_9oP8ER3zNzeqknDsfmw,11480
|
|
7
|
-
midas_civil/_load.py,sha256=
|
|
7
|
+
midas_civil/_load.py,sha256=TltWAjDaeC5MNW8IIPKgpLahDQgJR3J6SzinkCrJS7A,30171
|
|
8
8
|
midas_civil/_mapi.py,sha256=Fabn3QX6OHJeV_s_01KMvOwkSye0kfgpiUUgPplAzxA,4597
|
|
9
9
|
midas_civil/_material.py,sha256=uJEIHJM9OhwTRWUI2mtd_0BQSxdlYhATYJu9P7tNNBA,69511
|
|
10
10
|
midas_civil/_model.py,sha256=G5Kh7u2DSodvKGQ0fOzAUx4Ilj8-rn-nGDTFeI6AkUU,16442
|
|
@@ -16,12 +16,12 @@ midas_civil/_result_extract.py,sha256=J-9eeWDbFeaDL-C41TAynYuooiHYsayAe3WbfGRO8s
|
|
|
16
16
|
midas_civil/_section.py,sha256=-mpGOYceus_dURE80lsGExSBDDpqDKqsNjBeOE3kZEM,36433
|
|
17
17
|
midas_civil/_settlement.py,sha256=U7lJYBqGbuCv7qziEEznDyA4M_SCjJeIjc0lDeGfE4Y,5125
|
|
18
18
|
midas_civil/_temperature.py,sha256=EfvivFWfxyM8yFCvWJgXLhaCofGwLKEBGFUuW8yHnfQ,24209
|
|
19
|
-
midas_civil/_tendon.py,sha256=
|
|
19
|
+
midas_civil/_tendon.py,sha256=mXNJeLikFsBpgn8u9fED2qx9oqnKh3XtIpYwp3moEfk,33395
|
|
20
20
|
midas_civil/_thickness.py,sha256=4xQsLA3Q_gIGCwLc_glFmiErdWdQUSwhlEhJ_IPJseA,3248
|
|
21
21
|
midas_civil/_utils.py,sha256=eymiqO8KaTKdhVY3saebqNS0BbUUmGmgw3-ELKqew0A,2611
|
|
22
22
|
midas_civil/_view.py,sha256=o7rkfoQzmgAb3dT0ujPIQLVwVlveo3rMRIbZU1UosZo,849
|
|
23
|
-
midas_civil-0.2.
|
|
24
|
-
midas_civil-0.2.
|
|
25
|
-
midas_civil-0.2.
|
|
26
|
-
midas_civil-0.2.
|
|
27
|
-
midas_civil-0.2.
|
|
23
|
+
midas_civil-0.2.2.dist-info/licenses/LICENSE,sha256=zrL4RwZC4rb-by_ZHKXwKdIwcs6ATy59TPZ9HxPHCrs,1071
|
|
24
|
+
midas_civil-0.2.2.dist-info/METADATA,sha256=Ldk52OFc0I1DjSkwvyPEG8c3YkBx166XfgYF8PiK8-U,1709
|
|
25
|
+
midas_civil-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
midas_civil-0.2.2.dist-info/top_level.txt,sha256=_NFmrlN5V9OxJ-PAO4s_om8OA8uupXho3QqZcSsnbuI,12
|
|
27
|
+
midas_civil-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|