osis-python 0.1.5__tar.gz → 0.1.7__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.1.5/src/osis_python.egg-info → osis_python-0.1.7}/PKG-INFO +5 -37
- {osis_python-0.1.5 → osis_python-0.1.7}/README.md +3 -14
- {osis_python-0.1.5 → osis_python-0.1.7}/pyproject.toml +2 -2
- {osis_python-0.1.5 → osis_python-0.1.7/src/osis_python.egg-info}/PKG-INFO +5 -37
- {osis_python-0.1.5 → osis_python-0.1.7}/src/osis_python.egg-info/SOURCES.txt +5 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/__init__.py +1 -1
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/agents/DecisionAgent.py +1 -1
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/agents/MaterialAgent.py +4 -1
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/agents/ModelAgent.py +3 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/agents/QuickBuildingAgent.py +6 -30
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/agents/SectionAgent.py +3 -0
- osis_python-0.1.7/src/pyosis/boundary/interface.py +183 -0
- osis_python-0.1.7/src/pyosis/core/all_func.py +14 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/core/command.py +56 -11
- osis_python-0.1.7/src/pyosis/geometry/interface.py +120 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/live/analysis.py +37 -0
- osis_python-0.1.7/src/pyosis/live/lane.py +127 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/load/static.py +13 -3
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/load/tendon.py +1 -1
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/material/interface.py +1 -1
- osis_python-0.1.7/src/pyosis/property/__init__.py +4 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/property/creep_shrink.py +1 -1
- osis_python-0.1.7/src/pyosis/quick_building/__init__.py +1 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/quick_building/interface.py +15 -9
- osis_python-0.1.7/src/pyosis/section/common.py +632 -0
- osis_python-0.1.7/src/pyosis/section/rebar.py +192 -0
- osis_python-0.1.7/src/pyosis/section/rib.py +188 -0
- osis_python-0.1.7/src/pyosis/section/steel.py +2 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/stage/overall.py +4 -4
- osis_python-0.1.5/src/pyosis/boundary/interface.py +0 -90
- osis_python-0.1.5/src/pyosis/live/lane.py +0 -56
- osis_python-0.1.5/src/pyosis/property/__init__.py +0 -0
- osis_python-0.1.5/src/pyosis/section/common.py +0 -325
- osis_python-0.1.5/src/pyosis/section/steel.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/LICENSE +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/setup.cfg +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/osis_python.egg-info/requires.txt +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/agents/BaseAgent.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/ai/agents/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/control/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/control/interface.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/core/PyInterface.pyi +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/core/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/core/engine.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/element/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/element/interface.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/general/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.1.5/src/pyosis/material → osis_python-0.1.7/src/pyosis/geometry}/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/live/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.1.5/src/pyosis/node → osis_python-0.1.7/src/pyosis/material}/__init__.py +0 -0
- {osis_python-0.1.5/src/pyosis/post → osis_python-0.1.7/src/pyosis/node}/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.1.5/src/pyosis/quick_building → osis_python-0.1.7/src/pyosis/post}/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/post/interface.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/property/coordinate.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/property/damping.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/section/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/section/numeric.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/section/param.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.1.5 → osis_python-0.1.7}/src/pyosis/stage/define.py +0 -0
|
@@ -1,29 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2025 CCCC Highway Consultant Co. Ltd.
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
6
|
+
License-Expression: MIT
|
|
27
7
|
Project-URL: Homepage, https://github.com/osis-ai/pyosis
|
|
28
8
|
Project-URL: Documentation, https://github.com/osis-ai/pyosis#readme
|
|
29
9
|
Project-URL: Repository, https://github.com/osis-ai/pyosis.git
|
|
@@ -31,7 +11,6 @@ Project-URL: BugTracker, https://github.com/osis-ai/pyosis/issues
|
|
|
31
11
|
Classifier: Development Status :: 4 - Beta
|
|
32
12
|
Classifier: Intended Audience :: Developers
|
|
33
13
|
Classifier: Topic :: Software Development :: Libraries
|
|
34
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
35
14
|
Classifier: Programming Language :: Python :: 3
|
|
36
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
37
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -139,21 +118,10 @@ osis_loadcase("Custom Load Case 1", "USER", 1, "Two forces applied at nodes 3 an
|
|
|
139
118
|
osis_load_nforce("NFORCE", "Custom Load Case 1", 3, 0, -1000000, 0, 0, 0, 0)
|
|
140
119
|
osis_load_nforce("NFORCE", "Custom Load Case 1", 4, 200000, 0, 0, 0, 0, 0)
|
|
141
120
|
|
|
142
|
-
osis_solve()
|
|
121
|
+
# osis_solve()
|
|
143
122
|
|
|
144
|
-
osis_run() # Let OSIS execute all preprocessing commands
|
|
123
|
+
print(osis_run()) # Let OSIS execute all preprocessing commands
|
|
145
124
|
|
|
146
|
-
isok, error, ef = osis_elem_force("Custom Load Case 1", "EF", "BEAM3D")
|
|
147
|
-
|
|
148
|
-
def dict_to_json_txt(data, filename):
|
|
149
|
-
"""Write dictionary to file in JSON format"""
|
|
150
|
-
with open(filename, 'w', encoding='utf-8') as f:
|
|
151
|
-
json.dump(data, f, indent=4)
|
|
152
|
-
|
|
153
|
-
print(f"Dictionary written to file: {filename}")
|
|
154
|
-
|
|
155
|
-
# Usage
|
|
156
|
-
dict_to_json_txt(ef, "output.json")
|
|
157
125
|
```
|
|
158
126
|
|
|
159
|
-
Select and run this script in OSIS. If everything is normal, you will see OSIS
|
|
127
|
+
Select and run this script in OSIS. If everything is normal, you will see OSIS finish the preprocessing.
|
|
@@ -81,21 +81,10 @@ osis_loadcase("Custom Load Case 1", "USER", 1, "Two forces applied at nodes 3 an
|
|
|
81
81
|
osis_load_nforce("NFORCE", "Custom Load Case 1", 3, 0, -1000000, 0, 0, 0, 0)
|
|
82
82
|
osis_load_nforce("NFORCE", "Custom Load Case 1", 4, 200000, 0, 0, 0, 0, 0)
|
|
83
83
|
|
|
84
|
-
osis_solve()
|
|
84
|
+
# osis_solve()
|
|
85
85
|
|
|
86
|
-
osis_run() # Let OSIS execute all preprocessing commands
|
|
86
|
+
print(osis_run()) # Let OSIS execute all preprocessing commands
|
|
87
87
|
|
|
88
|
-
isok, error, ef = osis_elem_force("Custom Load Case 1", "EF", "BEAM3D")
|
|
89
|
-
|
|
90
|
-
def dict_to_json_txt(data, filename):
|
|
91
|
-
"""Write dictionary to file in JSON format"""
|
|
92
|
-
with open(filename, 'w', encoding='utf-8') as f:
|
|
93
|
-
json.dump(data, f, indent=4)
|
|
94
|
-
|
|
95
|
-
print(f"Dictionary written to file: {filename}")
|
|
96
|
-
|
|
97
|
-
# Usage
|
|
98
|
-
dict_to_json_txt(ef, "output.json")
|
|
99
88
|
```
|
|
100
89
|
|
|
101
|
-
Select and run this script in OSIS. If everything is normal, you will see OSIS
|
|
90
|
+
Select and run this script in OSIS. If everything is normal, you will see OSIS finish the preprocessing.
|
|
@@ -16,7 +16,8 @@ description = "A Python client library for Osis APDL"
|
|
|
16
16
|
# 详细描述文件
|
|
17
17
|
readme = "README.md"
|
|
18
18
|
# 许可证文件
|
|
19
|
-
license =
|
|
19
|
+
license = "MIT"
|
|
20
|
+
license-files = ["LICENSE"]
|
|
20
21
|
# Python 版本要求
|
|
21
22
|
requires-python = ">=3.11"
|
|
22
23
|
# 分类器
|
|
@@ -24,7 +25,6 @@ classifiers = [
|
|
|
24
25
|
"Development Status :: 4 - Beta",
|
|
25
26
|
"Intended Audience :: Developers",
|
|
26
27
|
"Topic :: Software Development :: Libraries",
|
|
27
|
-
"License :: OSI Approved :: MIT License",
|
|
28
28
|
"Programming Language :: Python :: 3",
|
|
29
29
|
"Programming Language :: Python :: 3.11",
|
|
30
30
|
"Programming Language :: Python :: 3.12",
|
|
@@ -1,29 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: A Python client library for Osis APDL
|
|
5
5
|
Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
|
|
6
|
-
License: MIT
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2025 CCCC Highway Consultant Co. Ltd.
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
-
in the Software without restriction, including without limitation the rights
|
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
-
furnished to do so, subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
-
SOFTWARE.
|
|
6
|
+
License-Expression: MIT
|
|
27
7
|
Project-URL: Homepage, https://github.com/osis-ai/pyosis
|
|
28
8
|
Project-URL: Documentation, https://github.com/osis-ai/pyosis#readme
|
|
29
9
|
Project-URL: Repository, https://github.com/osis-ai/pyosis.git
|
|
@@ -31,7 +11,6 @@ Project-URL: BugTracker, https://github.com/osis-ai/pyosis/issues
|
|
|
31
11
|
Classifier: Development Status :: 4 - Beta
|
|
32
12
|
Classifier: Intended Audience :: Developers
|
|
33
13
|
Classifier: Topic :: Software Development :: Libraries
|
|
34
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
35
14
|
Classifier: Programming Language :: Python :: 3
|
|
36
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
37
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -139,21 +118,10 @@ osis_loadcase("Custom Load Case 1", "USER", 1, "Two forces applied at nodes 3 an
|
|
|
139
118
|
osis_load_nforce("NFORCE", "Custom Load Case 1", 3, 0, -1000000, 0, 0, 0, 0)
|
|
140
119
|
osis_load_nforce("NFORCE", "Custom Load Case 1", 4, 200000, 0, 0, 0, 0, 0)
|
|
141
120
|
|
|
142
|
-
osis_solve()
|
|
121
|
+
# osis_solve()
|
|
143
122
|
|
|
144
|
-
osis_run() # Let OSIS execute all preprocessing commands
|
|
123
|
+
print(osis_run()) # Let OSIS execute all preprocessing commands
|
|
145
124
|
|
|
146
|
-
isok, error, ef = osis_elem_force("Custom Load Case 1", "EF", "BEAM3D")
|
|
147
|
-
|
|
148
|
-
def dict_to_json_txt(data, filename):
|
|
149
|
-
"""Write dictionary to file in JSON format"""
|
|
150
|
-
with open(filename, 'w', encoding='utf-8') as f:
|
|
151
|
-
json.dump(data, f, indent=4)
|
|
152
|
-
|
|
153
|
-
print(f"Dictionary written to file: {filename}")
|
|
154
|
-
|
|
155
|
-
# Usage
|
|
156
|
-
dict_to_json_txt(ef, "output.json")
|
|
157
125
|
```
|
|
158
126
|
|
|
159
|
-
Select and run this script in OSIS. If everything is normal, you will see OSIS
|
|
127
|
+
Select and run this script in OSIS. If everything is normal, you will see OSIS finish the preprocessing.
|
|
@@ -21,12 +21,15 @@ src/pyosis/control/__init__.py
|
|
|
21
21
|
src/pyosis/control/interface.py
|
|
22
22
|
src/pyosis/core/PyInterface.pyi
|
|
23
23
|
src/pyosis/core/__init__.py
|
|
24
|
+
src/pyosis/core/all_func.py
|
|
24
25
|
src/pyosis/core/command.py
|
|
25
26
|
src/pyosis/core/engine.py
|
|
26
27
|
src/pyosis/element/__init__.py
|
|
27
28
|
src/pyosis/element/interface.py
|
|
28
29
|
src/pyosis/general/__init__.py
|
|
29
30
|
src/pyosis/general/interface.py
|
|
31
|
+
src/pyosis/geometry/__init__.py
|
|
32
|
+
src/pyosis/geometry/interface.py
|
|
30
33
|
src/pyosis/live/__init__.py
|
|
31
34
|
src/pyosis/live/analysis.py
|
|
32
35
|
src/pyosis/live/grade.py
|
|
@@ -52,6 +55,8 @@ src/pyosis/section/__init__.py
|
|
|
52
55
|
src/pyosis/section/common.py
|
|
53
56
|
src/pyosis/section/numeric.py
|
|
54
57
|
src/pyosis/section/param.py
|
|
58
|
+
src/pyosis/section/rebar.py
|
|
59
|
+
src/pyosis/section/rib.py
|
|
55
60
|
src/pyosis/section/steel.py
|
|
56
61
|
src/pyosis/stage/__init__.py
|
|
57
62
|
src/pyosis/stage/define.py
|
|
@@ -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.1.
|
|
10
|
+
__version__ = "0.1.7"
|
|
11
11
|
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心
|
|
12
12
|
|
|
13
13
|
# from .core import engine
|
|
@@ -158,7 +158,7 @@ class DecisionAgent(BaseAgent):
|
|
|
158
158
|
# """
|
|
159
159
|
system_prompt = \
|
|
160
160
|
"""
|
|
161
|
-
|
|
161
|
+
你是一个桥梁设计总监,负责协调材料、截面、模型、显示等专业智能体的工作。如果它们回复了python代码,你需要将这些代码整合起来,如果它们回复了python代码,你需要将这些代码整合起来。
|
|
162
162
|
|
|
163
163
|
你的手下掌握着以下几个智能体:
|
|
164
164
|
1. 材料智能体:用于生成满足用户需求的材料。
|
|
@@ -13,7 +13,7 @@ class MaterialAgent(BaseAgent):
|
|
|
13
13
|
tool(osis_creep_shrink),
|
|
14
14
|
tool(osis_material_conc),
|
|
15
15
|
tool(osis_material_steel),
|
|
16
|
-
tool(
|
|
16
|
+
tool(osis_material_rebar),
|
|
17
17
|
tool(osis_material_prestressed),
|
|
18
18
|
tool(osis_material_custom),
|
|
19
19
|
tool(osis_material_del),
|
|
@@ -34,6 +34,9 @@ class MaterialAgent(BaseAgent):
|
|
|
34
34
|
- 默认创建C50混凝土材料
|
|
35
35
|
|
|
36
36
|
创建成功后,请告知决策智能体。创建失败后,请告知失败原因。
|
|
37
|
+
|
|
38
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
39
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
37
40
|
"""
|
|
38
41
|
super().create_agent(tools, system_prompt)
|
|
39
42
|
|
|
@@ -38,5 +38,8 @@ class ModelAgent(BaseAgent):
|
|
|
38
38
|
- 若用户未说明,假设用户希望创建一个跨度为10米,分为10个单元的简单悬浇梁结构,则你需要创建11个节点和10个单元。
|
|
39
39
|
|
|
40
40
|
创建成功后,请告知决策智能体。创建失败后,请告知失败原因。
|
|
41
|
+
|
|
42
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
43
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
41
44
|
"""
|
|
42
45
|
super().create_agent(tools, system_prompt)
|
|
@@ -20,36 +20,7 @@ class QuickBuildingAgent(BaseAgent):
|
|
|
20
20
|
]
|
|
21
21
|
system_prompt = \
|
|
22
22
|
"""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
__桥梁类型设置__ `osis_set_qb_bridge_type(eBridgeType)`
|
|
26
|
-
|
|
27
|
-
- 支持类型:HOLLOWSLAB(空心板), SMALLBOXBEAM(小箱梁), TBEAM(T梁), CONTINUOUSSMALLBOXBEAM(连续小箱梁), CONTINUOUSTBEAM(连续T梁)
|
|
28
|
-
|
|
29
|
-
__总体参数配置__ `osis_set_qb_overall(eBridgeType, 跨径列表, 是否弹性连接, 支座刚度参数...)`
|
|
30
|
-
|
|
31
|
-
- 简支桥:单跨参数列表
|
|
32
|
-
- 连续桥:多跨参数列表
|
|
33
|
-
- 弹性连接需设置支座刚度
|
|
34
|
-
|
|
35
|
-
__纵向参数设置__ `osis_set_qb_portrait(eBridgeType, 单元尺寸范围, 结构尺寸参数...)`
|
|
36
|
-
|
|
37
|
-
- 控制单元划分和结构几何参数
|
|
38
|
-
|
|
39
|
-
__荷载配置__ `osis_set_qb_load(eBridgeType, 荷载参数...)`
|
|
40
|
-
|
|
41
|
-
- 通过零/非零值控制荷载类型启用
|
|
42
|
-
- 温度效应需同时设置升温/降温值
|
|
43
|
-
|
|
44
|
-
__钢束设置__ `osis_set_qb_tendon(eBridgeType, 钢束参数列表)`
|
|
45
|
-
|
|
46
|
-
- 每个钢束包含名称、属性、几何参数、应力等详细信息
|
|
47
|
-
|
|
48
|
-
__施工阶段设置__ `osis_set_qb_stage(eBridgeType, 阶段参数列表)`
|
|
49
|
-
|
|
50
|
-
- 定义施工顺序、持续时间和荷载状态
|
|
51
|
-
|
|
52
|
-
__快速建模函数__ `osis_create_qb_bridge` - 按照设置好的参数创建标准桥型
|
|
23
|
+
你是快速建模助手,负责配合用户调用几个快速建模函数。
|
|
53
24
|
|
|
54
25
|
操作流程:
|
|
55
26
|
|
|
@@ -70,5 +41,10 @@ __快速建模函数__ `osis_create_qb_bridge` - 按照设置好的参数创建
|
|
|
70
41
|
- 处理OSISEngine引擎层错误
|
|
71
42
|
- 创建成功后,请告知用户。创建失败后,请告知失败原因。
|
|
72
43
|
|
|
44
|
+
注意事项:
|
|
45
|
+
|
|
46
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
47
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
48
|
+
|
|
73
49
|
"""
|
|
74
50
|
super().create_agent(tools, system_prompt)
|
|
@@ -35,6 +35,9 @@ class SectionAgent(BaseAgent):
|
|
|
35
35
|
- 默认创建矩形截面
|
|
36
36
|
|
|
37
37
|
创建成功后,请告知决策智能体。创建失败后,请告知失败原因。
|
|
38
|
+
|
|
39
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
40
|
+
- 如果用户要求直接以代码的形式回复,需要首先导入:from pyosis.core.all_func import *,然后输出python代码块,不要尝试调用函数
|
|
38
41
|
"""
|
|
39
42
|
super().create_agent(tools, system_prompt)
|
|
40
43
|
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Interfaces of OSIS functions
|
|
3
|
+
|
|
4
|
+
========
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
from typing import Literal
|
|
10
|
+
from ..core import REGISTRY
|
|
11
|
+
|
|
12
|
+
# @REGISTRY.register("Boundary")
|
|
13
|
+
# def osis_boundary(nBd: int=1, eBoundaryType: Literal["GENERAL", "MSTSLV", "RELEASE", "ELSTCSPT"]="GENERAL", params: Dict[str, Any]={}):
|
|
14
|
+
# '''
|
|
15
|
+
# 创建边界
|
|
16
|
+
|
|
17
|
+
# Args:
|
|
18
|
+
# nBd (int): 边界编号
|
|
19
|
+
# eBoundaryType (str): 边界类型,不区分大小写。GENERAL = 一般边界,MSTSLV = 主从约束,RELEASE = 释放梁端约束,ELSTCSPT = 节点弹性支承
|
|
20
|
+
# params (Dict[str, Any]): 对应边界类型所需要的参数
|
|
21
|
+
# Returns:
|
|
22
|
+
# tuple (bool, str): 是否成功,失败原因
|
|
23
|
+
# '''
|
|
24
|
+
# pass
|
|
25
|
+
|
|
26
|
+
@REGISTRY.register("Boundary")
|
|
27
|
+
def osis_boundary_general(nBd: int, eBoundaryType: Literal["GENERAL"]="GENERAL", nCoor: int = "", bX: bool = 1, bY: bool = 1, bZ: bool = 1, bRX: bool = 1, bRY: bool = 1, bRZ: bool = 1, bRW: bool = 1):
|
|
28
|
+
'''
|
|
29
|
+
## 定义或修改一般边界
|
|
30
|
+
pyosis.boundary.osis_boundary_general
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
nBd (int): 编号
|
|
34
|
+
eBoundaryType (str): 固定为 GENERAL
|
|
35
|
+
nCoor (int): 局部坐标系编号,"" 代表缺省
|
|
36
|
+
bX (bool): 0 = 释放,1 = 约束
|
|
37
|
+
bY (bool): 0 = 释放,1 = 约束
|
|
38
|
+
bZ (bool): 0 = 释放,1 = 约束
|
|
39
|
+
bRX (bool): 0 = 释放,1 = 约束
|
|
40
|
+
bRY (bool): 0 = 释放,1 = 约束
|
|
41
|
+
bRZ (bool): 0 = 释放,1 = 约束
|
|
42
|
+
bRW (bool): 0 = 释放,1 = 约束
|
|
43
|
+
Returns:
|
|
44
|
+
tuple (bool, str): 是否成功,失败原因
|
|
45
|
+
'''
|
|
46
|
+
pass
|
|
47
|
+
@REGISTRY.register("Boundary")
|
|
48
|
+
def osis_boundary_elstcspt(nBd: int, eBoundaryType: Literal["ELSTCSPT"]="ELSTCSPT", nCoor: int = -1, bX: bool = 1, DX: int = 1e13, bY: bool = 1, DY: int = 1e13, bZ: bool = 1, DZ: int = 1e13, bRX: bool = 1, RX: int = 1e16, bRY: bool = 1, RY: int = 1e16, bRZ: bool = 1, RZ: int = 1e16):
|
|
49
|
+
'''
|
|
50
|
+
定义或修改弹簧单元弹性支承
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
nBd (int): 编号
|
|
54
|
+
eBoundaryType (str): 固定为 ELSTCSPT
|
|
55
|
+
nCoor (int): 局部坐标系编号,-1代表缺省
|
|
56
|
+
bX:UX方向,0 = 弹性,1 = 固定
|
|
57
|
+
DX:坐标系X轴方向的弹性支承刚度
|
|
58
|
+
bY:UY方向,0 = 弹性,1 = 固定
|
|
59
|
+
DY:坐标系Y轴方向的弹性支承刚度
|
|
60
|
+
bZ:UZ方向,0 = 弹性,1 = 固定
|
|
61
|
+
DZ:坐标系Z轴方向的弹性支承刚度
|
|
62
|
+
bRX:RX方向,0 = 弹性,1 = 固定
|
|
63
|
+
RX:绕坐标系X轴方向的转动弹性刚度
|
|
64
|
+
bRY:RY方向,0 = 弹性,1 = 固定
|
|
65
|
+
RY:绕坐标系Y轴方向的转动弹性刚度
|
|
66
|
+
bRZ:RZ方向,0 = 弹性,1 = 固定
|
|
67
|
+
RZ:绕坐标系Z轴方向的转动弹性刚度
|
|
68
|
+
注:弹性支撑与一般边界固定的自由度相同,且弹性支撑其余自由度上约束为零时,二者结果完全相同,不存在数值差异
|
|
69
|
+
Returns:
|
|
70
|
+
tuple (bool, str): 是否成功,失败原因
|
|
71
|
+
'''
|
|
72
|
+
pass
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@REGISTRY.register("Boundary")
|
|
76
|
+
def osis_boundary_master_slave(nBd: int, eBoundaryType: Literal["MSTSLV"]="MSTSLV", nNode: int = 1, bX: bool = 1, bY: bool = 1, bZ: bool = 1, bRX: bool = 1, bRY: bool = 1, bRZ: bool = 1):
|
|
77
|
+
'''
|
|
78
|
+
## 定义或修改主从约束
|
|
79
|
+
pyosis.boundary.osis_boundary_master_slave
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
nBd (int): 编号
|
|
83
|
+
eBoundaryType (str): 固定为 MSTSLV
|
|
84
|
+
nNode (int): 主节点编号
|
|
85
|
+
bDX (bool): 0 = 释放,1 = 约束
|
|
86
|
+
bDY (bool): 0 = 释放,1 = 约束
|
|
87
|
+
bDZ (bool): 0 = 释放,1 = 约束
|
|
88
|
+
bRX (bool): 0 = 释放,1 = 约束
|
|
89
|
+
bRY (bool): 0 = 释放,1 = 约束
|
|
90
|
+
bRZ (bool): 0 = 释放,1 = 约束
|
|
91
|
+
Returns:
|
|
92
|
+
tuple (bool, str): 是否成功,失败原因
|
|
93
|
+
'''
|
|
94
|
+
pass
|
|
95
|
+
|
|
96
|
+
@REGISTRY.register("Boundary")
|
|
97
|
+
def osis_boundary_release(nBd: int, eBoundaryType: Literal["RELEASE"],
|
|
98
|
+
Fxi_state: bool, Fyi_state: bool, Fzi_state: bool, Mxi_state: bool, Myi_state: bool, Mzi_state: bool, Mbi_state: bool,
|
|
99
|
+
Fxi: float, Fyi: float, Fzi: float, Mxi: float, Myi: float, Mzi: float, Mbi: float,
|
|
100
|
+
Fxj_state: bool, Fyj_state: bool, Fzj_state: bool, Mxj_state: bool, Myj_state: bool, Mzj_state: bool, Mbj_state: bool,
|
|
101
|
+
Fxj: float, Fyj: float, Fzj: float, Mxj: float, Myj: float, Mzj: float, Mbj: float):
|
|
102
|
+
'''
|
|
103
|
+
## 定义或修改释放梁端约束
|
|
104
|
+
pyosis.boundary.osis_boundary_release
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
nBd (int): 编号
|
|
108
|
+
eBoundaryType (str): 固定为 MSTSLV
|
|
109
|
+
\\*_state (bool):
|
|
110
|
+
* 0 = 释放
|
|
111
|
+
* 1 = 约束
|
|
112
|
+
F\\*i and M\\*i (float): 部分约束的大小,0-1之间,表示释放后残余的约束能力的百分比
|
|
113
|
+
Returns:
|
|
114
|
+
tuple (bool, str): 是否成功,失败原因
|
|
115
|
+
'''
|
|
116
|
+
pass
|
|
117
|
+
|
|
118
|
+
@REGISTRY.register("Boundary")
|
|
119
|
+
def osis_boundary_elastic_support(nBd: int, eBoundaryType: Literal["ELSTCSPT"], nCoor: int, bX: float, bY: float, bZ: float, bRX: float, bRY: float, bRZ: float):
|
|
120
|
+
'''
|
|
121
|
+
## 定义或修改节点弹性支撑
|
|
122
|
+
pyosis.boundary.osis_boundary_elastic_support
|
|
123
|
+
|
|
124
|
+
Args:
|
|
125
|
+
nBd (int): 编号
|
|
126
|
+
eBoundaryType (str): 固定为 ELSTCSPT
|
|
127
|
+
nCoor (int): 局部坐标系编号
|
|
128
|
+
dDX (float): 坐标系 X 轴方向的弹性支承刚度
|
|
129
|
+
dDY (float): 坐标系 Y 轴方向的弹性支承刚度
|
|
130
|
+
dDZ (float): 坐标系 Z 轴方向的弹性支承刚度
|
|
131
|
+
dRX (float): 绕坐标系 X 轴方向的转动弹性刚度
|
|
132
|
+
dRY (float): 绕坐标系 Y 轴方向的转动弹性刚度
|
|
133
|
+
dRZ (float): 绕坐标系 Z 轴方向的转动弹性刚度
|
|
134
|
+
Returns:
|
|
135
|
+
tuple (bool, str): 是否成功,失败原因
|
|
136
|
+
'''
|
|
137
|
+
pass
|
|
138
|
+
|
|
139
|
+
@REGISTRY.register("AsgnBd")
|
|
140
|
+
def osis_assign_boundary(nBd: int=1, eOP: Literal["a", "s", "r", "aa", "ra"]="a", param: list=[]):
|
|
141
|
+
'''
|
|
142
|
+
## 分配边界给节点(一般支撑,节点弹性支撑)
|
|
143
|
+
pyosis.boundary.osis_assign_boundary
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
nBd (int): 边界编号
|
|
147
|
+
eOP (str): 操作
|
|
148
|
+
* a = 添加
|
|
149
|
+
* s = 替换
|
|
150
|
+
* r = 移除
|
|
151
|
+
* aa = 添加全部
|
|
152
|
+
* ra = 移除全部
|
|
153
|
+
param (list): 待操作的编号,支持的格式:*,*to*,*by*(仅用于替换)。
|
|
154
|
+
例子:[2,3,5,"8to10"] ["2by3","5by6","8by10"] 重合的编号自动忽略
|
|
155
|
+
Returns:
|
|
156
|
+
tuple (bool, str): 是否成功,失败原因
|
|
157
|
+
'''
|
|
158
|
+
pass
|
|
159
|
+
|
|
160
|
+
@REGISTRY.register("BdGrp")
|
|
161
|
+
def osis_boundary_group(strName: str, eOP: Literal["c", "a", "s", "r", "aa", "ra", "m", "d"], param: list=[]):
|
|
162
|
+
'''
|
|
163
|
+
## 添加或移除边界组
|
|
164
|
+
pyosis.boundary.osis_boundary_group
|
|
165
|
+
|
|
166
|
+
Args:
|
|
167
|
+
strName (str): 边界组名
|
|
168
|
+
eOP (str): 操作
|
|
169
|
+
* c = 创建
|
|
170
|
+
* a = 添加
|
|
171
|
+
* s = 替换
|
|
172
|
+
* r = 移除
|
|
173
|
+
* aa = 添加全部
|
|
174
|
+
* ra = 移除全部
|
|
175
|
+
* m = 修改组名
|
|
176
|
+
* d = 删除
|
|
177
|
+
param (list): 待操作的编号,支持的格式:*, *to*; *by*,仅用于替换。
|
|
178
|
+
例子:[2,3,5,"8to10"] ["2by3","5by6","8by10"] 重合的编号自动忽略
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
tuple (bool, str): 是否成功,失败原因
|
|
182
|
+
'''
|
|
183
|
+
pass
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from ..core import osis_run, set_run_mode
|
|
2
|
+
from ..boundary import *
|
|
3
|
+
from ..control import *
|
|
4
|
+
from ..element import *
|
|
5
|
+
from ..live import *
|
|
6
|
+
from ..load import *
|
|
7
|
+
from ..material import *
|
|
8
|
+
from ..node import *
|
|
9
|
+
# from ..post import *
|
|
10
|
+
from ..property import *
|
|
11
|
+
from ..general import *
|
|
12
|
+
from ..section import *
|
|
13
|
+
from ..stage import *
|
|
14
|
+
from ..geometry import *
|
|
@@ -4,7 +4,7 @@ pyosis.core.command 的 Docstring
|
|
|
4
4
|
===
|
|
5
5
|
# OSIS命令流兼容
|
|
6
6
|
'''
|
|
7
|
-
|
|
7
|
+
import os
|
|
8
8
|
import datetime
|
|
9
9
|
import inspect
|
|
10
10
|
import functools
|
|
@@ -27,13 +27,56 @@ def osis_run(strCmd: str="", mode: Literal["stash", "exec"]="exec") -> Tuple[boo
|
|
|
27
27
|
e = OSISEngine.GetInstance()
|
|
28
28
|
return e.OSIS_Run(strCmd, mode)
|
|
29
29
|
|
|
30
|
-
def _log(text, filename="pyosis.log"):
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
# def _log(text, filename="pyosis.log"):
|
|
31
|
+
# """简单的日志函数"""
|
|
32
|
+
# timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
33
|
+
# with open(filename, 'a', encoding='utf-8') as f:
|
|
34
|
+
# f.write(f"[{timestamp}] {text}\n")
|
|
35
|
+
# f.close()
|
|
36
36
|
|
|
37
|
+
def _log(text, log_dir="pyosis_logs"):
|
|
38
|
+
"""
|
|
39
|
+
同一轮执行(<1秒间隔)的代码追加到同一文件,
|
|
40
|
+
超过1秒则创建新文件
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
text: 要记录的代码行
|
|
44
|
+
log_dir: 日志文件夹路径
|
|
45
|
+
Returns:
|
|
46
|
+
目标文件路径
|
|
47
|
+
"""
|
|
48
|
+
# 创建日志目录
|
|
49
|
+
if not os.path.exists(log_dir):
|
|
50
|
+
os.makedirs(log_dir)
|
|
51
|
+
files = []
|
|
52
|
+
else:
|
|
53
|
+
# 获取所有文件(排除子目录)
|
|
54
|
+
files = [os.path.join(log_dir, f) for f in os.listdir(log_dir)
|
|
55
|
+
if os.path.isfile(os.path.join(log_dir, f))]
|
|
56
|
+
|
|
57
|
+
current_time = datetime.datetime.now()
|
|
58
|
+
target_file = None
|
|
59
|
+
is_new_file = True
|
|
60
|
+
|
|
61
|
+
# 查找最近修改的文件
|
|
62
|
+
if files:
|
|
63
|
+
latest_file = max(files, key=os.path.getmtime)
|
|
64
|
+
mtime = datetime.datetime.fromtimestamp(os.path.getmtime(latest_file))
|
|
65
|
+
|
|
66
|
+
# 如果小于1秒,追加到该文件
|
|
67
|
+
if (current_time - mtime).total_seconds() < 1.0:
|
|
68
|
+
target_file = latest_file
|
|
69
|
+
is_new_file = False
|
|
70
|
+
|
|
71
|
+
# 需要创建新文件
|
|
72
|
+
if is_new_file:
|
|
73
|
+
timestamp = current_time.strftime("%Y%m%d_%H%M%S_%f")[:-3] # 毫秒级
|
|
74
|
+
target_file = os.path.join(log_dir, f"session_{timestamp}.txt")
|
|
75
|
+
|
|
76
|
+
with open(target_file, 'a', encoding='utf-8') as f:
|
|
77
|
+
f.write(f"{text}\n")
|
|
78
|
+
|
|
79
|
+
return target_file
|
|
37
80
|
|
|
38
81
|
class OSISFunctionRegistry:
|
|
39
82
|
"""
|
|
@@ -41,7 +84,7 @@ class OSISFunctionRegistry:
|
|
|
41
84
|
|
|
42
85
|
---
|
|
43
86
|
Attributes:
|
|
44
|
-
commands (dict):
|
|
87
|
+
commands (dict): 存储所有注册的命令,键为函数名称,值为对应的函数信息
|
|
45
88
|
|
|
46
89
|
Example:
|
|
47
90
|
>>> REGISTRY = OSISFunctionRegistry()
|
|
@@ -76,7 +119,7 @@ class OSISFunctionRegistry:
|
|
|
76
119
|
注册函数装饰器
|
|
77
120
|
|
|
78
121
|
Args:
|
|
79
|
-
cmd_name:
|
|
122
|
+
cmd_name: 命令名,不提供则使用函数名
|
|
80
123
|
"""
|
|
81
124
|
def decorator(func):
|
|
82
125
|
name = cmd_name or func.__name__
|
|
@@ -146,7 +189,9 @@ class OSISFunctionRegistry:
|
|
|
146
189
|
def _execute_command(self, cmd) -> Tuple[bool, str, Any]:
|
|
147
190
|
"""执行命令(发送到软件)"""
|
|
148
191
|
_log(cmd)
|
|
149
|
-
|
|
192
|
+
result = osis_run(cmd, self.run_mode)
|
|
193
|
+
isok, error, *rest = result
|
|
194
|
+
return result
|
|
150
195
|
|
|
151
196
|
def list_commands(self):
|
|
152
197
|
"""列出所有命令"""
|
|
@@ -163,7 +208,7 @@ class OSISFunctionRegistry:
|
|
|
163
208
|
|
|
164
209
|
def set_run_mode(self, mode: Literal["stash", "exec"]="exec"):
|
|
165
210
|
'''设置命令运行模式,默认是暂存,可以提高性能'''
|
|
166
|
-
self.
|
|
211
|
+
self.run_mode = mode
|
|
167
212
|
|
|
168
213
|
# 全局函数注册表实例
|
|
169
214
|
REGISTRY = OSISFunctionRegistry() # 作用为提供python函数和命令流的映射关系,保证参数个数与顺序正常,python函数一定要注册一下
|