osis-python 0.2.0__tar.gz → 0.2.2__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.2.0/src/osis_python.egg-info → osis_python-0.2.2}/PKG-INFO +3 -10
- {osis_python-0.2.0 → osis_python-0.2.2}/README.md +2 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/pyproject.toml +1 -10
- {osis_python-0.2.0 → osis_python-0.2.2/src/osis_python.egg-info}/PKG-INFO +3 -10
- {osis_python-0.2.0 → osis_python-0.2.2}/src/osis_python.egg-info/SOURCES.txt +16 -3
- osis_python-0.2.2/src/osis_python.egg-info/requires.txt +11 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/__init__.py +2 -2
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/boundary/interface.py +12 -0
- osis_python-0.2.2/src/pyosis/common/__init__.py +2 -0
- osis_python-0.2.2/src/pyosis/common/project.py +54 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/core/PyInterface.pyi +1 -6
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/core/__init__.py +0 -1
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/core/all_func.py +3 -1
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/core/client.py +2 -3
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/element/interface.py +78 -2
- osis_python-0.2.2/src/pyosis/io/__init__.py +10 -0
- osis_python-0.2.2/src/pyosis/io/boundary_info.py +239 -0
- osis_python-0.2.2/src/pyosis/io/coordinate.py +98 -0
- osis_python-0.2.2/src/pyosis/io/element_info.py +489 -0
- osis_python-0.2.2/src/pyosis/io/group_info.py +82 -0
- osis_python-0.2.2/src/pyosis/io/material_info.py +39 -0
- osis_python-0.2.2/src/pyosis/io/node_info.py +192 -0
- osis_python-0.2.2/src/pyosis/io/prestressed_info.py +170 -0
- osis_python-0.2.2/src/pyosis/io/response.py +135 -0
- osis_python-0.2.2/src/pyosis/io/section_info.py +162 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/load/static.py +52 -0
- osis_python-0.2.2/src/pyosis/post/__init__.py +3 -0
- osis_python-0.2.2/src/pyosis/post/check.py +116 -0
- osis_python-0.2.2/src/pyosis/post/env.py +37 -0
- osis_python-0.2.2/src/pyosis/post/loadcase.py +58 -0
- osis_python-0.2.2/src/pyosis/post/result.py +42 -0
- osis_python-0.2.2/src/pyosis/property/comp_thickness.py +21 -0
- osis_python-0.2.2/src/pyosis/property/coordinate.py +88 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/section/__init__.py +1 -2
- osis_python-0.2.2/src/pyosis/section/numeric.py +34 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/section/param.py +18 -0
- osis_python-0.2.2/src/pyosis/thickness/interface.py +50 -0
- osis_python-0.2.0/src/osis_python.egg-info/requires.txt +0 -20
- osis_python-0.2.0/src/pyosis/core/project.py +0 -8
- osis_python-0.2.0/src/pyosis/post/__init__.py +0 -2
- osis_python-0.2.0/src/pyosis/post/check.py +0 -133
- osis_python-0.2.0/src/pyosis/post/loadcase.py +0 -96
- osis_python-0.2.0/src/pyosis/property/coordinate.py +0 -5
- osis_python-0.2.0/src/pyosis/section/io.py +0 -27
- osis_python-0.2.0/src/pyosis/section/numeric.py +0 -0
- osis_python-0.2.0/tests/test.py +0 -6
- {osis_python-0.2.0 → osis_python-0.2.2}/LICENSE +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/setup.cfg +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/common/interface.py +0 -0
- {osis_python-0.2.0/src/pyosis/common → osis_python-0.2.2/src/pyosis/control}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/control/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/core/command.py +0 -0
- {osis_python-0.2.0/src/pyosis/control → osis_python-0.2.2/src/pyosis/element}/__init__.py +0 -0
- {osis_python-0.2.0/src/pyosis/element → osis_python-0.2.2/src/pyosis/general}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.2.0/src/pyosis/general → osis_python-0.2.2/src/pyosis/geometry}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/geometry/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/live/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/live/analysis.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/live/lane.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/load/tendon.py +0 -0
- {osis_python-0.2.0/src/pyosis/geometry → osis_python-0.2.2/src/pyosis/material}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/material/interface.py +0 -0
- {osis_python-0.2.0/src/pyosis/material → osis_python-0.2.2/src/pyosis/node}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/property/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/property/creep_shrink.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/property/damping.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.2.0/src/pyosis/node → osis_python-0.2.2/src/pyosis/quick_building}/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/section/common.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/section/rebar.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/section/rib.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/section/steel.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/stage/define.py +0 -0
- {osis_python-0.2.0 → osis_python-0.2.2}/src/pyosis/stage/overall.py +0 -0
- {osis_python-0.2.0/src/pyosis/quick_building → osis_python-0.2.2/src/pyosis/thickness}/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,17 +17,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: openai>=2.7.1
|
|
21
|
-
Requires-Dist: agentscope>=1.0.13
|
|
22
|
-
Requires-Dist: fastapi>=0.128.0
|
|
23
|
-
Requires-Dist: httpx>=0.28.1
|
|
24
|
-
Requires-Dist: langchain-community>=0.4.1
|
|
25
20
|
Requires-Dist: matplotlib>=3.10.7
|
|
26
21
|
Requires-Dist: pandas>=2.3.3
|
|
27
|
-
Requires-Dist: pdfplumber>=0.11.9
|
|
28
|
-
Requires-Dist: python-docx>=1.2.0
|
|
29
|
-
Requires-Dist: requests>=2.32.5
|
|
30
|
-
Requires-Dist: uvicorn>=0.40.0
|
|
31
22
|
Provides-Extra: dev
|
|
32
23
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
33
24
|
Requires-Dist: black>=23.0; extra == "dev"
|
|
@@ -116,3 +107,5 @@ osis_solve()
|
|
|
116
107
|
```
|
|
117
108
|
|
|
118
109
|
If everything is normal, you will see OSIS finish the processing.
|
|
110
|
+
|
|
111
|
+
You can also directly execute the code using the code editor (vscode, pycharm, cursor, etc.). You may need to log in to the OSIS software first.
|
|
@@ -30,19 +30,10 @@ classifiers = [
|
|
|
30
30
|
"Programming Language :: Python :: 3.12",
|
|
31
31
|
]
|
|
32
32
|
|
|
33
|
-
# 依赖
|
|
33
|
+
# 依赖
|
|
34
34
|
dependencies = [
|
|
35
|
-
"openai>=2.7.1",
|
|
36
|
-
"agentscope>=1.0.13",
|
|
37
|
-
"fastapi>=0.128.0",
|
|
38
|
-
"httpx>=0.28.1",
|
|
39
|
-
"langchain-community>=0.4.1",
|
|
40
35
|
"matplotlib>=3.10.7",
|
|
41
36
|
"pandas>=2.3.3",
|
|
42
|
-
"pdfplumber>=0.11.9",
|
|
43
|
-
"python-docx>=1.2.0",
|
|
44
|
-
"requests>=2.32.5",
|
|
45
|
-
"uvicorn>=0.40.0",
|
|
46
37
|
]
|
|
47
38
|
|
|
48
39
|
[tool.setuptools.dynamic]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -17,17 +17,8 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
17
17
|
Requires-Python: >=3.11
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: openai>=2.7.1
|
|
21
|
-
Requires-Dist: agentscope>=1.0.13
|
|
22
|
-
Requires-Dist: fastapi>=0.128.0
|
|
23
|
-
Requires-Dist: httpx>=0.28.1
|
|
24
|
-
Requires-Dist: langchain-community>=0.4.1
|
|
25
20
|
Requires-Dist: matplotlib>=3.10.7
|
|
26
21
|
Requires-Dist: pandas>=2.3.3
|
|
27
|
-
Requires-Dist: pdfplumber>=0.11.9
|
|
28
|
-
Requires-Dist: python-docx>=1.2.0
|
|
29
|
-
Requires-Dist: requests>=2.32.5
|
|
30
|
-
Requires-Dist: uvicorn>=0.40.0
|
|
31
22
|
Provides-Extra: dev
|
|
32
23
|
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
33
24
|
Requires-Dist: black>=23.0; extra == "dev"
|
|
@@ -116,3 +107,5 @@ osis_solve()
|
|
|
116
107
|
```
|
|
117
108
|
|
|
118
109
|
If everything is normal, you will see OSIS finish the processing.
|
|
110
|
+
|
|
111
|
+
You can also directly execute the code using the code editor (vscode, pycharm, cursor, etc.). You may need to log in to the OSIS software first.
|
|
@@ -11,6 +11,7 @@ src/pyosis/boundary/__init__.py
|
|
|
11
11
|
src/pyosis/boundary/interface.py
|
|
12
12
|
src/pyosis/common/__init__.py
|
|
13
13
|
src/pyosis/common/interface.py
|
|
14
|
+
src/pyosis/common/project.py
|
|
14
15
|
src/pyosis/control/__init__.py
|
|
15
16
|
src/pyosis/control/interface.py
|
|
16
17
|
src/pyosis/core/PyInterface.pyi
|
|
@@ -18,13 +19,22 @@ src/pyosis/core/__init__.py
|
|
|
18
19
|
src/pyosis/core/all_func.py
|
|
19
20
|
src/pyosis/core/client.py
|
|
20
21
|
src/pyosis/core/command.py
|
|
21
|
-
src/pyosis/core/project.py
|
|
22
22
|
src/pyosis/element/__init__.py
|
|
23
23
|
src/pyosis/element/interface.py
|
|
24
24
|
src/pyosis/general/__init__.py
|
|
25
25
|
src/pyosis/general/interface.py
|
|
26
26
|
src/pyosis/geometry/__init__.py
|
|
27
27
|
src/pyosis/geometry/interface.py
|
|
28
|
+
src/pyosis/io/__init__.py
|
|
29
|
+
src/pyosis/io/boundary_info.py
|
|
30
|
+
src/pyosis/io/coordinate.py
|
|
31
|
+
src/pyosis/io/element_info.py
|
|
32
|
+
src/pyosis/io/group_info.py
|
|
33
|
+
src/pyosis/io/material_info.py
|
|
34
|
+
src/pyosis/io/node_info.py
|
|
35
|
+
src/pyosis/io/prestressed_info.py
|
|
36
|
+
src/pyosis/io/response.py
|
|
37
|
+
src/pyosis/io/section_info.py
|
|
28
38
|
src/pyosis/live/__init__.py
|
|
29
39
|
src/pyosis/live/analysis.py
|
|
30
40
|
src/pyosis/live/grade.py
|
|
@@ -39,8 +49,11 @@ src/pyosis/node/__init__.py
|
|
|
39
49
|
src/pyosis/node/interface.py
|
|
40
50
|
src/pyosis/post/__init__.py
|
|
41
51
|
src/pyosis/post/check.py
|
|
52
|
+
src/pyosis/post/env.py
|
|
42
53
|
src/pyosis/post/loadcase.py
|
|
54
|
+
src/pyosis/post/result.py
|
|
43
55
|
src/pyosis/property/__init__.py
|
|
56
|
+
src/pyosis/property/comp_thickness.py
|
|
44
57
|
src/pyosis/property/coordinate.py
|
|
45
58
|
src/pyosis/property/creep_shrink.py
|
|
46
59
|
src/pyosis/property/damping.py
|
|
@@ -49,7 +62,6 @@ src/pyosis/quick_building/__init__.py
|
|
|
49
62
|
src/pyosis/quick_building/interface.py
|
|
50
63
|
src/pyosis/section/__init__.py
|
|
51
64
|
src/pyosis/section/common.py
|
|
52
|
-
src/pyosis/section/io.py
|
|
53
65
|
src/pyosis/section/numeric.py
|
|
54
66
|
src/pyosis/section/param.py
|
|
55
67
|
src/pyosis/section/rebar.py
|
|
@@ -58,4 +70,5 @@ src/pyosis/section/steel.py
|
|
|
58
70
|
src/pyosis/stage/__init__.py
|
|
59
71
|
src/pyosis/stage/define.py
|
|
60
72
|
src/pyosis/stage/overall.py
|
|
61
|
-
|
|
73
|
+
src/pyosis/thickness/__init__.py
|
|
74
|
+
src/pyosis/thickness/interface.py
|
|
@@ -7,8 +7,8 @@ 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.2.
|
|
11
|
-
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心
|
|
10
|
+
__version__ = "0.2.2"
|
|
11
|
+
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
|
|
12
12
|
|
|
13
13
|
# from .core import engine
|
|
14
14
|
# from .ai.agents import BaseAgent
|
|
@@ -181,3 +181,15 @@ def osis_boundary_group(strName: str, eOP: Literal["c", "a", "s", "r", "aa", "ra
|
|
|
181
181
|
tuple (bool, str): 是否成功,失败原因
|
|
182
182
|
'''
|
|
183
183
|
pass
|
|
184
|
+
|
|
185
|
+
@REGISTRY.register("BoundaryDel")
|
|
186
|
+
def osis_boundary_dle(nIndex:int)->tuple[bool, str]:
|
|
187
|
+
"""
|
|
188
|
+
删除边界
|
|
189
|
+
Args:
|
|
190
|
+
nIndex: 边界编号
|
|
191
|
+
|
|
192
|
+
Returns:
|
|
193
|
+
tuple (bool, str): 是否成功,失败原因
|
|
194
|
+
"""
|
|
195
|
+
pass
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# --- project相关的函数
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Tuple
|
|
6
|
+
# from .engine import OSISEngine
|
|
7
|
+
from ..core.client import osis_client
|
|
8
|
+
|
|
9
|
+
def get_project_directory() -> Tuple[bool, str]:
|
|
10
|
+
return osis_client("GetProjectDirectory", {})
|
|
11
|
+
|
|
12
|
+
def open_project() -> Tuple[bool, str]:
|
|
13
|
+
...
|
|
14
|
+
|
|
15
|
+
def create_project() -> Tuple[bool, str]:
|
|
16
|
+
...
|
|
17
|
+
|
|
18
|
+
# class OSISProject():
|
|
19
|
+
# def __init__(self, path):
|
|
20
|
+
# self.root_path = self._parse_project_path(path)
|
|
21
|
+
# # 路径对象(方便后续操作)
|
|
22
|
+
# self.root_path_obj = Path(self.root_path)
|
|
23
|
+
|
|
24
|
+
# def _parse_project_path(self, path: str) -> str:
|
|
25
|
+
# """
|
|
26
|
+
# 私有方法:解析项目路径(核心逻辑)
|
|
27
|
+
# 1. 如果是绝对路径 → 直接返回
|
|
28
|
+
# 2. 如果是项目名 → 拼接当前工作目录返回
|
|
29
|
+
# """
|
|
30
|
+
# # 判断是否为完整绝对路径
|
|
31
|
+
# if os.path.isabs(path):
|
|
32
|
+
# return path
|
|
33
|
+
|
|
34
|
+
# # 不是绝对路径 → 在当前目录创建项目
|
|
35
|
+
# current_dir = os.getcwd()
|
|
36
|
+
# return os.path.join(current_dir, path)
|
|
37
|
+
|
|
38
|
+
# def open(self):
|
|
39
|
+
# return osis_client("GetProjectDirectory", {})
|
|
40
|
+
|
|
41
|
+
# def create(self):
|
|
42
|
+
# return osis_client("GetProjectDirectory", {})
|
|
43
|
+
|
|
44
|
+
# def close(self):
|
|
45
|
+
# return osis_client("GetProjectDirectory", {})
|
|
46
|
+
|
|
47
|
+
# def clear(self):
|
|
48
|
+
# ...
|
|
49
|
+
|
|
50
|
+
# def __str__(self):
|
|
51
|
+
# return f"OSISProject: {self.root_path}"
|
|
52
|
+
|
|
53
|
+
# def __repr__(self):
|
|
54
|
+
# return self.__str__()
|
|
@@ -154,9 +154,4 @@ class PyInterface:
|
|
|
154
154
|
|
|
155
155
|
def OSIS_QBStage(self, eBridgeType: str, stageInfo: list) -> Tuple[bool, str]:
|
|
156
156
|
return True, ""
|
|
157
|
-
|
|
158
|
-
def OSIS_CheckResult(slef, eSheetType: str, eCheckItem: str, strCheckName: str) -> tuple[bool, str, str]:
|
|
159
|
-
return True, "", ""
|
|
160
|
-
|
|
161
|
-
def OSIS_LoadCaseResult(self, fileName:str, eType: str) -> tuple[bool, str, str]:
|
|
162
|
-
return True, "", ""
|
|
157
|
+
|
|
@@ -30,7 +30,7 @@ def osis_client(func_name: str, payload: dict) -> dict | tuple[bool, str]:
|
|
|
30
30
|
Args:
|
|
31
31
|
func_name: C++ 接口名(如 "OSIS_Run", "OSIS_Run_Batch")
|
|
32
32
|
payload: 请求参数字典(自动序列化为 JSON)
|
|
33
|
-
Returns:
|
|
33
|
+
Returns:
|
|
34
34
|
异常时返回 (False, 错误信息)
|
|
35
35
|
"""
|
|
36
36
|
url = f"http://localhost:8080/{func_name}"
|
|
@@ -44,8 +44,7 @@ def osis_client(func_name: str, payload: dict) -> dict | tuple[bool, str]:
|
|
|
44
44
|
timeout=30 # 批量调用适当延长超时
|
|
45
45
|
)
|
|
46
46
|
response.raise_for_status() # 抛出 HTTP 状态码错误
|
|
47
|
-
return
|
|
48
|
-
|
|
47
|
+
return response.json()
|
|
49
48
|
except Exception as e:
|
|
50
49
|
# 异常时保持和 C++ 一致的返回格式
|
|
51
50
|
return False, f"调用失败: {str(e)}"
|
|
@@ -119,7 +119,7 @@ def osis_element_spring(nEle: int=1, eElementType: str="SPRING", nNode1: int=1,
|
|
|
119
119
|
@REGISTRY.register("Element")
|
|
120
120
|
def osis_element_cable(nEle: int=1, eElementType: str="CABLE", nNode1: int=1, nNode2: int=2, nMat: int=1, nSec: int=1, eMethod: Literal["UL", "IF", "HF", "VF", "IS"]="UL", dPara: float="10.0"):
|
|
121
121
|
'''
|
|
122
|
-
|
|
122
|
+
创建或修改拉索单元
|
|
123
123
|
|
|
124
124
|
Args:
|
|
125
125
|
nEle (int): 单元编号。从 1 开始编号,所有类型的单元均使用同一编号序列。
|
|
@@ -149,7 +149,7 @@ def osis_element_cable(nEle: int=1, eElementType: str="CABLE", nNode1: int=1, nN
|
|
|
149
149
|
@REGISTRY.register("Element")
|
|
150
150
|
def osis_element_shell(nEle: int=1, eElementType: str="CABLE", bIsThin: bool=1, nMat: int=1, nThk: int=1, nNode1: int=1, nNode2: int=2, nNode3: int=3, nNode4: int = None):
|
|
151
151
|
'''
|
|
152
|
-
|
|
152
|
+
创建或修改壳单元
|
|
153
153
|
|
|
154
154
|
Args:
|
|
155
155
|
nEle (int): 单元编号。从 1 开始编号,所有类型的单元均使用同一编号序列。
|
|
@@ -218,3 +218,79 @@ def osis_element_group(strName: str="单元组1", eOP: Literal["c", "a", "s", "r
|
|
|
218
218
|
'''
|
|
219
219
|
pass
|
|
220
220
|
|
|
221
|
+
@REGISTRY.register("TaperEle")
|
|
222
|
+
def osis_taperele(
|
|
223
|
+
nIndex: str,
|
|
224
|
+
strZType: Literal["0", "1"],
|
|
225
|
+
dZTrans: float = 1.0,
|
|
226
|
+
strZpos: Literal["0", "1"] = "0",
|
|
227
|
+
dZdis: float = 0.0,
|
|
228
|
+
strYtype: Literal["0", "1"]="0",
|
|
229
|
+
dYtrans: float = 1.0,
|
|
230
|
+
strYpos: Literal["0", "1"] = "0",
|
|
231
|
+
dYdis: float = 0.0,
|
|
232
|
+
*eles: str,
|
|
233
|
+
|
|
234
|
+
) -> tuple[bool, str]:
|
|
235
|
+
"""
|
|
236
|
+
生成或修改变截面单元组
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
nIndex (str): 变截面单元组名称
|
|
240
|
+
strZType (str): 截面Z向过渡类型,
|
|
241
|
+
* 0=线性
|
|
242
|
+
* 1=多项式
|
|
243
|
+
dZTrans (float): ZType=0时默认1.0
|
|
244
|
+
strZpos (str):
|
|
245
|
+
* 0=i
|
|
246
|
+
* 1=j
|
|
247
|
+
* ZType=0时默认i
|
|
248
|
+
dZdis (float): 对称面距,ZType=0时默认0.0
|
|
249
|
+
strYtype (str): 截面Y向过渡类型
|
|
250
|
+
* 0=线性
|
|
251
|
+
* 1=多项式
|
|
252
|
+
dYtrans (float): YType=0时默认1.0
|
|
253
|
+
strYpos (str):
|
|
254
|
+
* 0=i
|
|
255
|
+
* 1=j
|
|
256
|
+
* YType=0时默认i
|
|
257
|
+
dYdis (float): 对称面距,YType=0时默认0.0
|
|
258
|
+
*eles (str): 单元组编号,示例:1,3,5to10
|
|
259
|
+
|
|
260
|
+
Returns:
|
|
261
|
+
tuple (bool, str): 返回一个元组,包含:
|
|
262
|
+
- bool: 操作是否成功
|
|
263
|
+
- str: 失败原因
|
|
264
|
+
"""
|
|
265
|
+
pass
|
|
266
|
+
|
|
267
|
+
@REGISTRY.register("TaperEleDel")
|
|
268
|
+
def osis_element_tapereledel(strIndex: str) -> tuple[bool, str]:
|
|
269
|
+
"""
|
|
270
|
+
删除变截面单元组
|
|
271
|
+
|
|
272
|
+
Args:
|
|
273
|
+
strIndex (str): 变截面单元组名称
|
|
274
|
+
|
|
275
|
+
Returns:
|
|
276
|
+
tuple (bool, str): 返回一个元组,包含:
|
|
277
|
+
- bool: 操作是否成功
|
|
278
|
+
- str: 失败原因
|
|
279
|
+
"""
|
|
280
|
+
pass
|
|
281
|
+
|
|
282
|
+
@REGISTRY.register("TaperEleMod")
|
|
283
|
+
def osis_element_taperelemod(strOldIndex: str, strNewIndex: str) -> tuple[bool, str]:
|
|
284
|
+
"""
|
|
285
|
+
修改变截面组名称
|
|
286
|
+
|
|
287
|
+
Args:
|
|
288
|
+
strOldIndex (str):
|
|
289
|
+
strNewIndex (str):
|
|
290
|
+
|
|
291
|
+
Returns:
|
|
292
|
+
tuple (bool, str): 返回一个元组,包含:
|
|
293
|
+
- bool: 操作是否成功
|
|
294
|
+
- str: 失败原因
|
|
295
|
+
"""
|
|
296
|
+
pass
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# io/__init__.py
|
|
2
|
+
from .coordinate import *
|
|
3
|
+
from .group_info import *
|
|
4
|
+
from .element_info import *
|
|
5
|
+
from .node_info import *
|
|
6
|
+
from .response import *
|
|
7
|
+
from .section_info import *
|
|
8
|
+
from .material_info import *
|
|
9
|
+
from .boundary_info import *
|
|
10
|
+
from .prestressed_info import *
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# cpp/boundary_info.py
|
|
2
|
+
|
|
3
|
+
from ..core.client import osis_client
|
|
4
|
+
from .response import OSISParse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class BoundaryInfo(OSISParse):
|
|
8
|
+
"""
|
|
9
|
+
GetAllBoundaryInfo 接口返回封装
|
|
10
|
+
|
|
11
|
+
返回格式:
|
|
12
|
+
{
|
|
13
|
+
"success": true,
|
|
14
|
+
"data": [
|
|
15
|
+
{
|
|
16
|
+
"no": int,
|
|
17
|
+
"name": str,
|
|
18
|
+
"type": int, # 1=General, 2=MstSlv, 4=Release, 5=ElstcSpt, 6=GeneralElstcSpt
|
|
19
|
+
"entityVec": [int, ...],
|
|
20
|
+
"isOccupied": bool,
|
|
21
|
+
"isSelected": bool,
|
|
22
|
+
"isPloted": bool,
|
|
23
|
+
# type=1 (General) 特有:
|
|
24
|
+
"coorNO": int,
|
|
25
|
+
"constraints": [int, ...], # 7个约束值
|
|
26
|
+
# type=2 (MstSlv) 特有:
|
|
27
|
+
"masterNO": int,
|
|
28
|
+
"constraints": [int, ...],
|
|
29
|
+
# type=4 (Release) 特有:
|
|
30
|
+
"endIState": [int, ...],
|
|
31
|
+
"endJState": [int, ...],
|
|
32
|
+
"endI": [float, ...],
|
|
33
|
+
"endJ": [float, ...],
|
|
34
|
+
# type=5 (ElstcSpt) 特有:
|
|
35
|
+
"coorNO": int,
|
|
36
|
+
"k": [float, ...],
|
|
37
|
+
"elasticK": [{"isFixed": bool, "value": float}, ...],
|
|
38
|
+
# type=6 (GeneralElstcSpt) 特有:
|
|
39
|
+
"coorNO": int,
|
|
40
|
+
"flagM": bool,
|
|
41
|
+
"flagC": bool,
|
|
42
|
+
"stiffnessMatrix": [[float, ...], ...],
|
|
43
|
+
"massMatrix": [[float, ...], ...], # 仅当flagM=True时
|
|
44
|
+
"dampingMatrix": [[float, ...], ...], # 仅当flagC=True时
|
|
45
|
+
},
|
|
46
|
+
...
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
# 边界类型枚举映射
|
|
52
|
+
BOUNDARY_TYPE_NAMES = {
|
|
53
|
+
1: "General",
|
|
54
|
+
2: "MstSlv",
|
|
55
|
+
3: "Rigid",
|
|
56
|
+
4: "Release",
|
|
57
|
+
5: "ElstcSpt",
|
|
58
|
+
6: "GeneralElstcSpt",
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
def __init__(self):
|
|
62
|
+
super().__init__(osis_client("GetAllBoundaryInfo", {}))
|
|
63
|
+
self._bd_map: dict[int, dict] = {bd["no"]: bd for bd in self.data}
|
|
64
|
+
|
|
65
|
+
def get_by_no(self, no: int) -> dict | None:
|
|
66
|
+
"""
|
|
67
|
+
根据边界编号获取边界信息
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
no: 边界编号
|
|
71
|
+
|
|
72
|
+
Returns:
|
|
73
|
+
边界信息 dict;未找到返回 None
|
|
74
|
+
"""
|
|
75
|
+
return self._bd_map.get(no)
|
|
76
|
+
|
|
77
|
+
def get_no_list(self) -> list:
|
|
78
|
+
"""
|
|
79
|
+
获取所有边界编号列表
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
边界编号列表
|
|
83
|
+
"""
|
|
84
|
+
return [bd.get("no") for bd in self.data]
|
|
85
|
+
|
|
86
|
+
def get_type(self, no: int) -> int | None:
|
|
87
|
+
"""
|
|
88
|
+
根据边界编号获取边界类型编号
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
no: 边界编号
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
边界类型编号(1=General, 2=MstSlv, 4=Release, 5=ElstcSpt, 6=GeneralElstcSpt);未找到返回 None
|
|
95
|
+
"""
|
|
96
|
+
bd = self.get_by_no(no)
|
|
97
|
+
return bd.get("type") if bd else None
|
|
98
|
+
|
|
99
|
+
def get_type_name(self, no: int) -> str | None:
|
|
100
|
+
"""
|
|
101
|
+
根据边界编号获取边界类型名称
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
no: 边界编号
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
边界类型名称字符串;未找到返回 None
|
|
108
|
+
"""
|
|
109
|
+
bd = self.get_by_no(no)
|
|
110
|
+
if bd:
|
|
111
|
+
return self.BOUNDARY_TYPE_NAMES.get(bd.get("type"), "Unknown")
|
|
112
|
+
return None
|
|
113
|
+
|
|
114
|
+
def get_entity_vec(self, no: int) -> list | None:
|
|
115
|
+
"""
|
|
116
|
+
根据边界编号获取关联的节点/单元列表
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
no: 边界编号
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
关联的节点/单元编号列表;未找到返回 None
|
|
123
|
+
"""
|
|
124
|
+
bd = self.get_by_no(no)
|
|
125
|
+
return bd.get("entityVec") if bd else None
|
|
126
|
+
|
|
127
|
+
def get_master_no(self, no: int) -> int | None:
|
|
128
|
+
"""
|
|
129
|
+
根据边界编号获取主从边界的主节点编号
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
no: 边界编号
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
主节点编号;未找到或非主从边界返回 None
|
|
136
|
+
"""
|
|
137
|
+
bd = self.get_by_no(no)
|
|
138
|
+
return bd.get("masterNO") if bd else None
|
|
139
|
+
|
|
140
|
+
def get_constraints(self, no: int) -> list | None:
|
|
141
|
+
"""
|
|
142
|
+
根据边界编号获取边界约束值
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
no: 边界编号
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
约束值列表(7个);未找到返回 None
|
|
149
|
+
"""
|
|
150
|
+
bd = self.get_by_no(no)
|
|
151
|
+
return bd.get("constraints") if bd else None
|
|
152
|
+
|
|
153
|
+
def get_coor_no(self, no: int) -> int | None:
|
|
154
|
+
"""
|
|
155
|
+
根据边界编号获取局部坐标系编号
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
no: 边界编号
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
局部坐标系编号;未找到返回 None
|
|
162
|
+
"""
|
|
163
|
+
bd = self.get_by_no(no)
|
|
164
|
+
return bd.get("coorNO") if bd else None
|
|
165
|
+
|
|
166
|
+
def is_occupied(self, no: int) -> bool | None:
|
|
167
|
+
"""
|
|
168
|
+
根据边界编号判断边界是否被节点/单元占用
|
|
169
|
+
|
|
170
|
+
Args:
|
|
171
|
+
no: 边界编号
|
|
172
|
+
|
|
173
|
+
Returns:
|
|
174
|
+
是否被占用;未找到返回 None
|
|
175
|
+
"""
|
|
176
|
+
bd = self.get_by_no(no)
|
|
177
|
+
return bd.get("isOccupied") if bd else None
|
|
178
|
+
|
|
179
|
+
def is_selected(self, no: int) -> bool | None:
|
|
180
|
+
"""
|
|
181
|
+
根据边界编号判断边界是否被选中
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
no: 边界编号
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
是否选中;未找到返回 None
|
|
188
|
+
"""
|
|
189
|
+
bd = self.get_by_no(no)
|
|
190
|
+
return bd.get("isSelected") if bd else None
|
|
191
|
+
|
|
192
|
+
def get_stiffness_matrix(self, no: int) -> list | None:
|
|
193
|
+
"""
|
|
194
|
+
根据边界编号获取GeneralElstcSpt边界的刚度矩阵
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
no: 边界编号
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
6x6刚度矩阵;未找到或非GeneralElstcSpt类型返回 None
|
|
201
|
+
"""
|
|
202
|
+
bd = self.get_by_no(no)
|
|
203
|
+
return bd.get("stiffnessMatrix") if bd else None
|
|
204
|
+
|
|
205
|
+
def get_mass_matrix(self, no: int) -> list | None:
|
|
206
|
+
"""
|
|
207
|
+
根据边界编号获取GeneralElstcSpt边界的质量矩阵
|
|
208
|
+
|
|
209
|
+
Args:
|
|
210
|
+
no: 边界编号
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
6x6质量矩阵;未找到、非GeneralElstcSpt类型或flagM=False时返回 None
|
|
214
|
+
"""
|
|
215
|
+
bd = self.get_by_no(no)
|
|
216
|
+
return bd.get("massMatrix") if bd else None
|
|
217
|
+
|
|
218
|
+
def get_damping_matrix(self, no: int) -> list | None:
|
|
219
|
+
"""
|
|
220
|
+
根据边界编号获取GeneralElstcSpt边界的阻尼矩阵
|
|
221
|
+
|
|
222
|
+
Args:
|
|
223
|
+
no: 边界编号
|
|
224
|
+
|
|
225
|
+
Returns:
|
|
226
|
+
6x6阻尼矩阵;未找到、非GeneralElstcSpt类型或flagC=False时返回 None
|
|
227
|
+
"""
|
|
228
|
+
bd = self.get_by_no(no)
|
|
229
|
+
return bd.get("dampingMatrix") if bd else None
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def get_all_boundary_info() -> BoundaryInfo:
|
|
233
|
+
"""
|
|
234
|
+
获取所有边界信息
|
|
235
|
+
|
|
236
|
+
Returns:
|
|
237
|
+
BoundaryInfo 对象
|
|
238
|
+
"""
|
|
239
|
+
return BoundaryInfo()
|