osis-python 0.6.3__tar.gz → 0.6.5__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.6.3/src/osis_python.egg-info → osis_python-0.6.5}/PKG-INFO +1 -1
- {osis_python-0.6.3 → osis_python-0.6.5/src/osis_python.egg-info}/PKG-INFO +1 -1
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/__init__.py +1 -1
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/build.py +2 -2
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/display/interface.py +26 -1
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/display/manager.py +48 -7
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/load/manager.py +245 -2
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/load/static.py +131 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/property/component_thickness.py +4 -1
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/property/manager.py +4 -1
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/manager.py +28 -11
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/steel.py +8 -8
- {osis_python-0.6.3 → osis_python-0.6.5}/LICENSE +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/README.md +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/pyproject.toml +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/setup.cfg +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/osis_python.egg-info/SOURCES.txt +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/osis_python.egg-info/requires.txt +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/boundary/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/boundary/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/control/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/control/control.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/control/io.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/control/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/control/nonlinear.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/all_func.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/apdl_sync.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/basic_manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/client.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/command.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/engine.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/exceptions.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/references.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/solver.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/core/sync_apdl_cli.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/display/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/dynamic/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/dynamic/load_to_mass.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/dynamic/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/dynamic/modal.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/dynamic/seismic.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/element/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/element/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/element/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/general/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/geometry/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/geometry/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/geometry/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/live/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/live/analysis.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/live/lane.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/live/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/load/tendon.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/material/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/material/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/material/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/node/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/node/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/post/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/post/combine.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/post/design_check.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/post/display.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/post/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/project/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/project/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/project/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/property/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/property/coordinate.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/property/creep_shrink.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/property/damping.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/quick_building/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/result/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/result/check.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/result/env.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/result/loadcase.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/result/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/result/result.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/common.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/composite.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/numeric.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/param.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/rebar.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/section/rib.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/settlement/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/settlement/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/settlement/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/stability/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/stability/buckling.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/stability/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/stage/define.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/stage/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/stage/overall.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/thickness/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/thickness/interface.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/thickness/manager.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/transfer/__init__.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/transfer/generator.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/transfer/matrix.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/transfer/out_to_python.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/transfer/parser.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/transfer/routes.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/src/pyosis/transfer/split.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/tests/test_delete_occupied.py +0 -0
- {osis_python-0.6.3 → osis_python-0.6.5}/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.6.
|
|
10
|
+
__version__ = "0.6.5"
|
|
11
11
|
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
|
|
12
12
|
|
|
13
13
|
from .core.engine import OSISEngine
|
|
@@ -533,8 +533,8 @@ SECTION_TYPE_MAP = {
|
|
|
533
533
|
"LSHAPE": "create_Lshape",
|
|
534
534
|
"TSHAPE": "create_Tshape",
|
|
535
535
|
"ROUNDEDEND": "create_rounded_end",
|
|
536
|
-
"
|
|
537
|
-
"
|
|
536
|
+
"STEELBEAMI": "create_steel_i",
|
|
537
|
+
"STEELBEAMBOX": "create_steel_box",
|
|
538
538
|
"STEELBOXTHREECELL": "create_steel_box_three_cell",
|
|
539
539
|
"STEELBOXITF": "create_steel_box_itf",
|
|
540
540
|
"STEELCANTIBOX": "create_steel_canti_box",
|
|
@@ -60,6 +60,7 @@ def osis_disp_ctrl(
|
|
|
60
60
|
def osis_control(
|
|
61
61
|
eAction: str,
|
|
62
62
|
eArg: str | None = None,
|
|
63
|
+
*dValues,
|
|
63
64
|
):
|
|
64
65
|
"""视图 / 界面控制命令。
|
|
65
66
|
|
|
@@ -70,7 +71,9 @@ def osis_control(
|
|
|
70
71
|
* ``view`` = 切换视图方向(配合 eArg)
|
|
71
72
|
* 其他如 ``quickCreateModel`` 等
|
|
72
73
|
eArg (str | None): 子命令参数
|
|
73
|
-
* 当 eAction 为 ``view`` 时: ``standard`` / ``top`` / ``right`` /
|
|
74
|
+
* 当 eAction 为 ``view`` 时: ``standard`` / ``top`` / ``right`` /
|
|
75
|
+
``front`` / ``zoom`` / ``move``
|
|
76
|
+
dValues: 附加参数
|
|
74
77
|
|
|
75
78
|
Returns:
|
|
76
79
|
tuple (bool, str): 是否成功,失败原因
|
|
@@ -80,6 +83,7 @@ def osis_control(
|
|
|
80
83
|
>>> osis_control("view", "top")
|
|
81
84
|
>>> osis_control("view", "right")
|
|
82
85
|
>>> osis_control("view", "front")
|
|
86
|
+
>>> osis_control("view", "zoom", 0.8)
|
|
83
87
|
"""
|
|
84
88
|
pass
|
|
85
89
|
|
|
@@ -101,3 +105,24 @@ def osis_plsm(bFlag: Literal[0, 1] = 1):
|
|
|
101
105
|
>>> osis_plsm(0)
|
|
102
106
|
"""
|
|
103
107
|
pass
|
|
108
|
+
|
|
109
|
+
@REGISTRY.register("jpeg")
|
|
110
|
+
def osis_jpeg(path: str = "image"):
|
|
111
|
+
"""截图工具。
|
|
112
|
+
|
|
113
|
+
格式: ``jpeg,path``
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
path (str): 图片保存路径/文件名。文件扩展名固定为 ``.jpg``。
|
|
117
|
+
当仅传入文件名(不含目录分隔符)时,图片默认保存到
|
|
118
|
+
``<project_dir>/image/{path}.jpg``;
|
|
119
|
+
传入完整路径(如 ``D:\\reports\\fig1``)则保存到对应位置。
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
tuple (bool, str): 是否成功,失败原因
|
|
123
|
+
|
|
124
|
+
Examples:
|
|
125
|
+
>>> osis_jpeg("IMG_盖梁裂缝宽度计算结果图")
|
|
126
|
+
>>> osis_jpeg(r"D:\\reports\\fig1")
|
|
127
|
+
"""
|
|
128
|
+
pass
|
|
@@ -15,7 +15,7 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
from typing import Literal, Sequence, Union
|
|
17
17
|
|
|
18
|
-
from .interface import osis_control, osis_disp_ctrl, osis_plsm
|
|
18
|
+
from .interface import osis_control, osis_disp_ctrl, osis_plsm, osis_jpeg
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class DisplayManager:
|
|
@@ -55,28 +55,45 @@ class DisplayManager:
|
|
|
55
55
|
if not ok:
|
|
56
56
|
raise RuntimeError(f"显示控制失败: {err}")
|
|
57
57
|
|
|
58
|
-
def control(self, action: str, arg: str | None = None) -> None:
|
|
58
|
+
def control(self, action: str, arg: str | None = None, *values) -> None:
|
|
59
59
|
"""视图 / 界面控制(对应 ``/control,...``)。
|
|
60
60
|
|
|
61
61
|
Args:
|
|
62
62
|
action: 子命令,如 ``view``、``quickCreateModel``
|
|
63
|
-
arg: 子命令参数;``view`` 时为 ``standard`` / ``top`` / ``right`` /
|
|
63
|
+
arg: 子命令参数;``view`` 时为 ``standard`` / ``top`` / ``right`` /
|
|
64
|
+
``front`` / ``zoom`` / ``move``
|
|
65
|
+
*values: 附加参数。``view`` 子命令下:
|
|
66
|
+
* ``zoom``: 缩放系数(值越小模型越小)
|
|
67
|
+
* ``move``: (x, y) 像素偏移
|
|
64
68
|
|
|
65
69
|
Raises:
|
|
66
70
|
RuntimeError: 操作失败时抛出异常
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
>>> display_manager.control("view", "top")
|
|
74
|
+
>>> display_manager.control("view", "zoom", 0.8)
|
|
75
|
+
>>> display_manager.control("view", "move", 30, 10)
|
|
67
76
|
"""
|
|
68
|
-
ok, err = osis_control(action, arg)
|
|
77
|
+
ok, err = osis_control(action, arg, *values)
|
|
69
78
|
if not ok:
|
|
70
79
|
raise RuntimeError(f"界面控制失败: {err}")
|
|
71
80
|
|
|
72
81
|
def set_view(
|
|
73
82
|
self,
|
|
74
|
-
view: Literal["standard", "top", "right", "front"] = "standard",
|
|
83
|
+
view: Literal["standard", "top", "right", "front", "zoom", "move"] = "standard",
|
|
84
|
+
*values,
|
|
75
85
|
) -> None:
|
|
76
86
|
"""切换视图方向。
|
|
77
87
|
|
|
78
88
|
Args:
|
|
79
|
-
view:
|
|
89
|
+
view: 视图
|
|
90
|
+
* ``standard``: 标准视图
|
|
91
|
+
* ``top``: 俯视
|
|
92
|
+
* ``right``: 右视
|
|
93
|
+
* ``front``: 前视
|
|
94
|
+
* ``zoom``: 缩放(附加系数:值越小模型越小)
|
|
95
|
+
* ``move``: 平移(附加参数:x, y)
|
|
96
|
+
*values: ``zoom`` 时为缩放系数,``move`` 时为 x, y 像素偏移
|
|
80
97
|
|
|
81
98
|
Raises:
|
|
82
99
|
RuntimeError: 操作失败时抛出异常
|
|
@@ -84,8 +101,10 @@ class DisplayManager:
|
|
|
84
101
|
Examples:
|
|
85
102
|
>>> display_manager.set_view("top")
|
|
86
103
|
>>> display_manager.set_view("front")
|
|
104
|
+
>>> display_manager.set_view("zoom", 0.8)
|
|
105
|
+
>>> display_manager.set_view("move", 30, 10)
|
|
87
106
|
"""
|
|
88
|
-
self.control("view", view)
|
|
107
|
+
self.control("view", view, *values)
|
|
89
108
|
|
|
90
109
|
def set_plsm(self, enabled: Literal[0, 1] = 1) -> None:
|
|
91
110
|
"""显示开关(Plsm)。
|
|
@@ -104,6 +123,28 @@ class DisplayManager:
|
|
|
104
123
|
if not ok:
|
|
105
124
|
raise RuntimeError(f"设置 Plsm 失败: {err}")
|
|
106
125
|
|
|
126
|
+
def capture(self, path: str) -> None:
|
|
127
|
+
"""截图工具(对应 ``jpeg,...``)。
|
|
128
|
+
|
|
129
|
+
把当前画面截图保存到 ``path``。文件扩展名固定为 ``.jpg``。
|
|
130
|
+
若仅传入文件名(不含目录分隔符),图片默认保存到
|
|
131
|
+
``<project_dir>/image/{path}.jpg``;传入完整路径则保存到对应位置。
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
path: 图片保存路径或文件名
|
|
135
|
+
|
|
136
|
+
Raises:
|
|
137
|
+
RuntimeError: 截图失败时抛出异常
|
|
138
|
+
|
|
139
|
+
Examples:
|
|
140
|
+
>>> display_manager.capture("D:\\reports\\fig1.jpg")
|
|
141
|
+
>>> display_manager.capture("crack.jpg") # 保存到 <project_dir>/image/crack.jpg
|
|
142
|
+
>>> display_manager.capture("crack") # 保存到 <project_dir>/image/crack.jpg
|
|
143
|
+
"""
|
|
144
|
+
ok, err = osis_jpeg(path)
|
|
145
|
+
if not ok:
|
|
146
|
+
raise RuntimeError(f"截图失败: {err}")
|
|
147
|
+
|
|
107
148
|
def __repr__(self) -> str:
|
|
108
149
|
return "DisplayManager()"
|
|
109
150
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
支持的荷载类型:
|
|
9
9
|
- 荷载工况(USER, D, DC, DW, DD, CS)
|
|
10
|
-
-
|
|
10
|
+
- 静力荷载(自重、节点荷载、线荷载、面荷载、平面荷载、强迫位移、初始内力、温度荷载、预应力、索力)
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
from __future__ import annotations
|
|
@@ -54,11 +54,45 @@ from .static import (
|
|
|
54
54
|
osis_load_gtemp,
|
|
55
55
|
osis_load_pst,
|
|
56
56
|
osis_load_cforce,
|
|
57
|
+
osis_load_plane,
|
|
58
|
+
osis_planar_load_point,
|
|
59
|
+
osis_planar_load_line,
|
|
60
|
+
osis_planar_load_area,
|
|
61
|
+
osis_planar_load_copy,
|
|
57
62
|
osis_load_del,
|
|
58
63
|
osis_load_mod,
|
|
59
64
|
)
|
|
60
65
|
|
|
61
66
|
|
|
67
|
+
# ──────────────────────────────────────────────
|
|
68
|
+
# 内部工具
|
|
69
|
+
# ──────────────────────────────────────────────
|
|
70
|
+
|
|
71
|
+
def _flatten_params(items: list | None, size: int, label: str) -> list:
|
|
72
|
+
"""将平铺列表或分组列表统一展平(内部使用)
|
|
73
|
+
|
|
74
|
+
items 既支持 [v1, v2, v3, ...] 平铺形式,也支持 [[v1, v2, v3], ...] 分组形式,
|
|
75
|
+
每组必须包含 size 个参数,返回展平后的列表。
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
ValueError: 分组内参数数量不为 size 或平铺数量不是 size 的整数倍
|
|
79
|
+
"""
|
|
80
|
+
if not items:
|
|
81
|
+
return []
|
|
82
|
+
# 分组形式:元素为 list/tuple
|
|
83
|
+
if any(isinstance(it, (list, tuple)) for it in items):
|
|
84
|
+
flat = []
|
|
85
|
+
for it in items:
|
|
86
|
+
if not isinstance(it, (list, tuple)) or len(it) != size:
|
|
87
|
+
raise ValueError(f"{label} 必须按每组 {size} 个参数填入,当前为 {it!r}")
|
|
88
|
+
flat.extend(it)
|
|
89
|
+
return flat
|
|
90
|
+
# 平铺形式
|
|
91
|
+
if len(items) % size != 0:
|
|
92
|
+
raise ValueError(f"{label} 必须按每组 {size} 个参数平铺填入,当前数量为 {len(items)}")
|
|
93
|
+
return list(items)
|
|
94
|
+
|
|
95
|
+
|
|
62
96
|
# ──────────────────────────────────────────────
|
|
63
97
|
# 数据类
|
|
64
98
|
# ──────────────────────────────────────────────
|
|
@@ -216,6 +250,7 @@ class LoadCase:
|
|
|
216
250
|
CONCENTRATED -> create_concentrated_force
|
|
217
251
|
SURFACE -> create_surface_load
|
|
218
252
|
SURFACE_VEC -> create_surface_load_vector
|
|
253
|
+
PLANE -> create_plane_load
|
|
219
254
|
PTF/PTM -> create_concentrated_force (is_moment)
|
|
220
255
|
|
|
221
256
|
Args:
|
|
@@ -245,6 +280,7 @@ class LoadCase:
|
|
|
245
280
|
# "PTM": self.create_concentrated_force,
|
|
246
281
|
"SURFACE": self.create_surface_load,
|
|
247
282
|
"SURFACE_VEC": self.create_surface_load_vector,
|
|
283
|
+
"PLANE": self.create_plane_load,
|
|
248
284
|
}
|
|
249
285
|
type_key = type.strip().upper()
|
|
250
286
|
|
|
@@ -735,6 +771,78 @@ class LoadCase:
|
|
|
735
771
|
)
|
|
736
772
|
return self.refresh()
|
|
737
773
|
|
|
774
|
+
def create_plane_load(
|
|
775
|
+
self,
|
|
776
|
+
planar_load_name: str,
|
|
777
|
+
elem_type: str,
|
|
778
|
+
p1: tuple[float, float, float] = (0.0, 0.0, 0.0),
|
|
779
|
+
p2: tuple[float, float, float] = (1.0, 0.0, 0.0),
|
|
780
|
+
p3: tuple[float, float, float] = (0.0, 1.0, 0.0),
|
|
781
|
+
tolerance: float = 0.0,
|
|
782
|
+
load_position: Literal[0, 1] = 1,
|
|
783
|
+
elem_group: str = "",
|
|
784
|
+
load_surface: str = "",
|
|
785
|
+
direction: Literal["SurfaceN", "ElementN", "GlobalX", "GlobalY", "GlobalZ"] = "SurfaceN",
|
|
786
|
+
projection: Literal["NoProjection", "LoadDir", "LoadPlane"] = "NoProjection",
|
|
787
|
+
copy_op: Literal[0, 1] = 0,
|
|
788
|
+
copy_dir: Literal["X", "Y", "Z"] = "X",
|
|
789
|
+
copies: list | None = None,
|
|
790
|
+
) -> LoadCase:
|
|
791
|
+
'''布置平面荷载(需先由 osis_planar_load_* 定义平面荷载)
|
|
792
|
+
|
|
793
|
+
Args:
|
|
794
|
+
planar_load_name (str): 定义的平面荷载名称,由 PlanarLoad 定义
|
|
795
|
+
elem_type (str): 要加载平面荷载的单元类型
|
|
796
|
+
p1 (tuple): 加载平面原点在整体坐标系中的坐标 (x, y, z)
|
|
797
|
+
p2 (tuple): 平面坐标系x轴上的任意点在整体坐标系中的坐标 (x, y, z)
|
|
798
|
+
p3 (tuple): 平面坐标系x-y平面上任意点在整体坐标系中的坐标 (x, y, z)
|
|
799
|
+
tolerance (float): 决定平面坐标系坐标的容许误差
|
|
800
|
+
load_position (int): 加载对象
|
|
801
|
+
* 1 = 加载平面上的单元
|
|
802
|
+
* 0 = 单元组
|
|
803
|
+
elem_group (str): 单元组名称,load_position = 0 时必填
|
|
804
|
+
load_surface (str): 实体单元加载面(1~6),平面单元无用填 ""
|
|
805
|
+
direction (str): 平面荷载加载方向
|
|
806
|
+
* SurfaceN = 法向(加载平面)
|
|
807
|
+
* ElementN = 法向(单元)
|
|
808
|
+
* GlobalX = 整体坐标系X
|
|
809
|
+
* GlobalY = 整体坐标系Y
|
|
810
|
+
* GlobalZ = 整体坐标系Z
|
|
811
|
+
projection (str): 投影选项
|
|
812
|
+
* NoProjection = 不投影
|
|
813
|
+
* LoadDir = 荷载方向
|
|
814
|
+
* LoadPlane = 加载平面
|
|
815
|
+
copy_op (int): 是否根据输入间距将平面荷载以相同大小复制到其他区域
|
|
816
|
+
* 1 = 复制
|
|
817
|
+
* 0 = 不复制
|
|
818
|
+
copy_dir (str): 复制方向,X、Y、Z
|
|
819
|
+
copies (list): 复制的次数与距离,支持两种形式:
|
|
820
|
+
* 分组:[[CopyCount1, CopyDistance1], ...]
|
|
821
|
+
* 平铺:[CopyCount1, CopyDistance1, ...]
|
|
822
|
+
每组包含2个参数:复制的次数, 复制的距离
|
|
823
|
+
|
|
824
|
+
Returns:
|
|
825
|
+
更新后的 LoadCase 对象
|
|
826
|
+
|
|
827
|
+
Raises:
|
|
828
|
+
ValueError: load_position = 0 未填 elem_group,或 copies 参数数量不成对
|
|
829
|
+
RuntimeError: 布置失败时抛出异常
|
|
830
|
+
'''
|
|
831
|
+
if load_position == 0 and not elem_group:
|
|
832
|
+
raise ValueError("load_position = 0(按单元组加载)时必须指定 elem_group")
|
|
833
|
+
|
|
834
|
+
flat_copies = _flatten_params(copies, 2, "copies") if copy_op == 1 else []
|
|
835
|
+
|
|
836
|
+
ok, err = osis_load_plane(
|
|
837
|
+
"Plane", self.name, planar_load_name, elem_type,
|
|
838
|
+
p1[0], p1[1], p1[2], p2[0], p2[1], p2[2], p3[0], p3[1], p3[2],
|
|
839
|
+
tolerance, load_position, elem_group, load_surface,
|
|
840
|
+
direction, projection, copy_op, copy_dir, flat_copies,
|
|
841
|
+
)
|
|
842
|
+
if not ok:
|
|
843
|
+
raise RuntimeError(f"布置平面荷载 {planar_load_name} 到工况 {self.name} 失败: {err}")
|
|
844
|
+
return self.refresh()
|
|
845
|
+
|
|
738
846
|
# ── 荷载删除 ──────────────────────────────
|
|
739
847
|
|
|
740
848
|
def delete(
|
|
@@ -1763,7 +1871,7 @@ class TendonManager:
|
|
|
1763
1871
|
class LoadCaseManager:
|
|
1764
1872
|
"""荷载工况管理器
|
|
1765
1873
|
|
|
1766
|
-
|
|
1874
|
+
统一管理荷载工况的创建、删除、修改和查询,兼平面荷载的定义(PlanarLoad)。
|
|
1767
1875
|
|
|
1768
1876
|
用法:
|
|
1769
1877
|
>>> from pyosis.load import loadcase_manager
|
|
@@ -1884,6 +1992,141 @@ class LoadCaseManager:
|
|
|
1884
1992
|
raise RuntimeError(f"重命名荷载工况 {old_name} -> {new_name} 失败: {err}")
|
|
1885
1993
|
return self.get(new_name)
|
|
1886
1994
|
|
|
1995
|
+
# ── 平面荷载定义 ────────────────────────
|
|
1996
|
+
|
|
1997
|
+
def planar_load_point(self, name: str, description: str = "", points: list = None) -> str:
|
|
1998
|
+
'''定义平面荷载(集中荷载)
|
|
1999
|
+
|
|
2000
|
+
Args:
|
|
2001
|
+
name (str): 荷载名称
|
|
2002
|
+
description (str): 荷载说明
|
|
2003
|
+
points (list): 集中荷载的坐标与数值,支持两种形式:
|
|
2004
|
+
* 分组:[[x1, y1, F1], [x2, y2, F2], ...]
|
|
2005
|
+
* 平铺:[x1, y1, F1, x2, y2, F2, ...]
|
|
2006
|
+
每组包含3个参数:x坐标, y坐标, 荷载数值,组数不限
|
|
2007
|
+
|
|
2008
|
+
Returns:
|
|
2009
|
+
荷载名称字符串
|
|
2010
|
+
|
|
2011
|
+
Raises:
|
|
2012
|
+
ValueError: points 为空或参数数量不符
|
|
2013
|
+
RuntimeError: 创建失败时抛出异常
|
|
2014
|
+
'''
|
|
2015
|
+
flat = _flatten_params(points, 3, "points")
|
|
2016
|
+
if not flat:
|
|
2017
|
+
raise ValueError("points 不能为空,至少需要一组 [x, y, F]")
|
|
2018
|
+
ok, err = osis_planar_load_point(name, description, "Point", flat)
|
|
2019
|
+
if not ok:
|
|
2020
|
+
raise RuntimeError(f"创建平面荷载(集中荷载){name} 失败: {err}")
|
|
2021
|
+
return name
|
|
2022
|
+
|
|
2023
|
+
def planar_load_line(
|
|
2024
|
+
self,
|
|
2025
|
+
name: str,
|
|
2026
|
+
description: str = "",
|
|
2027
|
+
uniform: Literal[0, 1] = 1,
|
|
2028
|
+
force_type: Literal[0, 1] = 1,
|
|
2029
|
+
x1: float = 0.0,
|
|
2030
|
+
y1: float = 0.0,
|
|
2031
|
+
f1: float = 100,
|
|
2032
|
+
x2: float = 1.0,
|
|
2033
|
+
y2: float = 0.0,
|
|
2034
|
+
f2: float = 100,
|
|
2035
|
+
) -> str:
|
|
2036
|
+
'''定义平面荷载(线荷载)
|
|
2037
|
+
|
|
2038
|
+
Args:
|
|
2039
|
+
name (str): 荷载名称
|
|
2040
|
+
description (str): 荷载说明
|
|
2041
|
+
uniform (int): 1 = 均布荷载,0 = 非均布荷载
|
|
2042
|
+
force_type (int): 1 = 力,0 = 弯矩
|
|
2043
|
+
x1 (float): 线荷载起点的x坐标
|
|
2044
|
+
y1 (float): 线荷载起点的y坐标
|
|
2045
|
+
f1 (float): 线荷载起点的荷载数值
|
|
2046
|
+
x2 (float): 线荷载终点的x坐标
|
|
2047
|
+
y2 (float): 线荷载终点的y坐标
|
|
2048
|
+
f2 (float): 线荷载终点的荷载数值
|
|
2049
|
+
|
|
2050
|
+
Returns:
|
|
2051
|
+
荷载名称字符串
|
|
2052
|
+
|
|
2053
|
+
Raises:
|
|
2054
|
+
RuntimeError: 创建失败时抛出异常
|
|
2055
|
+
'''
|
|
2056
|
+
ok, err = osis_planar_load_line(
|
|
2057
|
+
name, description, "Line", uniform, force_type, x1, y1, f1, x2, y2, f2
|
|
2058
|
+
)
|
|
2059
|
+
if not ok:
|
|
2060
|
+
raise RuntimeError(f"创建平面荷载(线荷载){name} 失败: {err}")
|
|
2061
|
+
return name
|
|
2062
|
+
|
|
2063
|
+
def planar_load_area(
|
|
2064
|
+
self,
|
|
2065
|
+
name: str,
|
|
2066
|
+
description: str = "",
|
|
2067
|
+
uniform: Literal[0, 1] = 1,
|
|
2068
|
+
points: list = None,
|
|
2069
|
+
) -> str:
|
|
2070
|
+
'''定义平面荷载(面荷载)
|
|
2071
|
+
|
|
2072
|
+
Args:
|
|
2073
|
+
name (str): 荷载名称
|
|
2074
|
+
description (str): 荷载说明
|
|
2075
|
+
uniform (int): 1 = 均布荷载,0 = 非均布荷载
|
|
2076
|
+
points (list): 面荷载各点处的坐标与数值(3点或4点),支持两种形式:
|
|
2077
|
+
* 分组:[[x1, y1, F1], [x2, y2, F2], ...]
|
|
2078
|
+
* 平铺:[x1, y1, F1, x2, y2, F2, ...]
|
|
2079
|
+
每组包含3个参数:x坐标, y坐标, 荷载数值
|
|
2080
|
+
|
|
2081
|
+
Returns:
|
|
2082
|
+
荷载名称字符串
|
|
2083
|
+
|
|
2084
|
+
Raises:
|
|
2085
|
+
ValueError: points 点数不为 3 或 4,或参数数量不符
|
|
2086
|
+
RuntimeError: 创建失败时抛出异常
|
|
2087
|
+
'''
|
|
2088
|
+
flat = _flatten_params(points, 3, "points")
|
|
2089
|
+
n_point_num = len(flat) // 3
|
|
2090
|
+
if n_point_num not in (3, 4):
|
|
2091
|
+
raise ValueError(f"面荷载点数必须为 3 或 4,当前为 {n_point_num}")
|
|
2092
|
+
ok, err = osis_planar_load_area(name, description, "Area", uniform, n_point_num, flat)
|
|
2093
|
+
if not ok:
|
|
2094
|
+
raise RuntimeError(f"创建平面荷载(面荷载){name} 失败: {err}")
|
|
2095
|
+
return name
|
|
2096
|
+
|
|
2097
|
+
def planar_load_copy(
|
|
2098
|
+
self,
|
|
2099
|
+
name: str,
|
|
2100
|
+
direction: Literal["X", "Y"] = "X",
|
|
2101
|
+
copies: list = None,
|
|
2102
|
+
) -> str:
|
|
2103
|
+
'''复制平面荷载
|
|
2104
|
+
|
|
2105
|
+
Args:
|
|
2106
|
+
name (str): 荷载名称
|
|
2107
|
+
direction (str): 复制方向
|
|
2108
|
+
* X
|
|
2109
|
+
* Y
|
|
2110
|
+
copies (list): 复制的次数与距离,支持两种形式:
|
|
2111
|
+
* 分组:[[CopyCount1, CopyDistance1], ...]
|
|
2112
|
+
* 平铺:[CopyCount1, CopyDistance1, ...]
|
|
2113
|
+
每组包含2个参数:复制的次数, 复制的距离
|
|
2114
|
+
|
|
2115
|
+
Returns:
|
|
2116
|
+
荷载名称字符串
|
|
2117
|
+
|
|
2118
|
+
Raises:
|
|
2119
|
+
ValueError: copies 为空或参数数量不成对
|
|
2120
|
+
RuntimeError: 复制失败时抛出异常
|
|
2121
|
+
'''
|
|
2122
|
+
flat = _flatten_params(copies, 2, "copies")
|
|
2123
|
+
if not flat:
|
|
2124
|
+
raise ValueError("copies 不能为空,至少需要一组 [次数, 距离]")
|
|
2125
|
+
ok, err = osis_planar_load_copy(name, direction, flat)
|
|
2126
|
+
if not ok:
|
|
2127
|
+
raise RuntimeError(f"复制平面荷载 {name} 失败: {err}")
|
|
2128
|
+
return name
|
|
2129
|
+
|
|
1887
2130
|
# ── 查询 ──────────────────────────────────
|
|
1888
2131
|
|
|
1889
2132
|
def get(self, name: str | list[str]) -> LoadCase | list[LoadCase | None] | None:
|
|
@@ -370,6 +370,137 @@ def osis_load_cforce(eType: str="CFORCE", strLCName: str="自定义工况1", nEn
|
|
|
370
370
|
'''
|
|
371
371
|
pass
|
|
372
372
|
|
|
373
|
+
@REGISTRY.register("PlanarLoad")
|
|
374
|
+
def osis_planar_load_point(strName: str="平面荷载1", strDescription: str="", eType: Literal["Point"]="Point", points: list=None):
|
|
375
|
+
'''
|
|
376
|
+
创建或修改平面荷载(集中荷载)
|
|
377
|
+
|
|
378
|
+
Args:
|
|
379
|
+
strName (str): 荷载名称
|
|
380
|
+
strDescription (str): 荷载说明
|
|
381
|
+
eType (str): 荷载类型,不区分大小写。固定为 Point = 集中荷载
|
|
382
|
+
points (list): 集中荷载的坐标与数值,按顺序平铺填入:
|
|
383
|
+
[x1, y1, F1, x2, y2, F2, ...]
|
|
384
|
+
每组包含3个参数:x坐标, y坐标, 荷载数值,组数不限
|
|
385
|
+
Returns:
|
|
386
|
+
tuple (bool, str): 是否成功,失败原因
|
|
387
|
+
'''
|
|
388
|
+
pass
|
|
389
|
+
|
|
390
|
+
@REGISTRY.register("PlanarLoad")
|
|
391
|
+
def osis_planar_load_line(strName: str="平面荷载1", strDescription: str="", eType: Literal["Line"]="Line",
|
|
392
|
+
bUniform: Literal[0, 1]=1, bForceType: Literal[0, 1]=1,
|
|
393
|
+
dX1: float=0.0, dY1: float=0.0, dF1: float=100,
|
|
394
|
+
dX2: float=1.0, dY2: float=0.0, dF2: float=100):
|
|
395
|
+
'''
|
|
396
|
+
创建或修改平面荷载(线荷载)
|
|
397
|
+
|
|
398
|
+
Args:
|
|
399
|
+
strName (str): 荷载名称
|
|
400
|
+
strDescription (str): 荷载说明
|
|
401
|
+
eType (str): 荷载类型,不区分大小写。固定为 Line = 线荷载
|
|
402
|
+
bUniform (int): 1 = 均布荷载,0 = 非均布荷载
|
|
403
|
+
bForceType (int): 1 = 力,0 = 弯矩
|
|
404
|
+
dX1 (float): 线荷载起点的x坐标
|
|
405
|
+
dY1 (float): 线荷载起点的y坐标
|
|
406
|
+
dF1 (float): 线荷载起点的荷载数值
|
|
407
|
+
dX2 (float): 线荷载终点的x坐标
|
|
408
|
+
dY2 (float): 线荷载终点的y坐标
|
|
409
|
+
dF2 (float): 线荷载终点的荷载数值
|
|
410
|
+
Returns:
|
|
411
|
+
tuple (bool, str): 是否成功,失败原因
|
|
412
|
+
'''
|
|
413
|
+
pass
|
|
414
|
+
|
|
415
|
+
@REGISTRY.register("PlanarLoad")
|
|
416
|
+
def osis_planar_load_area(strName: str="平面荷载1", strDescription: str="", eType: Literal["Area"]="Area",
|
|
417
|
+
bUniform: Literal[0, 1]=1, nPointNum: Literal[3, 4]=3, points: list=None):
|
|
418
|
+
'''
|
|
419
|
+
创建或修改平面荷载(面荷载)
|
|
420
|
+
|
|
421
|
+
Args:
|
|
422
|
+
strName (str): 荷载名称
|
|
423
|
+
strDescription (str): 荷载说明
|
|
424
|
+
eType (str): 荷载类型,不区分大小写。固定为 Area = 面荷载
|
|
425
|
+
bUniform (int): 1 = 均布荷载,0 = 非均布荷载
|
|
426
|
+
nPointNum (int): 点数,3 = 3点,4 = 4点,其他输入非法
|
|
427
|
+
points (list): 面荷载各点处的坐标与数值,按顺序平铺填入:
|
|
428
|
+
[x1, y1, F1, x2, y2, F2, x3, y3, F3](nPointNum = 3)
|
|
429
|
+
[x1, y1, F1, x2, y2, F2, x3, y3, F3, x4, y4, F4](nPointNum = 4)
|
|
430
|
+
每组包含3个参数:x坐标, y坐标, 荷载数值
|
|
431
|
+
Returns:
|
|
432
|
+
tuple (bool, str): 是否成功,失败原因
|
|
433
|
+
'''
|
|
434
|
+
pass
|
|
435
|
+
|
|
436
|
+
@REGISTRY.register("PlanarLoadCopy")
|
|
437
|
+
def osis_planar_load_copy(strName: str="平面荷载1", eDir: Literal["X", "Y"]="X", copies: list=None):
|
|
438
|
+
'''
|
|
439
|
+
复制平面荷载
|
|
440
|
+
|
|
441
|
+
Args:
|
|
442
|
+
strName (str): 荷载名称
|
|
443
|
+
eDir (str): 复制方向
|
|
444
|
+
* X
|
|
445
|
+
* Y
|
|
446
|
+
copies (list): 复制的次数与距离,按顺序平铺填入:
|
|
447
|
+
[CopyCount1, CopyDistance1, ..., CopyCountN, CopyDistanceN]
|
|
448
|
+
每组包含2个参数:复制的次数, 复制的距离
|
|
449
|
+
Returns:
|
|
450
|
+
tuple (bool, str): 是否成功,失败原因
|
|
451
|
+
'''
|
|
452
|
+
pass
|
|
453
|
+
|
|
454
|
+
@REGISTRY.register("Load")
|
|
455
|
+
def osis_load_plane(eType: Literal["Plane"]="Plane", strLCName: str="自定义工况1", strPlanarLoadName: str="平面荷载1",
|
|
456
|
+
strElemType: str="",
|
|
457
|
+
dP1x: float=0.0, dP1y: float=0.0, dP1z: float=0.0,
|
|
458
|
+
dP2x: float=1.0, dP2y: float=0.0, dP2z: float=0.0,
|
|
459
|
+
dP3x: float=0.0, dP3y: float=1.0, dP3z: float=0.0,
|
|
460
|
+
dTolerance: float=0.0,
|
|
461
|
+
bLoadPosition: Literal[0, 1]=1, strElemGroup: str="", strLoadSurface: str="",
|
|
462
|
+
eDir: Literal["SurfaceN", "ElementN", "GlobalX", "GlobalY", "GlobalZ"]="SurfaceN",
|
|
463
|
+
eProjectionOp: Literal["NoProjection", "LoadDir", "LoadPlane"]="NoProjection",
|
|
464
|
+
bCopyOp: Literal[0, 1]=0, eCopyDir: str="", copies: list=None):
|
|
465
|
+
'''
|
|
466
|
+
布置平面荷载
|
|
467
|
+
|
|
468
|
+
Args:
|
|
469
|
+
eType (str): 荷载类型,不区分大小写。固定为 Plane = 平面荷载
|
|
470
|
+
strLCName (str): 荷载工况名称
|
|
471
|
+
strPlanarLoadName (str): 定义的平面荷载名称,由 PlanarLoad 定义
|
|
472
|
+
strElemType (str): 要加载平面荷载的单元类型
|
|
473
|
+
dP1x/dP1y/dP1z (float): 加载平面原点P1在整体坐标系中的坐标
|
|
474
|
+
dP2x/dP2y/dP2z (float): 平面坐标系x轴上的任意点P2在整体坐标系中的坐标
|
|
475
|
+
dP3x/dP3y/dP3z (float): 平面坐标系x-y平面上任意点P3在整体坐标系中的坐标
|
|
476
|
+
dTolerance (float): 决定平面坐标系坐标的容许误差
|
|
477
|
+
bLoadPosition (int): 加载对象
|
|
478
|
+
* 1 = 加载平面上的单元
|
|
479
|
+
* 0 = 单元组
|
|
480
|
+
strElemGroup (str): 单元组名称,bLoadPosition = 0 时有效,无效时填 ""
|
|
481
|
+
strLoadSurface (str): 实体单元加载面(1~6),平面单元无用,填 ""
|
|
482
|
+
eDir (str): 平面荷载加载方向
|
|
483
|
+
* SurfaceN = 法向(加载平面)
|
|
484
|
+
* ElementN = 法向(单元)
|
|
485
|
+
* GlobalX = 整体坐标系X
|
|
486
|
+
* GlobalY = 整体坐标系Y
|
|
487
|
+
* GlobalZ = 整体坐标系Z
|
|
488
|
+
eProjectionOp (str): 投影选项
|
|
489
|
+
* NoProjection = 不投影
|
|
490
|
+
* LoadDir = 荷载方向
|
|
491
|
+
* LoadPlane = 加载平面
|
|
492
|
+
bCopyOp (int): 是否根据输入间距将平面荷载以相同大小复制到其他区域
|
|
493
|
+
* 1 = 复制
|
|
494
|
+
* 0 = 不复制
|
|
495
|
+
eCopyDir (str): 复制方向,X、Y、Z。bCopyOp = 0 时填 ""
|
|
496
|
+
copies (list): 复制的次数与距离,按顺序平铺填入:
|
|
497
|
+
[CopyCount1, CopyDistance1, ..., CopyCountN, CopyDistanceN]
|
|
498
|
+
每组包含2个参数:复制的次数, 复制的距离
|
|
499
|
+
Returns:
|
|
500
|
+
tuple (bool, str): 是否成功,失败原因
|
|
501
|
+
'''
|
|
502
|
+
pass
|
|
503
|
+
|
|
373
504
|
@REGISTRY.register("LoadDel")
|
|
374
505
|
def osis_load_del(eType: Literal["GRAVITY", "NFORCE", "LINE", "DISPLACEMENT", "INITIAL", "UTEMP", "GTEMP", "PST", "CFORCE"]="NFORCE", strLCName: str="自定义工况1", entity: int|str=1):
|
|
375
506
|
'''
|
|
@@ -9,7 +9,10 @@ def osis_assign_component_thickness(dThickness: float, strOp: Literal['a', 's',
|
|
|
9
9
|
|
|
10
10
|
Args:
|
|
11
11
|
dThickness (float): 构件理论厚度
|
|
12
|
-
strOp (str):
|
|
12
|
+
strOp (str): 操作
|
|
13
|
+
* a = 添加,再次调用会覆盖旧参数
|
|
14
|
+
* s = 替换
|
|
15
|
+
* r = 移除
|
|
13
16
|
*strElem (str): 待分配单元的编号。注:定义、修改、删除 elem支持的格式:*to*
|
|
14
17
|
|
|
15
18
|
Returns:
|
|
@@ -890,11 +890,14 @@ class PropertyManager:
|
|
|
890
890
|
Args:
|
|
891
891
|
thickness (float): 构件理论厚度
|
|
892
892
|
op (str): 操作
|
|
893
|
-
* a =
|
|
893
|
+
* a = 添加,再次调用会覆盖旧参数
|
|
894
894
|
* s = 替换
|
|
895
895
|
* r = 移除
|
|
896
896
|
*elems (str|int): 待分配单元的编号。定义、修改、删除 elem 支持的格式:*to*
|
|
897
897
|
|
|
898
|
+
Examples:
|
|
899
|
+
>>> assign_component_thickness(0.2, s, 1, 2, 3) # 将 1 2 3号单元的厚度修改为 0.2
|
|
900
|
+
|
|
898
901
|
Raises:
|
|
899
902
|
RuntimeError: 分配失败时抛出
|
|
900
903
|
'''
|
|
@@ -100,8 +100,8 @@ class SectionType(Enum):
|
|
|
100
100
|
RIBBEDSLAB = 13 # 肋板式
|
|
101
101
|
CUSTOM = 14 # 常规自定义截面
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
STEELBEAMI = 21 # 工字钢梁截面
|
|
104
|
+
STEELBEAMBOX = 22 # 箱型钢梁截面
|
|
105
105
|
STEELBOXTHREECELL = 23 # 单箱单/三室钢梁截面
|
|
106
106
|
STEELBOXITF = 24 # 单箱单室斜顶板钢梁界面
|
|
107
107
|
STEELCANTIBOX = 25 # 悬臂单箱单/双室钢梁界面
|
|
@@ -112,9 +112,26 @@ class SectionType(Enum):
|
|
|
112
112
|
COMPOSITESTEELI = 41 # 钢-工字型组合截面
|
|
113
113
|
COMPOSITESTEELTROUGH = 42 # 钢-槽型组合截面
|
|
114
114
|
COMPOSITESTEELBOX = 43 # 钢-箱型组合截面
|
|
115
|
-
COMPOSITECUSTOM = 44 # 自定义组合截面
|
|
116
115
|
|
|
117
|
-
|
|
116
|
+
COMPOSITECUSTOM = 61 # 自定义组合截面
|
|
117
|
+
|
|
118
|
+
NUMERICAL = 71 # 数值截面
|
|
119
|
+
|
|
120
|
+
BUDOUBLEANGLE = 81 # 双角钢截面
|
|
121
|
+
BUDOUBLEC = 82 # 双槽钢截面
|
|
122
|
+
BUDOUBLEH = 83 # 双H型钢截面
|
|
123
|
+
BUDOUBLECWEB1 = 84 # 双槽钢+腹板截面1
|
|
124
|
+
BUDOUBLECWEB2 = 85 # 双槽钢+腹板截面2
|
|
125
|
+
BUHWITHPLATES = 86 # H型钢+双板截面
|
|
126
|
+
|
|
127
|
+
STEELL = 100 # 型钢-L型
|
|
128
|
+
STEELC = 101 # 型钢-槽型
|
|
129
|
+
STEELI = 102 # 型钢-工字型
|
|
130
|
+
STEELBOX = 103 # 型钢-箱型
|
|
131
|
+
STEELT = 104 # 型钢-T型
|
|
132
|
+
STEELCC = 105 # 型钢-双C型
|
|
133
|
+
STEELCIRCULARHOLLOW = 106 # 型钢-圆管
|
|
134
|
+
STEELZ = 107 # 型钢-Z型
|
|
118
135
|
|
|
119
136
|
@dataclass(frozen=False)
|
|
120
137
|
class Rebar:
|
|
@@ -1105,7 +1122,7 @@ class SectionManager:
|
|
|
1105
1122
|
Args:
|
|
1106
1123
|
no: 截面编号,None 则自动分配
|
|
1107
1124
|
name: 截面名称
|
|
1108
|
-
type: OSIS 截面类型,如 "CIRCLE" / "RECT" / "
|
|
1125
|
+
type: OSIS 截面类型,如 "CIRCLE" / "RECT" / "STEELBEAMBOX" 等
|
|
1109
1126
|
*args: 按位置传给对应 create_* 的参数
|
|
1110
1127
|
**kwargs: 按关键字传给对应 create_* 的参数
|
|
1111
1128
|
Raises:
|
|
@@ -1127,8 +1144,8 @@ class SectionManager:
|
|
|
1127
1144
|
"TGIRDER": self.create_TGirder,
|
|
1128
1145
|
"HOLLOWSLAB": self.create_hollowslab,
|
|
1129
1146
|
"CUSTOM": self.create_custom,
|
|
1130
|
-
"
|
|
1131
|
-
"
|
|
1147
|
+
"STEELBEAMI": self.create_steel_i,
|
|
1148
|
+
"STEELBEAMBOX": self.create_steel_box,
|
|
1132
1149
|
"STEELBOXTHREECELL": self.create_steel_box_three_cell,
|
|
1133
1150
|
"STEELBOXITF": self.create_steel_box_itf,
|
|
1134
1151
|
"STEELCANTIBOX": self.create_steel_canti_box,
|
|
@@ -1918,7 +1935,7 @@ class SectionManager:
|
|
|
1918
1935
|
tw: float,
|
|
1919
1936
|
web_rib_pos: Literal["Left", "Right", "Both"] = "Both",
|
|
1920
1937
|
) -> Section:
|
|
1921
|
-
"""
|
|
1938
|
+
"""创建工字钢梁截面(STEELBEAMI)。
|
|
1922
1939
|
|
|
1923
1940
|
Args:
|
|
1924
1941
|
no: 截面编号,不填则自动分配
|
|
@@ -1933,7 +1950,7 @@ class SectionManager:
|
|
|
1933
1950
|
"""
|
|
1934
1951
|
if no is None:
|
|
1935
1952
|
no = self._next_no()
|
|
1936
|
-
ok, err = osis_section_steel_i(no, name, "
|
|
1953
|
+
ok, err = osis_section_steel_i(no, name, "STEELBEAMI", h, bt, bb, tt, tb, tw, web_rib_pos)
|
|
1937
1954
|
if not ok:
|
|
1938
1955
|
raise RuntimeError(f"创建工字形钢截面 {no} 失败: {err}")
|
|
1939
1956
|
return self.get(no)
|
|
@@ -1952,7 +1969,7 @@ class SectionManager:
|
|
|
1952
1969
|
tw: float,
|
|
1953
1970
|
same_layout: Literal[0, 1] = 1,
|
|
1954
1971
|
) -> Section:
|
|
1955
|
-
"""
|
|
1972
|
+
"""创建箱型钢梁截面(STEELBEAMBOX)。
|
|
1956
1973
|
|
|
1957
1974
|
Args:
|
|
1958
1975
|
no: 截面编号,不填则自动分配
|
|
@@ -1969,7 +1986,7 @@ class SectionManager:
|
|
|
1969
1986
|
"""
|
|
1970
1987
|
if no is None:
|
|
1971
1988
|
no = self._next_no()
|
|
1972
|
-
ok, err = osis_section_steel_box(no, name, "
|
|
1989
|
+
ok, err = osis_section_steel_box(no, name, "STEELBEAMBOX", h, bt, bct, bb, bcb, tt, tb, tw, same_layout)
|
|
1973
1990
|
if not ok:
|
|
1974
1991
|
raise RuntimeError(f"创建箱型钢截面 {no} 失败: {err}")
|
|
1975
1992
|
return self.get(no)
|
|
@@ -2,15 +2,15 @@ from typing import Any, Dict, Literal, List
|
|
|
2
2
|
from ..core import REGISTRY
|
|
3
3
|
|
|
4
4
|
@REGISTRY.register("Section")
|
|
5
|
-
def osis_section_steel_i(Index: int, Name: str, Type: Literal["
|
|
6
|
-
H: float, Bt: float, Bb: float, Tt: float, Tb: float, Tw: float,
|
|
5
|
+
def osis_section_steel_i(Index: int, Name: str, Type: Literal["STEELBEAMI"],
|
|
6
|
+
H: float, Bt: float, Bb: float, Tt: float, Tb: float, Tw: float,
|
|
7
7
|
WebRibPos: Literal["Left", "Right", "Both"]):
|
|
8
|
-
"""
|
|
8
|
+
"""定义或修改工字钢梁截面。
|
|
9
9
|
|
|
10
10
|
Args:
|
|
11
11
|
Index (int): 编号。
|
|
12
12
|
Name (str): 截面名。
|
|
13
|
-
Type (str): 截面类型,固定为
|
|
13
|
+
Type (str): 截面类型,固定为 STEELBEAMI。
|
|
14
14
|
H (float): 梁高。
|
|
15
15
|
Bt (float): 上翼缘宽度。
|
|
16
16
|
Bb (float): 下翼缘宽度。
|
|
@@ -27,15 +27,15 @@ def osis_section_steel_i(Index: int, Name: str, Type: Literal["STEELI"],
|
|
|
27
27
|
pass
|
|
28
28
|
|
|
29
29
|
@REGISTRY.register("Section")
|
|
30
|
-
def osis_section_steel_box(Index: int, Name: str, Type: Literal["
|
|
31
|
-
H: float, Bt: float, Bct: float, Bb: float, Bcb: float,
|
|
30
|
+
def osis_section_steel_box(Index: int, Name: str, Type: Literal["STEELBEAMBOX"],
|
|
31
|
+
H: float, Bt: float, Bct: float, Bb: float, Bcb: float,
|
|
32
32
|
Tt: float, Tb: float, Tw: float, SameLayout: Literal[0, 1]):
|
|
33
|
-
"""
|
|
33
|
+
"""定义或修改箱型钢梁截面。
|
|
34
34
|
|
|
35
35
|
Args:
|
|
36
36
|
Index (int): 编号。
|
|
37
37
|
Name (str): 截面名。
|
|
38
|
-
Type (str): 截面类型,固定为
|
|
38
|
+
Type (str): 截面类型,固定为 STEELBEAMBOX。
|
|
39
39
|
H (float): 梁高。
|
|
40
40
|
Bt (float): 上翼缘宽度。
|
|
41
41
|
Bct (float): 上翼缘悬出宽。
|
|
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
|