midas-civil 1.0.9__tar.gz → 1.1.0__tar.gz
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-1.0.9 → midas_civil-1.1.0}/PKG-INFO +2 -1
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/__init__.py +1 -1
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_element.py +6 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_mapi.py +8 -1
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_material.py +4 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_node.py +7 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_result_extract.py +57 -3
- midas_civil-1.1.0/midas_civil/_section/_TapdbSecSS.py +175 -0
- midas_civil-1.1.0/midas_civil/_section/_dbSecSS.py +164 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_section/_pscSS.py +30 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_thickness.py +5 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil.egg-info/PKG-INFO +2 -1
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil.egg-info/requires.txt +1 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/setup.py +3 -2
- midas_civil-1.0.9/midas_civil/_section/_TapdbSecSS.py +0 -47
- midas_civil-1.0.9/midas_civil/_section/_dbSecSS.py +0 -57
- {midas_civil-1.0.9 → midas_civil-1.1.0}/LICENSE +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/README.md +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_BoundaryChangeAssignment.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_analysiscontrol.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_boundary.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_construction.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_construction_backup.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_group.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_load.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_model.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_movingload.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_result copy.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_result.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_section/__init__.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_section/_compositeSS.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_section/_offsetSS.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_section/_tapPSC1CellSS.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_section/_unSupp.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_settlement.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_temperature.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_tendon.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_utils.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil/_view.py +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil.egg-info/SOURCES.txt +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil.egg-info/dependency_links.txt +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/midas_civil.egg-info/top_level.txt +0 -0
- {midas_civil-1.0.9 → midas_civil-1.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: midas_civil
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Python library for MIDAS Civil NX
|
|
5
5
|
Home-page: https://github.com/MIDASIT-Co-Ltd/midas-civil-python
|
|
6
6
|
Author: Sumit Shekhar
|
|
@@ -14,6 +14,7 @@ Requires-Dist: polars
|
|
|
14
14
|
Requires-Dist: xlsxwriter
|
|
15
15
|
Requires-Dist: requests
|
|
16
16
|
Requires-Dist: scipy
|
|
17
|
+
Requires-Dist: colorama
|
|
17
18
|
Dynamic: author
|
|
18
19
|
Dynamic: author-email
|
|
19
20
|
Dynamic: description
|
|
@@ -352,6 +352,12 @@ class Element:
|
|
|
352
352
|
Element.elements = []
|
|
353
353
|
Element.ids = []
|
|
354
354
|
Element.__elemDIC__={}
|
|
355
|
+
|
|
356
|
+
@staticmethod
|
|
357
|
+
def clear():
|
|
358
|
+
Element.elements = []
|
|
359
|
+
Element.ids = []
|
|
360
|
+
Element.__elemDIC__={}
|
|
355
361
|
|
|
356
362
|
# --- Element Type Subclasses ---
|
|
357
363
|
|
|
@@ -3,6 +3,7 @@ import sys
|
|
|
3
3
|
from colorama import Fore, Style
|
|
4
4
|
try:import winreg
|
|
5
5
|
except: pass
|
|
6
|
+
import time
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -124,6 +125,9 @@ def MidasAPI(method:str, command:str, body:dict={})->dict:
|
|
|
124
125
|
"MAPI-Key": mapi_key
|
|
125
126
|
}
|
|
126
127
|
|
|
128
|
+
start_time = time.perf_counter()
|
|
129
|
+
|
|
130
|
+
|
|
127
131
|
if method == "POST":
|
|
128
132
|
response = requests.post(url=url, headers=headers, json=body)
|
|
129
133
|
elif method == "PUT":
|
|
@@ -133,8 +137,11 @@ def MidasAPI(method:str, command:str, body:dict={})->dict:
|
|
|
133
137
|
elif method == "DELETE":
|
|
134
138
|
response = requests.delete(url=url, headers=headers)
|
|
135
139
|
|
|
140
|
+
end_time = time.perf_counter()
|
|
141
|
+
elapsed_time = end_time - start_time
|
|
142
|
+
|
|
136
143
|
if NX.debug_print:
|
|
137
|
-
print(method
|
|
144
|
+
print(f"{method} | URL : {command} | STATUS : {response.status_code} | TIME : {elapsed_time:.4f} sec")
|
|
138
145
|
|
|
139
146
|
|
|
140
147
|
|
|
@@ -135,7 +135,7 @@ class Result :
|
|
|
135
135
|
"TABLE_NAME": tableName,
|
|
136
136
|
"STYLES": {
|
|
137
137
|
"FORMAT": "Fixed",
|
|
138
|
-
"PLACE":
|
|
138
|
+
"PLACE": 5
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -162,7 +162,7 @@ class Result :
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
# ---------- Result TABLE ------------------------------
|
|
165
|
+
# ---------- Result TABLE (For ALL TABLES)------------------------------
|
|
166
166
|
@staticmethod
|
|
167
167
|
def ResultTable(tabletype:str,keys=[],loadcase:list=[],cs_stage=[],force_unit='KN',len_unit='M'):
|
|
168
168
|
'''
|
|
@@ -177,7 +177,7 @@ class Result :
|
|
|
177
177
|
"TABLE_TYPE": tabletype,
|
|
178
178
|
"STYLES": {
|
|
179
179
|
"FORMAT": "Fixed",
|
|
180
|
-
"PLACE":
|
|
180
|
+
"PLACE": 5
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -204,3 +204,57 @@ class Result :
|
|
|
204
204
|
ss_json = MidasAPI("POST","/post/table",js_dat)
|
|
205
205
|
_setUNIT(currUNIT)
|
|
206
206
|
return _JSToDF_ResTable(ss_json)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class TABLE :
|
|
210
|
+
@staticmethod
|
|
211
|
+
def BeamForce_VBM(keys=[],loadcase:list=[],items=['all'],parts=["PartI", "PartJ"],components=['all'],force_unit='KN',len_unit='M'):
|
|
212
|
+
'''
|
|
213
|
+
Keys : List{int} -> Element/ Node IDs | str -> Structure Group Name
|
|
214
|
+
Loadcase : Loadcase name followed by type. eg. DeadLoad(ST)
|
|
215
|
+
Items to display : [ "Axial" , "Shear-y" , "Shear-z" , "Torsion" , "Moment-y" , "Moment-z"]
|
|
216
|
+
Parts : ["PartI", "Part1/4", "Part2/4", "Part3/4", "PartJ"]
|
|
217
|
+
Components (colms of tabulart result): [ "Elem", "Load", "Part", "Component", "Axial", "Shear-y", "Shear-z", "Torsion", "Moment-y", "Moment-z" ]
|
|
218
|
+
|
|
219
|
+
'''
|
|
220
|
+
|
|
221
|
+
js_dat = {
|
|
222
|
+
"Argument": {
|
|
223
|
+
"TABLE_NAME": "SS_Table",
|
|
224
|
+
"TABLE_TYPE": "BEAMFORCEVBM",
|
|
225
|
+
"STYLES": {
|
|
226
|
+
"FORMAT": "Fixed",
|
|
227
|
+
"PLACE": 5
|
|
228
|
+
},
|
|
229
|
+
"PARTS" : parts
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
if isinstance(keys,list):
|
|
235
|
+
if keys!=[]:
|
|
236
|
+
js_dat["Argument"]['NODE_ELEMS'] = {"KEYS": keys}
|
|
237
|
+
elif isinstance(keys,str):
|
|
238
|
+
js_dat["Argument"]['NODE_ELEMS'] = {"STRUCTURE_GROUP_NAME": keys}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
if loadcase!=[]: js_dat["Argument"]['LOAD_CASE_NAMES'] = loadcase
|
|
242
|
+
|
|
243
|
+
if components!=['all']:
|
|
244
|
+
if "Elem" not in components: components.append("Elem")
|
|
245
|
+
if "Load" not in components: components.append("Load")
|
|
246
|
+
if "Part" not in components: components.append("Part")
|
|
247
|
+
if "Component" not in components: components.append("Component")
|
|
248
|
+
js_dat["Argument"]['COMPONENTS'] = components
|
|
249
|
+
|
|
250
|
+
if items!=['all']:
|
|
251
|
+
js_dat["Argument"]['ITEM_TO_DISPLAY'] = items
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
currUNIT = _getUNIT()
|
|
256
|
+
Model.units(force=force_unit,length=len_unit)
|
|
257
|
+
ss_json = MidasAPI("POST","/post/table",js_dat)
|
|
258
|
+
_setUNIT(currUNIT)
|
|
259
|
+
return _JSToDF_ResTable(ss_json)
|
|
260
|
+
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
from ._offsetSS import Offset
|
|
2
|
+
from ._offsetSS import _common
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
class _SS_TAPERED_DBUSER(_common):
|
|
6
|
+
|
|
7
|
+
""" Create Standard USER DEFINED sections"""
|
|
8
|
+
|
|
9
|
+
def __init__(self,Name='',Shape='',params_I:list=[],params_J:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
10
|
+
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
11
|
+
self.ID = id
|
|
12
|
+
self.NAME = Name
|
|
13
|
+
self.TYPE = 'TAPERED'
|
|
14
|
+
self.SHAPE = Shape
|
|
15
|
+
self.PARAMS_I = params_I
|
|
16
|
+
self.PARAMS_J = params_J
|
|
17
|
+
self.OFFSET = Offset
|
|
18
|
+
self.USESHEAR = useShear
|
|
19
|
+
self.USE7DOF = use7Dof
|
|
20
|
+
self.DATATYPE = 2
|
|
21
|
+
|
|
22
|
+
def __str__(self):
|
|
23
|
+
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def toJSON(sect):
|
|
27
|
+
js = {
|
|
28
|
+
"SECTTYPE": sect.TYPE,
|
|
29
|
+
"SECT_NAME": sect.NAME,
|
|
30
|
+
"SECT_BEFORE": {
|
|
31
|
+
"SHAPE": sect.SHAPE,
|
|
32
|
+
"TYPE": sect.DATATYPE,
|
|
33
|
+
"SECT_I": {
|
|
34
|
+
"vSIZE": sect.PARAMS_I
|
|
35
|
+
},
|
|
36
|
+
"SECT_J": {
|
|
37
|
+
"vSIZE": sect.PARAMS_J
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
42
|
+
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
43
|
+
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
44
|
+
return js
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
48
|
+
return _SS_TAPERED_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],js['SECT_BEFORE']['SECT_J']['vSIZE'],offset,uShear,u7DOF,id)
|
|
49
|
+
|
|
50
|
+
def _centerLine(shape,end):
|
|
51
|
+
if end:
|
|
52
|
+
shape.PARAMS = shape.PARAMS_J
|
|
53
|
+
# print(' J end taken')
|
|
54
|
+
else:
|
|
55
|
+
# print(' I end taken')
|
|
56
|
+
shape.PARAMS = shape.PARAMS_I
|
|
57
|
+
|
|
58
|
+
if shape.SHAPE == 'SB' :
|
|
59
|
+
H,B = shape.PARAMS[:2]
|
|
60
|
+
|
|
61
|
+
sect_lin_con = [[1,2],[3,1]]
|
|
62
|
+
|
|
63
|
+
sect_cg_LT = [-B/2,H/2]
|
|
64
|
+
sect_cg_CC = [0,0]
|
|
65
|
+
sect_cg_RB = [B/2,-H/2]
|
|
66
|
+
|
|
67
|
+
if H > B :
|
|
68
|
+
sect_shape = [[0,0],[0,H/2],[0,-H/2],[0,H/4],[0,-H/4]]
|
|
69
|
+
sect_thk = [B,B,B,B]
|
|
70
|
+
sect_thk_off = [0,0,0,0]
|
|
71
|
+
else :
|
|
72
|
+
sect_shape = [[0,0],[B/2,0],[-B/2,0],[B/4,0],[-B/4,0]]
|
|
73
|
+
sect_thk = [H,H,H,H]
|
|
74
|
+
sect_thk_off = [0,0,0,0]
|
|
75
|
+
|
|
76
|
+
elif shape.SHAPE == 'L' :
|
|
77
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
78
|
+
|
|
79
|
+
sect_cg_LT = [0,0]
|
|
80
|
+
sect_cg_CC = [(H*tw*tw+B*B*tf)/(2*(B*tw+H*tf)),-(H*H*tw+B*tf*tf)/(2*(B*tw+H*tf))]
|
|
81
|
+
sect_cg_RB = [B,-H]
|
|
82
|
+
|
|
83
|
+
# sect_shape = [[0.5*tw,-H],[0.5*tw,-0.5*tf],[B,-0.5*tf]]
|
|
84
|
+
sect_shape = [[0,-H],[0,0],[B,0]]
|
|
85
|
+
sect_lin_con = [[3,2],[2,1]]
|
|
86
|
+
sect_thk = [tw,tf]
|
|
87
|
+
# sect_thk_off = [0,0]
|
|
88
|
+
sect_thk_off = [tw/2,tf/2]
|
|
89
|
+
|
|
90
|
+
elif shape.SHAPE == 'C' :
|
|
91
|
+
H,B1,tw,tf1,B2,tf2 = shape.PARAMS[:6]
|
|
92
|
+
if B2 == 0 : B2 = B1
|
|
93
|
+
if tf2 == 0 : tf2 = tf1
|
|
94
|
+
|
|
95
|
+
sect_cg_LT = [0,0]
|
|
96
|
+
sect_cg_CC = [(B1+B2)*0.2,-H*0.5]
|
|
97
|
+
sect_cg_RB = [max(B1,B2),-H]
|
|
98
|
+
|
|
99
|
+
# sect_shape = [[0.5*tw,-0.5*tf1],[B1,-0.5*tf1],[0.5*tw,-H+0.5*tf2],[B2,-H+0.5*tf2]]
|
|
100
|
+
sect_shape = [[0,0],[B1,0],[0,-H],[B2,-H]]
|
|
101
|
+
sect_lin_con = [[2,1],[1,3],[3,4]]
|
|
102
|
+
sect_thk = [tf1,tw,tf2]
|
|
103
|
+
# sect_thk_off = [0,0,0]
|
|
104
|
+
sect_thk_off = [tf1/2,tw/2,tf2/2]
|
|
105
|
+
|
|
106
|
+
elif shape.SHAPE == 'H' :
|
|
107
|
+
H,B1,tw,tf1,B2,tf2,r1,r2 = shape.PARAMS[:8]
|
|
108
|
+
if B2 == 0 : B2 = B1
|
|
109
|
+
if tf2 == 0 : tf2 = tf1
|
|
110
|
+
|
|
111
|
+
sect_cg_LT = [-0.5*max(B1,B2),0.5*H]
|
|
112
|
+
sect_cg_CC = [0,0]
|
|
113
|
+
sect_cg_RB = [0.5*max(B1,B2),-0.5*H]
|
|
114
|
+
|
|
115
|
+
sect_shape = [[-0.5*B1,0.5*(H-tf1)],[0,0.5*(H-tf1)],[0.5*B1,0.5*(H-tf1)],[-0.5*B2,-0.5*(H-tf2)],[0,-0.5*(H-tf2)],[0.5*B2,-0.5*(H-tf2)]]
|
|
116
|
+
sect_lin_con = [[2,1],[3,2],[2,5],[4,5],[5,6]]
|
|
117
|
+
sect_thk = [tf1,tf1,tw,tf2,tf2]
|
|
118
|
+
sect_thk_off = [0,0,0,0,0]
|
|
119
|
+
|
|
120
|
+
elif shape.SHAPE == 'T' :
|
|
121
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
122
|
+
|
|
123
|
+
sect_cg_LT = [-B*0.5,0]
|
|
124
|
+
sect_cg_CC = [0,-H*0.3]
|
|
125
|
+
sect_cg_RB = [B*0.5,-H]
|
|
126
|
+
|
|
127
|
+
sect_shape = [[-0.5*B,-0.5*tf],[0,-0.5*tf],[0.5*B,-0.5*tf],[0,-H]]
|
|
128
|
+
sect_lin_con = [[2,1],[3,2],[2,4]]
|
|
129
|
+
sect_thk = [tf,tf,tw]
|
|
130
|
+
sect_thk_off = [0,0,0]
|
|
131
|
+
|
|
132
|
+
elif shape.SHAPE == 'B' :
|
|
133
|
+
H,B,tw,tf1,C,tf2 = shape.PARAMS[:6]
|
|
134
|
+
if tf2 == 0 : tf2 = tf1
|
|
135
|
+
|
|
136
|
+
sect_cg_LT = [-0.5*B,0.5*H]
|
|
137
|
+
sect_cg_CC = [0,0]
|
|
138
|
+
sect_cg_RB = [0.5*B,-0.5*H]
|
|
139
|
+
|
|
140
|
+
# sect_shape = [[0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),-0.5*(H-tf2)],[0.5*(B-tw),-0.5*(H-tf2)]]
|
|
141
|
+
sect_shape = [[0.5*B,0.5*H],[-0.5*B,0.5*H],[-0.5*B,-0.5*H],[0.5*B,-0.5*H]]
|
|
142
|
+
|
|
143
|
+
sect_lin_con = [[1,2],[2,3],[3,4],[4,1]]
|
|
144
|
+
sect_thk = [tf1,tw,tf2,tw]
|
|
145
|
+
# sect_thk_off = [0,0,0,0]
|
|
146
|
+
sect_thk_off = [0.5*tf1,0.5*tw,0.5*tf2,0.5*tw]
|
|
147
|
+
|
|
148
|
+
elif shape.SHAPE == 'P' :
|
|
149
|
+
D,tw = shape.PARAMS[:2]
|
|
150
|
+
|
|
151
|
+
# R = 0.5*(D-tw)
|
|
152
|
+
R = 0.5*D
|
|
153
|
+
|
|
154
|
+
sect_cg_LT = [-R,R]
|
|
155
|
+
sect_cg_CC = [0,0]
|
|
156
|
+
sect_cg_RB = [R,-R]
|
|
157
|
+
|
|
158
|
+
sect_shape = []
|
|
159
|
+
sect_lin_con = []
|
|
160
|
+
sect_thk = []
|
|
161
|
+
sect_thk_off = []
|
|
162
|
+
|
|
163
|
+
n = 16
|
|
164
|
+
for i in range(n):
|
|
165
|
+
sect_shape.append([R*math.sin(i*2*math.pi/n),R*math.cos(i*2*math.pi/n)])
|
|
166
|
+
sect_lin_con.append([i+1,i+2])
|
|
167
|
+
sect_thk.append(tw)
|
|
168
|
+
sect_thk_off.append(-0.5*tw)
|
|
169
|
+
sect_lin_con[-1] = [i+1,1]
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
|
|
174
|
+
|
|
175
|
+
return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
from ._offsetSS import Offset
|
|
2
|
+
from ._offsetSS import _common
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
class _SS_DBUSER(_common):
|
|
6
|
+
|
|
7
|
+
""" Create Standard USER DEFINED sections"""
|
|
8
|
+
|
|
9
|
+
def __init__(self,Name='',Shape='',parameters:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
10
|
+
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
11
|
+
self.ID = id
|
|
12
|
+
self.NAME = Name
|
|
13
|
+
self.TYPE = 'DBUSER'
|
|
14
|
+
self.SHAPE = Shape
|
|
15
|
+
self.PARAMS = parameters
|
|
16
|
+
self.OFFSET = Offset
|
|
17
|
+
self.USESHEAR = useShear
|
|
18
|
+
self.USE7DOF = use7Dof
|
|
19
|
+
self.DATATYPE = 2
|
|
20
|
+
|
|
21
|
+
def __str__(self):
|
|
22
|
+
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def toJSON(sect):
|
|
26
|
+
js = {
|
|
27
|
+
"SECTTYPE": "DBUSER",
|
|
28
|
+
"SECT_NAME": sect.NAME,
|
|
29
|
+
"SECT_BEFORE": {
|
|
30
|
+
"SHAPE": sect.SHAPE,
|
|
31
|
+
"DATATYPE": sect.DATATYPE,
|
|
32
|
+
"SECT_I": {
|
|
33
|
+
"vSIZE": sect.PARAMS
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
38
|
+
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
39
|
+
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
40
|
+
return js
|
|
41
|
+
|
|
42
|
+
@staticmethod
|
|
43
|
+
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
44
|
+
return _SS_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],offset,uShear,u7DOF,id)
|
|
45
|
+
|
|
46
|
+
def _centerLine(shape,end):
|
|
47
|
+
if shape.SHAPE == 'SB' :
|
|
48
|
+
H,B = shape.PARAMS[:2]
|
|
49
|
+
|
|
50
|
+
sect_lin_con = [[1,2],[3,1]]
|
|
51
|
+
|
|
52
|
+
sect_cg_LT = [-B/2,H/2]
|
|
53
|
+
sect_cg_CC = [0,0]
|
|
54
|
+
sect_cg_RB = [B/2,-H/2]
|
|
55
|
+
|
|
56
|
+
if H > B :
|
|
57
|
+
sect_shape = [[0,0],[0,H/2],[0,-H/2],[0,H/4],[0,-H/4]]
|
|
58
|
+
sect_thk = [B,B,B,B]
|
|
59
|
+
sect_thk_off = [0,0,0,0]
|
|
60
|
+
else :
|
|
61
|
+
sect_shape = [[0,0],[B/2,0],[-B/2,0],[B/4,0],[-B/4,0]]
|
|
62
|
+
sect_thk = [H,H,H,H]
|
|
63
|
+
sect_thk_off = [0,0,0,0]
|
|
64
|
+
|
|
65
|
+
elif shape.SHAPE == 'L' :
|
|
66
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
67
|
+
|
|
68
|
+
sect_cg_LT = [0,0]
|
|
69
|
+
sect_cg_CC = [(H*tw*tw+B*B*tf)/(2*(B*tw+H*tf)),-(H*H*tw+B*tf*tf)/(2*(B*tw+H*tf))]
|
|
70
|
+
sect_cg_RB = [B,-H]
|
|
71
|
+
|
|
72
|
+
# sect_shape = [[0.5*tw,-H],[0.5*tw,-0.5*tf],[B,-0.5*tf]]
|
|
73
|
+
sect_shape = [[0,-H],[0,0],[B,0]]
|
|
74
|
+
sect_lin_con = [[3,2],[2,1]]
|
|
75
|
+
sect_thk = [tw,tf]
|
|
76
|
+
# sect_thk_off = [0,0]
|
|
77
|
+
sect_thk_off = [tw/2,tf/2]
|
|
78
|
+
|
|
79
|
+
elif shape.SHAPE == 'C' :
|
|
80
|
+
H,B1,tw,tf1,B2,tf2 = shape.PARAMS[:6]
|
|
81
|
+
if B2 == 0 : B2 = B1
|
|
82
|
+
if tf2 == 0 : tf2 = tf1
|
|
83
|
+
|
|
84
|
+
sect_cg_LT = [0,0]
|
|
85
|
+
sect_cg_CC = [(B1+B2)*0.2,-H*0.5]
|
|
86
|
+
sect_cg_RB = [max(B1,B2),-H]
|
|
87
|
+
|
|
88
|
+
# sect_shape = [[0.5*tw,-0.5*tf1],[B1,-0.5*tf1],[0.5*tw,-H+0.5*tf2],[B2,-H+0.5*tf2]]
|
|
89
|
+
sect_shape = [[0,0],[B1,0],[0,-H],[B2,-H]]
|
|
90
|
+
sect_lin_con = [[2,1],[1,3],[3,4]]
|
|
91
|
+
sect_thk = [tf1,tw,tf2]
|
|
92
|
+
# sect_thk_off = [0,0,0]
|
|
93
|
+
sect_thk_off = [tf1/2,tw/2,tf2/2]
|
|
94
|
+
|
|
95
|
+
elif shape.SHAPE == 'H' :
|
|
96
|
+
H,B1,tw,tf1,B2,tf2,r1,r2 = shape.PARAMS[:8]
|
|
97
|
+
if B2 == 0 : B2 = B1
|
|
98
|
+
if tf2 == 0 : tf2 = tf1
|
|
99
|
+
|
|
100
|
+
sect_cg_LT = [-0.5*max(B1,B2),0.5*H]
|
|
101
|
+
sect_cg_CC = [0,0]
|
|
102
|
+
sect_cg_RB = [0.5*max(B1,B2),-0.5*H]
|
|
103
|
+
|
|
104
|
+
sect_shape = [[-0.5*B1,0.5*(H-tf1)],[0,0.5*(H-tf1)],[0.5*B1,0.5*(H-tf1)],[-0.5*B2,-0.5*(H-tf2)],[0,-0.5*(H-tf2)],[0.5*B2,-0.5*(H-tf2)]]
|
|
105
|
+
sect_lin_con = [[2,1],[3,2],[2,5],[4,5],[5,6]]
|
|
106
|
+
sect_thk = [tf1,tf1,tw,tf2,tf2]
|
|
107
|
+
sect_thk_off = [0,0,0,0,0]
|
|
108
|
+
|
|
109
|
+
elif shape.SHAPE == 'T' :
|
|
110
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
111
|
+
|
|
112
|
+
sect_cg_LT = [-B*0.5,0]
|
|
113
|
+
sect_cg_CC = [0,-H*0.3]
|
|
114
|
+
sect_cg_RB = [B*0.5,-H]
|
|
115
|
+
|
|
116
|
+
sect_shape = [[-0.5*B,-0.5*tf],[0,-0.5*tf],[0.5*B,-0.5*tf],[0,-H]]
|
|
117
|
+
sect_lin_con = [[2,1],[3,2],[2,4]]
|
|
118
|
+
sect_thk = [tf,tf,tw]
|
|
119
|
+
sect_thk_off = [0,0,0]
|
|
120
|
+
|
|
121
|
+
elif shape.SHAPE == 'B' :
|
|
122
|
+
H,B,tw,tf1,C,tf2 = shape.PARAMS[:6]
|
|
123
|
+
if tf2 == 0 : tf2 = tf1
|
|
124
|
+
|
|
125
|
+
sect_cg_LT = [-0.5*B,0.5*H]
|
|
126
|
+
sect_cg_CC = [0,0]
|
|
127
|
+
sect_cg_RB = [0.5*B,-0.5*H]
|
|
128
|
+
|
|
129
|
+
# sect_shape = [[0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),-0.5*(H-tf2)],[0.5*(B-tw),-0.5*(H-tf2)]]
|
|
130
|
+
sect_shape = [[0.5*B,0.5*H],[-0.5*B,0.5*H],[-0.5*B,-0.5*H],[0.5*B,-0.5*H]]
|
|
131
|
+
|
|
132
|
+
sect_lin_con = [[1,2],[2,3],[3,4],[4,1]]
|
|
133
|
+
sect_thk = [tf1,tw,tf2,tw]
|
|
134
|
+
# sect_thk_off = [0,0,0,0]
|
|
135
|
+
sect_thk_off = [0.5*tf1,0.5*tw,0.5*tf2,0.5*tw]
|
|
136
|
+
|
|
137
|
+
elif shape.SHAPE == 'P' :
|
|
138
|
+
D,tw = shape.PARAMS[:2]
|
|
139
|
+
|
|
140
|
+
# R = 0.5*(D-tw)
|
|
141
|
+
R = 0.5*D
|
|
142
|
+
|
|
143
|
+
sect_cg_LT = [-R,R]
|
|
144
|
+
sect_cg_CC = [0,0]
|
|
145
|
+
sect_cg_RB = [R,-R]
|
|
146
|
+
|
|
147
|
+
sect_shape = []
|
|
148
|
+
sect_lin_con = []
|
|
149
|
+
sect_thk = []
|
|
150
|
+
sect_thk_off = []
|
|
151
|
+
|
|
152
|
+
n = 16
|
|
153
|
+
for i in range(n):
|
|
154
|
+
sect_shape.append([R*math.sin(i*2*math.pi/n),R*math.cos(i*2*math.pi/n)])
|
|
155
|
+
sect_lin_con.append([i+1,i+2])
|
|
156
|
+
sect_thk.append(tw)
|
|
157
|
+
sect_thk_off.append(-0.5*tw)
|
|
158
|
+
sect_lin_con[-1] = [i+1,1]
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
|
|
163
|
+
|
|
164
|
+
return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from ._offsetSS import Offset
|
|
2
2
|
from ._offsetSS import _common
|
|
3
|
+
import math
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
@@ -114,6 +115,35 @@ class _SS_PSC_12CELL(_common):
|
|
|
114
115
|
vD[0],vD[1],vD[2],vD[3],vD[4],vD[5],vD[6],vD[7],
|
|
115
116
|
offset,uShear,u7DOF,id)
|
|
116
117
|
|
|
118
|
+
def _centerLine(shape,end):
|
|
119
|
+
if shape.SHAPE == '1CEL':
|
|
120
|
+
BO1 = shape.BO1
|
|
121
|
+
BO2 = shape.BO2
|
|
122
|
+
BO3 = shape.BO3
|
|
123
|
+
HO1 = shape.HO1
|
|
124
|
+
HO2 = shape.HO2
|
|
125
|
+
HO3 = shape.HO3
|
|
126
|
+
HI1 = shape.HI1
|
|
127
|
+
HI5 = shape.HI5
|
|
128
|
+
BI3 = shape.BI3
|
|
129
|
+
|
|
130
|
+
sect_lin_con = [[1,2],[2,3],[3,4],[2,5],[3,6],[5,6]]
|
|
131
|
+
|
|
132
|
+
sect_cg_LT = [0,0]
|
|
133
|
+
sect_cg_RB = [2*(BO1+BO2+BO3),-(HO1+HO2+HO3)]
|
|
134
|
+
sect_cg_CC = [(BO1+BO2+BO3),-(HO1+HO2+HO3)/2]
|
|
135
|
+
|
|
136
|
+
sect_shape = [[0,0],[BO1,0],[BO1+2*(BO2+BO3),0],[2*(BO1+BO2+BO3),0],[BO1+BO2,-HO1-HO3-HO2],[BO1+BO2+2*BO3,-HO1-HO3-HO2]]
|
|
137
|
+
sect_thk = [HO1,HI1,HO1,BO3-BI3,BO3-BI3,HI5]
|
|
138
|
+
sect_thk_off = [-HO1/2,-HI1/2,-HO1/2,(BO3-BI3)/2,-(BO3-BI3)/2,HI5/2]
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
|
|
143
|
+
|
|
144
|
+
return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
|
|
145
|
+
|
|
146
|
+
|
|
117
147
|
|
|
118
148
|
|
|
119
149
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: midas_civil
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Python library for MIDAS Civil NX
|
|
5
5
|
Home-page: https://github.com/MIDASIT-Co-Ltd/midas-civil-python
|
|
6
6
|
Author: Sumit Shekhar
|
|
@@ -14,6 +14,7 @@ Requires-Dist: polars
|
|
|
14
14
|
Requires-Dist: xlsxwriter
|
|
15
15
|
Requires-Dist: requests
|
|
16
16
|
Requires-Dist: scipy
|
|
17
|
+
Requires-Dist: colorama
|
|
17
18
|
Dynamic: author
|
|
18
19
|
Dynamic: author-email
|
|
19
20
|
Dynamic: description
|
|
@@ -5,7 +5,7 @@ with open('README.md','r') as f:
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
setup(name='midas_civil',
|
|
8
|
-
version='1.0
|
|
8
|
+
version='1.1.0',
|
|
9
9
|
description='Python library for MIDAS Civil NX',
|
|
10
10
|
author='Sumit Shekhar',
|
|
11
11
|
author_email='sumit.midasit@gmail.com',
|
|
@@ -15,7 +15,8 @@ setup(name='midas_civil',
|
|
|
15
15
|
'polars',
|
|
16
16
|
'xlsxwriter',
|
|
17
17
|
'requests',
|
|
18
|
-
'scipy'
|
|
18
|
+
'scipy',
|
|
19
|
+
'colorama'
|
|
19
20
|
],
|
|
20
21
|
long_description= description,
|
|
21
22
|
long_description_content_type='text/markdown',
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
from ._offsetSS import Offset
|
|
2
|
-
from ._offsetSS import _common
|
|
3
|
-
|
|
4
|
-
class _SS_TAPERED_DBUSER(_common):
|
|
5
|
-
|
|
6
|
-
""" Create Standard USER DEFINED sections"""
|
|
7
|
-
|
|
8
|
-
def __init__(self,Name='',Shape='',params_I:list=[],params_J:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
9
|
-
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
10
|
-
self.ID = id
|
|
11
|
-
self.NAME = Name
|
|
12
|
-
self.TYPE = 'TAPERED'
|
|
13
|
-
self.SHAPE = Shape
|
|
14
|
-
self.PARAMS_I = params_I
|
|
15
|
-
self.PARAMS_J = params_J
|
|
16
|
-
self.OFFSET = Offset
|
|
17
|
-
self.USESHEAR = useShear
|
|
18
|
-
self.USE7DOF = use7Dof
|
|
19
|
-
self.DATATYPE = 2
|
|
20
|
-
|
|
21
|
-
def __str__(self):
|
|
22
|
-
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def toJSON(sect):
|
|
26
|
-
js = {
|
|
27
|
-
"SECTTYPE": sect.TYPE,
|
|
28
|
-
"SECT_NAME": sect.NAME,
|
|
29
|
-
"SECT_BEFORE": {
|
|
30
|
-
"SHAPE": sect.SHAPE,
|
|
31
|
-
"TYPE": sect.DATATYPE,
|
|
32
|
-
"SECT_I": {
|
|
33
|
-
"vSIZE": sect.PARAMS_I
|
|
34
|
-
},
|
|
35
|
-
"SECT_J": {
|
|
36
|
-
"vSIZE": sect.PARAMS_J
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
41
|
-
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
42
|
-
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
43
|
-
return js
|
|
44
|
-
|
|
45
|
-
@staticmethod
|
|
46
|
-
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
47
|
-
return _SS_TAPERED_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],js['SECT_BEFORE']['SECT_J']['vSIZE'],offset,uShear,u7DOF,id)
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
from ._offsetSS import Offset
|
|
2
|
-
from ._offsetSS import _common
|
|
3
|
-
|
|
4
|
-
class _SS_DBUSER(_common):
|
|
5
|
-
|
|
6
|
-
""" Create Standard USER DEFINED sections"""
|
|
7
|
-
|
|
8
|
-
def __init__(self,Name='',Shape='',parameters:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
9
|
-
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
10
|
-
self.ID = id
|
|
11
|
-
self.NAME = Name
|
|
12
|
-
self.TYPE = 'DBUSER'
|
|
13
|
-
self.SHAPE = Shape
|
|
14
|
-
self.PARAMS = parameters
|
|
15
|
-
self.OFFSET = Offset
|
|
16
|
-
self.USESHEAR = useShear
|
|
17
|
-
self.USE7DOF = use7Dof
|
|
18
|
-
self.DATATYPE = 2
|
|
19
|
-
|
|
20
|
-
def __str__(self):
|
|
21
|
-
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def toJSON(sect):
|
|
25
|
-
js = {
|
|
26
|
-
"SECTTYPE": "DBUSER",
|
|
27
|
-
"SECT_NAME": sect.NAME,
|
|
28
|
-
"SECT_BEFORE": {
|
|
29
|
-
"SHAPE": sect.SHAPE,
|
|
30
|
-
"DATATYPE": sect.DATATYPE,
|
|
31
|
-
"SECT_I": {
|
|
32
|
-
"vSIZE": sect.PARAMS
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
37
|
-
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
38
|
-
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
39
|
-
return js
|
|
40
|
-
|
|
41
|
-
@staticmethod
|
|
42
|
-
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
43
|
-
return _SS_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],offset,uShear,u7DOF,id)
|
|
44
|
-
|
|
45
|
-
def _centerLine(shape):
|
|
46
|
-
H = shape.PARAMS[0]
|
|
47
|
-
B = shape.PARAMS[1]
|
|
48
|
-
tw = shape.PARAMS[2]
|
|
49
|
-
tf = shape.PARAMS[3]
|
|
50
|
-
|
|
51
|
-
sect_lin_con = [[1,2],[3,1]]
|
|
52
|
-
|
|
53
|
-
sect_cg = [0,0]
|
|
54
|
-
|
|
55
|
-
sect_shape = [[0,0],[B,0],[0,-H]]
|
|
56
|
-
sect_thk = [tf,tw]
|
|
57
|
-
sect_thk_off = [-tf/2,-tw/2]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|