osis-python 0.7.0__tar.gz → 0.7.1__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.
- {osis_python-0.7.0/src/osis_python.egg-info → osis_python-0.7.1}/PKG-INFO +1 -1
- {osis_python-0.7.0 → osis_python-0.7.1/src/osis_python.egg-info}/PKG-INFO +1 -1
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/__init__.py +1 -1
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/control/control.py +26 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/control/manager.py +34 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/build.py +55 -24
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/geometry/manager.py +6 -10
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/manager.py +4 -2
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/param.py +4 -3
- {osis_python-0.7.0 → osis_python-0.7.1}/LICENSE +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/README.md +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/pyproject.toml +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/setup.cfg +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/osis_python.egg-info/SOURCES.txt +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/osis_python.egg-info/requires.txt +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/boundary/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/boundary/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/control/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/control/io.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/control/nonlinear.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/all_func.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/apdl_sync.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/basic_manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/batch.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/client.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/command.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/engine.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/exceptions.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/references.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/solver.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/core/sync_apdl_cli.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/display/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/display/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/display/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/dynamic/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/dynamic/load_to_mass.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/dynamic/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/dynamic/modal.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/dynamic/seismic.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/element/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/element/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/element/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/general/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/geometry/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/geometry/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/live/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/live/analysis.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/live/lane.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/live/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/load/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/load/static.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/load/tendon.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/material/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/material/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/material/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/node/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/node/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/post/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/post/combine.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/post/design_check.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/post/display.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/post/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/project/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/project/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/project/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/property/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/property/component_thickness.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/property/coordinate.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/property/creep_shrink.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/property/damping.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/property/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/quick_building/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/result/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/result/check.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/result/env.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/result/loadcase.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/result/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/result/result.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/common.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/composite.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/numeric.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/rebar.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/rib.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/section/steel.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/settlement/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/settlement/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/settlement/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/stability/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/stability/buckling.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/stability/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/stage/define.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/stage/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/stage/overall.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/thickness/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/thickness/interface.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/thickness/manager.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/transfer/__init__.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/transfer/generator.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/transfer/matrix.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/transfer/out_to_python.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/transfer/parser.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/transfer/routes.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/src/pyosis/transfer/split.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/tests/test_batch.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/tests/test_delete_occupied.py +0 -0
- {osis_python-0.7.0 → osis_python-0.7.1}/tests/test_project_manager.py +0 -0
|
@@ -7,7 +7,7 @@ A library for extending OSIS functionality.
|
|
|
7
7
|
A library that allows users to use CAE with great flexibility.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
__version__ = "0.7.
|
|
10
|
+
__version__ = "0.7.1"
|
|
11
11
|
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
|
|
12
12
|
|
|
13
13
|
from .core.engine import OSISEngine
|
|
@@ -103,6 +103,32 @@ def osis_mod_loc_coor(bFlag: int=1):
|
|
|
103
103
|
'''
|
|
104
104
|
pass
|
|
105
105
|
|
|
106
|
+
@REGISTRY.register("CalcRebarGravity")
|
|
107
|
+
def osis_calc_rebar_gravity(bFlag: int=1):
|
|
108
|
+
'''
|
|
109
|
+
是否考虑钢筋钢束自重
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
bFlag (bool): 1=考虑,0=不考虑
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
tuple (bool, str): 是否成功,失败原因
|
|
116
|
+
'''
|
|
117
|
+
pass
|
|
118
|
+
|
|
119
|
+
@REGISTRY.register("IncRebar")
|
|
120
|
+
def osis_inc_rebar(bFlag: int=1):
|
|
121
|
+
'''
|
|
122
|
+
是否考虑钢筋对截面几何特性的影响
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
bFlag (bool): 1=考虑,0=不考虑
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
tuple (bool, str): 是否成功,失败原因
|
|
129
|
+
'''
|
|
130
|
+
pass
|
|
131
|
+
|
|
106
132
|
@REGISTRY.register("IncTendon")
|
|
107
133
|
def osis_inc_tendon(bFlag: int=1):
|
|
108
134
|
'''
|
|
@@ -27,6 +27,8 @@ from .control import (
|
|
|
27
27
|
osis_calc_shear,
|
|
28
28
|
osis_calc_rlx,
|
|
29
29
|
osis_mod_loc_coor,
|
|
30
|
+
osis_calc_rebar_gravity,
|
|
31
|
+
osis_inc_rebar,
|
|
30
32
|
osis_inc_tendon,
|
|
31
33
|
)
|
|
32
34
|
from .io import osis_apdl
|
|
@@ -230,6 +232,38 @@ class ControlManager:
|
|
|
230
232
|
if not ok:
|
|
231
233
|
raise RuntimeError(f"设置局部坐标轴修正失败: {err}")
|
|
232
234
|
|
|
235
|
+
def set_calc_rebar_gravity(self, enabled: Literal[0,1] = 1) -> None:
|
|
236
|
+
'''设置是否考虑钢筋钢束自重
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
enabled (int): 1=考虑,0=不考虑
|
|
240
|
+
|
|
241
|
+
Returns:
|
|
242
|
+
None
|
|
243
|
+
|
|
244
|
+
Raises:
|
|
245
|
+
RuntimeError: 设置失败时抛出异常
|
|
246
|
+
'''
|
|
247
|
+
ok, err = osis_calc_rebar_gravity(enabled)
|
|
248
|
+
if not ok:
|
|
249
|
+
raise RuntimeError(f"设置钢筋钢束自重考虑失败: {err}")
|
|
250
|
+
|
|
251
|
+
def set_inc_rebar(self, enabled: Literal[0,1] = 1) -> None:
|
|
252
|
+
'''设置是否考虑钢筋对截面几何特性的影响
|
|
253
|
+
|
|
254
|
+
Args:
|
|
255
|
+
enabled (int): 1=考虑,0=不考虑
|
|
256
|
+
|
|
257
|
+
Returns:
|
|
258
|
+
None
|
|
259
|
+
|
|
260
|
+
Raises:
|
|
261
|
+
RuntimeError: 设置失败时抛出异常
|
|
262
|
+
'''
|
|
263
|
+
ok, err = osis_inc_rebar(enabled)
|
|
264
|
+
if not ok:
|
|
265
|
+
raise RuntimeError(f"设置钢筋截面特性影响失败: {err}")
|
|
266
|
+
|
|
233
267
|
def set_inc_tendon(self, enabled: Literal[0,1] = 1) -> None:
|
|
234
268
|
'''设置是否考虑钢束自重及钢束对截面几何特性的影响
|
|
235
269
|
|
|
@@ -208,12 +208,27 @@ def _split_commands(text: str) -> List[str]:
|
|
|
208
208
|
return commands
|
|
209
209
|
|
|
210
210
|
|
|
211
|
+
# 5.01 版 .out 使用缩写命令名,此处统一归一化为全名后再分发
|
|
212
|
+
CMD_ALIASES = {
|
|
213
|
+
"N": "Node",
|
|
214
|
+
"Ele": "Element",
|
|
215
|
+
"Sec": "Section",
|
|
216
|
+
"SecOff": "SectionOffset",
|
|
217
|
+
"SecMesh": "SectionMesh",
|
|
218
|
+
"Mat": "Material",
|
|
219
|
+
"LC": "LoadCase",
|
|
220
|
+
"Bd": "Boundary",
|
|
221
|
+
"Stg": "Stage",
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
211
225
|
def _split_cmd(cmd: str) -> List[str]:
|
|
212
226
|
"""分割命令参数
|
|
213
227
|
|
|
214
228
|
命令已经过 _split_commands 处理,去除了注释和多余空白。
|
|
215
229
|
只需按逗号分割,保留空值。
|
|
216
230
|
方括号 [] 内的逗号不分割(支持矩阵下标如 Matrix[0,0])。
|
|
231
|
+
命令名经 CMD_ALIASES 归一化(5.01 缩写名 → 全名)。
|
|
217
232
|
"""
|
|
218
233
|
if not cmd:
|
|
219
234
|
return []
|
|
@@ -239,6 +254,8 @@ def _split_cmd(cmd: str) -> List[str]:
|
|
|
239
254
|
current += char
|
|
240
255
|
# 总是添加最后一部分(即使为空)
|
|
241
256
|
parts.append(current.strip())
|
|
257
|
+
if parts and parts[0] in CMD_ALIASES:
|
|
258
|
+
parts[0] = CMD_ALIASES[parts[0]]
|
|
242
259
|
return parts
|
|
243
260
|
|
|
244
261
|
|
|
@@ -298,6 +315,8 @@ def generate_control(commands: List[str]) -> str:
|
|
|
298
315
|
"CalcShear": ("set_calc_shear", [0], True),
|
|
299
316
|
"CalcRlx": ("set_calc_relaxation", [0], True),
|
|
300
317
|
"ModLocCoor": ("set_mod_loc_coor", [0], True),
|
|
318
|
+
"CalcRebarGravity": ("set_calc_rebar_gravity", [0], True),
|
|
319
|
+
"IncRebar": ("set_inc_rebar", [0], True),
|
|
301
320
|
"IncTendon": ("set_inc_tendon", [0], True),
|
|
302
321
|
"LnSrch": ("set_line_search", [0], True),
|
|
303
322
|
"AutoTs": ("set_auto_time_step", [0], True),
|
|
@@ -678,9 +697,19 @@ def generate_section(commands: List[str]) -> str:
|
|
|
678
697
|
lines.append("")
|
|
679
698
|
|
|
680
699
|
elif args[0] == "SectionMesh":
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
700
|
+
# 新格式: SectionMesh,Index,PartID,MeshMethod,MeshSize
|
|
701
|
+
if len(args) == 5:
|
|
702
|
+
lines.append(f" sec.set_mesh(")
|
|
703
|
+
lines.append(
|
|
704
|
+
f" mesh_method={args[3]}, mesh_size={args[4]},"
|
|
705
|
+
f" part_id={args[2]}"
|
|
706
|
+
)
|
|
707
|
+
lines.append(" )")
|
|
708
|
+
# 旧格式: SectionMesh,Index,MeshMethod,MeshSize(PartID 缺省 = 1)
|
|
709
|
+
else:
|
|
710
|
+
lines.append(f" sec.set_mesh(")
|
|
711
|
+
lines.append(f" mesh_method={args[2]}, mesh_size={args[3]}")
|
|
712
|
+
lines.append(" )")
|
|
684
713
|
lines.append("")
|
|
685
714
|
|
|
686
715
|
elif args[0] == "StressPoint":
|
|
@@ -1876,8 +1905,7 @@ def build_project(command_file: Optional[str] = None, output_dir: Optional[str]
|
|
|
1876
1905
|
|
|
1877
1906
|
在当前目录自动创建:
|
|
1878
1907
|
- post/ 后处理目录
|
|
1879
|
-
- prep/
|
|
1880
|
-
- main.py 主入口文件
|
|
1908
|
+
- prep/ 建模模块目录(含 main.py 主入口)
|
|
1881
1909
|
|
|
1882
1910
|
Args:
|
|
1883
1911
|
command_file: 命令流文件路径 (.out 或 .sml),为 None 时自动从当前 OSIS 项目导出
|
|
@@ -1963,14 +1991,14 @@ def build_project(command_file: Optional[str] = None, output_dir: Optional[str]
|
|
|
1963
1991
|
if total_todos > 0:
|
|
1964
1992
|
print(f"\n警告: 共 {total_todos} 条命令未转换 (# TODO),请手动检查")
|
|
1965
1993
|
|
|
1966
|
-
# 创建 main.py
|
|
1967
|
-
main_file =
|
|
1994
|
+
# 创建 main.py(与其他模块一起放在 prep/ 内)
|
|
1995
|
+
main_file = prep_dir / "main.py"
|
|
1968
1996
|
main_content = '''"""
|
|
1969
1997
|
从命令流构建的桥梁建模项目
|
|
1970
1998
|
|
|
1971
1999
|
使用方式:
|
|
1972
|
-
python main.py
|
|
1973
|
-
python main.py --solve
|
|
2000
|
+
python prep/main.py # 完整建模(自动清空重建)
|
|
2001
|
+
python prep/main.py --solve # 建模后自动运行分析
|
|
1974
2002
|
|
|
1975
2003
|
也可以直接执行单个模块(注意:单独跑某个模块时,OSIS 中应已有对应节点/材料等数据):
|
|
1976
2004
|
python prep/_5_node.py # 只执行节点创建
|
|
@@ -1981,17 +2009,17 @@ import argparse
|
|
|
1981
2009
|
|
|
1982
2010
|
from pyosis import batch
|
|
1983
2011
|
|
|
1984
|
-
from
|
|
1985
|
-
from
|
|
1986
|
-
from
|
|
1987
|
-
from
|
|
1988
|
-
from
|
|
1989
|
-
from
|
|
1990
|
-
from
|
|
1991
|
-
from
|
|
1992
|
-
from
|
|
1993
|
-
from
|
|
1994
|
-
from
|
|
2012
|
+
from _0_engine import engine
|
|
2013
|
+
from _1_control import setup_control
|
|
2014
|
+
from _2_property import build_property
|
|
2015
|
+
from _3_material import build_materials
|
|
2016
|
+
from _4_section import build_sections
|
|
2017
|
+
from _5_node import build_nodes
|
|
2018
|
+
from _6_element import build_elements
|
|
2019
|
+
from _7_boundary import build_boundaries
|
|
2020
|
+
from _8_loadcase import build_loadcases
|
|
2021
|
+
from _9_analysis import build_analysis
|
|
2022
|
+
from _10_stage import build_stages
|
|
1995
2023
|
|
|
1996
2024
|
|
|
1997
2025
|
def build_model(run_analysis: bool = False):
|
|
@@ -2005,14 +2033,16 @@ def build_model(run_analysis: bool = False):
|
|
|
2005
2033
|
"""
|
|
2006
2034
|
|
|
2007
2035
|
print("清空项目...")
|
|
2008
|
-
engine.clear()
|
|
2009
|
-
engine.clc()
|
|
2010
2036
|
|
|
2011
2037
|
print("=" * 50)
|
|
2012
2038
|
print("开始建模")
|
|
2013
2039
|
print("=" * 50)
|
|
2014
2040
|
|
|
2015
2041
|
with batch():
|
|
2042
|
+
# 0. 清空项目(与后续命令合并为一次请求)
|
|
2043
|
+
engine.clear()
|
|
2044
|
+
engine.clc()
|
|
2045
|
+
|
|
2016
2046
|
# 1. 全局设置(无依赖)
|
|
2017
2047
|
print("\\n[1/10] 设置全局控制参数...")
|
|
2018
2048
|
setup_control(engine)
|
|
@@ -2172,13 +2202,14 @@ if __name__ == "__main__":
|
|
|
2172
2202
|
print("项目结构:")
|
|
2173
2203
|
print(f" {base_dir.name}/")
|
|
2174
2204
|
print(f" ├── build.py")
|
|
2175
|
-
print(f" ├── main.py")
|
|
2176
2205
|
print(f" ├── post/")
|
|
2177
2206
|
print(f" └── prep/")
|
|
2207
|
+
print(" ├── main.py")
|
|
2208
|
+
print(" └── _N_*.py")
|
|
2178
2209
|
print("\n提示:")
|
|
2179
2210
|
print(" 1. 生成的代码可直接运行,但部分复杂命令标记为 # TODO 需要手动检查")
|
|
2180
2211
|
print(" 2. 建议先运行单个模块测试:python prep/_5_node.py")
|
|
2181
|
-
print(" 3. 完整建模:python main.py")
|
|
2212
|
+
print(" 3. 完整建模:python prep/main.py")
|
|
2182
2213
|
|
|
2183
2214
|
|
|
2184
2215
|
def build_from_sml(sml_file: str, output_dir: Optional[str] = None) -> None:
|
|
@@ -221,7 +221,7 @@ class GeometryManager(BasicManager):
|
|
|
221
221
|
self,
|
|
222
222
|
name: str,
|
|
223
223
|
owner: Literal["LIVE", "TENDON"],
|
|
224
|
-
|
|
224
|
+
coordinates: list[float],
|
|
225
225
|
) -> Spline:
|
|
226
226
|
"""创建或修改三维样条曲线(自然边界/NATURAL)。
|
|
227
227
|
|
|
@@ -240,9 +240,7 @@ class GeometryManager(BasicManager):
|
|
|
240
240
|
|
|
241
241
|
Examples:
|
|
242
242
|
>>> geometry_manager.create_natural("Lane1", "LIVE",
|
|
243
|
-
... 0.0, 0.0, 0.0,
|
|
244
|
-
... 10.0, 0.0, 0.0,
|
|
245
|
-
... 20.0, 0.0, 0.0,
|
|
243
|
+
... [0.0, 0.0, 0.0, 10.0, 0.0, 0.0, 20.0, 0.0, 0.0],
|
|
246
244
|
... )
|
|
247
245
|
"""
|
|
248
246
|
ok, err = osis_spline3d_natural(name, "NATURAL", owner, *coordinates)
|
|
@@ -254,7 +252,7 @@ class GeometryManager(BasicManager):
|
|
|
254
252
|
self,
|
|
255
253
|
name: str,
|
|
256
254
|
owner: str,
|
|
257
|
-
|
|
255
|
+
coordinates: list[float],
|
|
258
256
|
) -> Spline:
|
|
259
257
|
"""创建或修改三维样条曲线(2D圆弧/ARC2D)。
|
|
260
258
|
|
|
@@ -273,8 +271,7 @@ class GeometryManager(BasicManager):
|
|
|
273
271
|
|
|
274
272
|
Examples:
|
|
275
273
|
>>> geometry_manager.create_arc2d("Arc1", "TENDON",
|
|
276
|
-
... 0.0, 0.0, 10.0,
|
|
277
|
-
... 10.0, 0.0, 10.0,
|
|
274
|
+
... [0.0, 0.0, 10.0, 10.0, 0.0, 10.0],
|
|
278
275
|
... )
|
|
279
276
|
"""
|
|
280
277
|
ok, err = osis_spline3d_arc2d(name, "ARC2D", owner, *coordinates)
|
|
@@ -286,7 +283,7 @@ class GeometryManager(BasicManager):
|
|
|
286
283
|
self,
|
|
287
284
|
name: str,
|
|
288
285
|
owner: str,
|
|
289
|
-
|
|
286
|
+
coordinates: list[float],
|
|
290
287
|
) -> Spline:
|
|
291
288
|
"""创建或修改三维样条曲线(3D圆弧/ARC3D)。
|
|
292
289
|
|
|
@@ -305,8 +302,7 @@ class GeometryManager(BasicManager):
|
|
|
305
302
|
|
|
306
303
|
Examples:
|
|
307
304
|
>>> geometry_manager.create_arc3d("Arc3d1", "TENDON",
|
|
308
|
-
... 0.0, 0.0, 0.0, 20.0,
|
|
309
|
-
... 10.0, 0.0, 5.0, 20.0,
|
|
305
|
+
... [0.0, 0.0, 0.0, 20.0, 10.0, 0.0, 5.0, 20.0],
|
|
310
306
|
... )
|
|
311
307
|
"""
|
|
312
308
|
ok, err = osis_spline3d_arc3d(name, "ARC3D", owner, *coordinates)
|
|
@@ -274,19 +274,21 @@ class Section:
|
|
|
274
274
|
self,
|
|
275
275
|
mesh_method: Literal[0, 1] = 0,
|
|
276
276
|
mesh_size: float = 0.0,
|
|
277
|
+
part_id: int = 1,
|
|
277
278
|
) -> None:
|
|
278
|
-
'''
|
|
279
|
+
'''设置截面网格(适用于混凝土截面、模板组合截面与自定义组合截面)。
|
|
279
280
|
|
|
280
281
|
Args:
|
|
281
282
|
mesh_method (int): 网格划分方式
|
|
282
283
|
* 0 = 自动划分
|
|
283
284
|
* 1 = 手动划分
|
|
284
285
|
mesh_size (float): 网格划分尺寸,在 mesh_method=1 时起作用
|
|
286
|
+
part_id (int): 分部编号,混凝土截面输入 1,模板组合截面输入 2
|
|
285
287
|
|
|
286
288
|
Raises:
|
|
287
289
|
RuntimeError: 设置失败时抛出
|
|
288
290
|
'''
|
|
289
|
-
ok, err = osis_section_mesh(self.no, mesh_method, mesh_size)
|
|
291
|
+
ok, err = osis_section_mesh(self.no, part_id, mesh_method, mesh_size)
|
|
290
292
|
if not ok:
|
|
291
293
|
raise RuntimeError(f"设置截面 {self.no} 网格失败: {err}")
|
|
292
294
|
|
|
@@ -48,12 +48,13 @@ def osis_section_offset(nSec: int=1, offsetTypeY: Literal["Left", "Middle", "Rig
|
|
|
48
48
|
pass
|
|
49
49
|
|
|
50
50
|
@REGISTRY.register('SectionMesh')
|
|
51
|
-
def osis_section_mesh(nSec: int=1, nMeshMethod: Literal[0, 1]=0, dMeshSize: float=0.0):
|
|
51
|
+
def osis_section_mesh(nSec: int=1, nPartID: int=1, nMeshMethod: Literal[0, 1]=0, dMeshSize: float=0.0):
|
|
52
52
|
"""设置截面网格。
|
|
53
53
|
|
|
54
54
|
Args:
|
|
55
55
|
nSec (int): 截面编号。
|
|
56
|
-
|
|
56
|
+
nPartID (int): 分部编号,混凝土截面需输入 1,模板组合截面输入 2。
|
|
57
|
+
nMeshMethod (int): 定义截面网格划分方法,可选值:
|
|
57
58
|
* 0 = 自动划分
|
|
58
59
|
* 1 = 手动划分
|
|
59
60
|
dMeshSize (float): 网格划分尺寸,在 nMeshMethod=1 时该项起作用
|
|
@@ -62,7 +63,7 @@ def osis_section_mesh(nSec: int=1, nMeshMethod: Literal[0, 1]=0, dMeshSize: floa
|
|
|
62
63
|
tuple (bool, str): 返回一个元组,包含:
|
|
63
64
|
- bool: 操作是否成功
|
|
64
65
|
- str: 失败原因(如果操作失败)
|
|
65
|
-
|
|
66
|
+
|
|
66
67
|
"""
|
|
67
68
|
pass
|
|
68
69
|
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|