midas-civil 1.4.1__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 (40) hide show
  1. midas_civil/_BoundaryChangeAssignment.py +278 -0
  2. midas_civil/__init__.py +51 -0
  3. midas_civil/_analysiscontrol.py +585 -0
  4. midas_civil/_boundary.py +888 -0
  5. midas_civil/_construction.py +1004 -0
  6. midas_civil/_element.py +1346 -0
  7. midas_civil/_group.py +337 -0
  8. midas_civil/_load.py +967 -0
  9. midas_civil/_loadcomb.py +159 -0
  10. midas_civil/_mapi.py +249 -0
  11. midas_civil/_material.py +1692 -0
  12. midas_civil/_model.py +522 -0
  13. midas_civil/_movingload.py +1479 -0
  14. midas_civil/_node.py +532 -0
  15. midas_civil/_result_table.py +929 -0
  16. midas_civil/_result_test.py +5455 -0
  17. midas_civil/_section/_TapdbSecSS.py +175 -0
  18. midas_civil/_section/__init__.py +413 -0
  19. midas_civil/_section/_compositeSS.py +283 -0
  20. midas_civil/_section/_dbSecSS.py +164 -0
  21. midas_civil/_section/_offsetSS.py +53 -0
  22. midas_civil/_section/_pscSS copy.py +455 -0
  23. midas_civil/_section/_pscSS.py +822 -0
  24. midas_civil/_section/_tapPSC12CellSS.py +565 -0
  25. midas_civil/_section/_unSupp.py +58 -0
  26. midas_civil/_settlement.py +161 -0
  27. midas_civil/_temperature.py +677 -0
  28. midas_civil/_tendon.py +1016 -0
  29. midas_civil/_thickness.py +147 -0
  30. midas_civil/_utils.py +529 -0
  31. midas_civil/_utilsFunc/__init__.py +0 -0
  32. midas_civil/_utilsFunc/_line2plate.py +636 -0
  33. midas_civil/_view.py +891 -0
  34. midas_civil/_view_trial.py +430 -0
  35. midas_civil/_visualise.py +347 -0
  36. midas_civil-1.4.1.dist-info/METADATA +74 -0
  37. midas_civil-1.4.1.dist-info/RECORD +40 -0
  38. midas_civil-1.4.1.dist-info/WHEEL +5 -0
  39. midas_civil-1.4.1.dist-info/licenses/LICENSE +21 -0
  40. midas_civil-1.4.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,161 @@
1
+ from ._mapi import MidasAPI
2
+
3
+ class Settlement:
4
+
5
+ @classmethod
6
+ def create(cls):
7
+ """Creates Settlement Load in MIDAS Civil NX"""
8
+ if cls.Group.data != []: cls.Group.create()
9
+ if cls.Case.data != []: cls.Case.create()
10
+
11
+ @classmethod
12
+ def delete(cls):
13
+ """Deletes Settlement load from MIDAS Civil NX and Python"""
14
+ cls.Group.delete()
15
+ cls.Case.delete()
16
+
17
+ @classmethod
18
+ def sync(cls):
19
+ """Sync Settlement load from MIDAS Civil NX to Python"""
20
+ cls.Group.sync()
21
+ cls.Case.sync()
22
+
23
+ class Group:
24
+ """
25
+ Parameters:
26
+ name: Settlement group name (string)
27
+ displacement: Settlement displacement value (number)
28
+ node_list: List of node IDs to include in the group (array of integers)
29
+ id: Group ID (optional, auto-generated if not provided)
30
+
31
+ Examples:
32
+ ```python
33
+ Settlement.Group("SG1", 0.025, [100, 101])
34
+ Settlement.Group("SG2", 0.015, [102, 103])
35
+ ```
36
+ """
37
+ data = []
38
+
39
+ def __init__(self, name, displacement, node_list, id=None):
40
+ if id == None: id =""
41
+ self.NAME = name
42
+ self.SETTLE = displacement
43
+ self.ITEMS = node_list
44
+ if id == "": id = len(Settlement.Group.data) + 1
45
+ self.ID = id
46
+
47
+ Settlement.Group.data.append(self)
48
+
49
+ @classmethod
50
+ def json(cls):
51
+ json = {"Assign": {}}
52
+ for i in cls.data:
53
+ json["Assign"][str(i.ID)] = {
54
+ "NAME": i.NAME,
55
+ "SETTLE": i.SETTLE,
56
+ "ITEMS": i.ITEMS
57
+ }
58
+ return json
59
+
60
+ @staticmethod
61
+ def create():
62
+ MidasAPI("PUT", "/db/smpt", Settlement.Group.json())
63
+
64
+ @staticmethod
65
+ def get():
66
+ return MidasAPI("GET", "/db/smpt")
67
+
68
+ @classmethod
69
+ def delete(cls):
70
+ cls.data = []
71
+ return MidasAPI("DELETE", "/db/smpt")
72
+
73
+ @classmethod
74
+ def sync(cls):
75
+ cls.data = []
76
+ a = cls.get()
77
+ if a != {'message': ''}:
78
+ for i in a['SMPT'].keys():
79
+ Settlement.Group(
80
+ a['SMPT'][i]['NAME'],
81
+ a['SMPT'][i]['SETTLE'],
82
+ a['SMPT'][i]['ITEMS'],
83
+ int(i)
84
+ )
85
+
86
+
87
+ class Case:
88
+ """
89
+
90
+ Parameters:
91
+ name: Settlement load case name (string)
92
+ settlement_groups: List of settlement group names to include (array of strings, default [])
93
+ factor: Settlement scale factor (number, default 1.0)
94
+ min_groups: Minimum number of settlement groups (integer, default 1)
95
+ max_groups: Maximum number of settlement groups (integer, default 1)
96
+ desc: Description of the settlement case (string, default "")
97
+ id: Case ID (optional, auto-generated if not provided)
98
+
99
+ Examples:
100
+ ```python
101
+ Settlement.Case("SMLC1", ["SG1"], 1.2, 1, 1, "Foundation Settlement Case")
102
+ Settlement.Case("SMLC2", ["SG1", "SG2"], 1.0, 1, 2, "Combined Settlement")
103
+ ```
104
+ """
105
+ data = []
106
+
107
+ def __init__(self, name, settlement_groups=[],factor=1.0, min_groups=1, max_groups=1, desc="", id=None):
108
+ if id == None: id =""
109
+ self.NAME = name
110
+ self.DESC = desc
111
+ self.FACTOR = factor
112
+ self.MIN = min_groups
113
+ self.MAX = max_groups
114
+ self.ST_GROUPS = settlement_groups
115
+ if id == "": id = len(Settlement.Case.data) + 1
116
+ self.ID = id
117
+
118
+ Settlement.Case.data.append(self)
119
+
120
+ @classmethod
121
+ def json(cls):
122
+ json = {"Assign": {}}
123
+ for i in cls.data:
124
+ json["Assign"][str(i.ID)] = {
125
+ "NAME": i.NAME,
126
+ "DESC": i.DESC,
127
+ "FACTOR": i.FACTOR,
128
+ "MIN": i.MIN,
129
+ "MAX": i.MAX,
130
+ "ST_GROUPS": i.ST_GROUPS
131
+ }
132
+ return json
133
+
134
+ @staticmethod
135
+ def create():
136
+ MidasAPI("PUT", "/db/smlc", Settlement.Case.json())
137
+
138
+ @staticmethod
139
+ def get():
140
+ return MidasAPI("GET", "/db/smlc")
141
+
142
+ @classmethod
143
+ def delete(cls):
144
+ cls.data = []
145
+ return MidasAPI("DELETE", "/db/smlc")
146
+
147
+ @classmethod
148
+ def sync(cls):
149
+ cls.data = []
150
+ a = cls.get()
151
+ if a != {'message': ''}:
152
+ for i in a['SMLC'].keys():
153
+ Settlement.Case(
154
+ a['SMLC'][i]['NAME'],
155
+ a['SMLC'][i]['DESC'],
156
+ a['SMLC'][i]['FACTOR'],
157
+ a['SMLC'][i]['MIN'],
158
+ a['SMLC'][i]['MAX'],
159
+ a['SMLC'][i]['ST_GROUPS'],
160
+ int(i)
161
+ )