osis-python 0.2.1__tar.gz → 0.2.3__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.
Files changed (95) hide show
  1. {osis_python-0.2.1/src/osis_python.egg-info → osis_python-0.2.3}/PKG-INFO +1 -1
  2. {osis_python-0.2.1 → osis_python-0.2.3/src/osis_python.egg-info}/PKG-INFO +1 -1
  3. {osis_python-0.2.1 → osis_python-0.2.3}/src/osis_python.egg-info/SOURCES.txt +25 -5
  4. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/__init__.py +1 -1
  5. osis_python-0.2.3/src/pyosis/boundary/__init__.py +7 -0
  6. osis_python-0.2.3/src/pyosis/boundary/manager.py +342 -0
  7. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/core/all_func.py +3 -2
  8. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/core/client.py +2 -3
  9. osis_python-0.2.3/src/pyosis/element/__init__.py +2 -0
  10. osis_python-0.2.3/src/pyosis/element/manager.py +403 -0
  11. osis_python-0.2.3/src/pyosis/io/__init__.py +11 -0
  12. osis_python-0.2.3/src/pyosis/io/boundary_info.py +239 -0
  13. osis_python-0.2.3/src/pyosis/io/coordinate.py +98 -0
  14. osis_python-0.2.3/src/pyosis/io/element_info.py +489 -0
  15. osis_python-0.2.3/src/pyosis/io/group_info.py +82 -0
  16. osis_python-0.2.3/src/pyosis/io/material_info.py +39 -0
  17. osis_python-0.2.3/src/pyosis/io/node_info.py +192 -0
  18. osis_python-0.2.3/src/pyosis/io/prestressed_info.py +170 -0
  19. osis_python-0.2.3/src/pyosis/io/response.py +135 -0
  20. osis_python-0.2.3/src/pyosis/io/section_info.py +162 -0
  21. osis_python-0.2.3/src/pyosis/io/stage_info.py +187 -0
  22. osis_python-0.2.3/src/pyosis/live/__init__.py +11 -0
  23. osis_python-0.2.3/src/pyosis/live/manager.py +668 -0
  24. osis_python-0.2.3/src/pyosis/load/__init__.py +4 -0
  25. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/load/loadcase.py +2 -2
  26. osis_python-0.2.3/src/pyosis/load/manager.py +392 -0
  27. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/load/static.py +52 -0
  28. osis_python-0.2.3/src/pyosis/material/__init__.py +2 -0
  29. osis_python-0.2.3/src/pyosis/material/manager.py +354 -0
  30. osis_python-0.2.3/src/pyosis/node/__init__.py +2 -0
  31. osis_python-0.2.3/src/pyosis/node/manager.py +245 -0
  32. osis_python-0.2.3/src/pyosis/post/__init__.py +1 -0
  33. osis_python-0.2.3/src/pyosis/post/combine.py +90 -0
  34. {osis_python-0.2.1/src/pyosis/post → osis_python-0.2.3/src/pyosis/result}/env.py +1 -1
  35. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/section/__init__.py +1 -1
  36. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/section/common.py +10 -10
  37. osis_python-0.2.3/src/pyosis/section/manager.py +1252 -0
  38. osis_python-0.2.3/src/pyosis/stage/__init__.py +4 -0
  39. osis_python-0.2.3/src/pyosis/stage/manager.py +349 -0
  40. osis_python-0.2.1/src/pyosis/boundary/__init__.py +0 -7
  41. osis_python-0.2.1/src/pyosis/live/__init__.py +0 -3
  42. osis_python-0.2.1/src/pyosis/load/__init__.py +0 -3
  43. osis_python-0.2.1/src/pyosis/node/__init__.py +0 -1
  44. osis_python-0.2.1/src/pyosis/quick_building/__init__.py +0 -1
  45. osis_python-0.2.1/src/pyosis/section/io.py +0 -28
  46. osis_python-0.2.1/src/pyosis/stage/__init__.py +0 -3
  47. osis_python-0.2.1/src/pyosis/thickness/__init__.py +0 -1
  48. {osis_python-0.2.1 → osis_python-0.2.3}/LICENSE +0 -0
  49. {osis_python-0.2.1 → osis_python-0.2.3}/README.md +0 -0
  50. {osis_python-0.2.1 → osis_python-0.2.3}/pyproject.toml +0 -0
  51. {osis_python-0.2.1 → osis_python-0.2.3}/setup.cfg +0 -0
  52. {osis_python-0.2.1 → osis_python-0.2.3}/src/osis_python.egg-info/dependency_links.txt +0 -0
  53. {osis_python-0.2.1 → osis_python-0.2.3}/src/osis_python.egg-info/requires.txt +0 -0
  54. {osis_python-0.2.1 → osis_python-0.2.3}/src/osis_python.egg-info/top_level.txt +0 -0
  55. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/boundary/interface.py +0 -0
  56. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/common/__init__.py +0 -0
  57. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/common/interface.py +0 -0
  58. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/common/project.py +0 -0
  59. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/control/__init__.py +0 -0
  60. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/control/interface.py +0 -0
  61. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/core/PyInterface.pyi +0 -0
  62. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/core/__init__.py +0 -0
  63. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/core/command.py +0 -0
  64. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/element/interface.py +0 -0
  65. {osis_python-0.2.1/src/pyosis/element → osis_python-0.2.3/src/pyosis/general}/__init__.py +0 -0
  66. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/general/interface.py +0 -0
  67. {osis_python-0.2.1/src/pyosis/general → osis_python-0.2.3/src/pyosis/geometry}/__init__.py +0 -0
  68. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/geometry/interface.py +0 -0
  69. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/live/analysis.py +0 -0
  70. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/live/grade.py +0 -0
  71. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/live/lane.py +0 -0
  72. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/load/tendon.py +0 -0
  73. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/material/interface.py +0 -0
  74. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/node/interface.py +0 -0
  75. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/property/__init__.py +0 -0
  76. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/property/comp_thickness.py +0 -0
  77. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/property/coordinate.py +0 -0
  78. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/property/creep_shrink.py +0 -0
  79. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/property/damping.py +0 -0
  80. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/property/pu_curve.py +0 -0
  81. {osis_python-0.2.1/src/pyosis/geometry → osis_python-0.2.3/src/pyosis/quick_building}/__init__.py +0 -0
  82. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/quick_building/interface.py +0 -0
  83. {osis_python-0.2.1/src/pyosis/post → osis_python-0.2.3/src/pyosis/result}/__init__.py +0 -0
  84. {osis_python-0.2.1/src/pyosis/post → osis_python-0.2.3/src/pyosis/result}/check.py +0 -0
  85. {osis_python-0.2.1/src/pyosis/post → osis_python-0.2.3/src/pyosis/result}/loadcase.py +0 -0
  86. {osis_python-0.2.1/src/pyosis/post → osis_python-0.2.3/src/pyosis/result}/result.py +0 -0
  87. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/section/numeric.py +0 -0
  88. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/section/param.py +0 -0
  89. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/section/rebar.py +0 -0
  90. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/section/rib.py +0 -0
  91. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/section/steel.py +0 -0
  92. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/stage/define.py +0 -0
  93. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/stage/overall.py +0 -0
  94. {osis_python-0.2.1/src/pyosis/material → osis_python-0.2.3/src/pyosis/thickness}/__init__.py +0 -0
  95. {osis_python-0.2.1 → osis_python-0.2.3}/src/pyosis/thickness/interface.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.2.1
3
+ Version: 0.2.3
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.2.1
3
+ Version: 0.2.3
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
@@ -9,6 +9,7 @@ src/osis_python.egg-info/top_level.txt
9
9
  src/pyosis/__init__.py
10
10
  src/pyosis/boundary/__init__.py
11
11
  src/pyosis/boundary/interface.py
12
+ src/pyosis/boundary/manager.py
12
13
  src/pyosis/common/__init__.py
13
14
  src/pyosis/common/interface.py
14
15
  src/pyosis/common/project.py
@@ -21,27 +22,40 @@ src/pyosis/core/client.py
21
22
  src/pyosis/core/command.py
22
23
  src/pyosis/element/__init__.py
23
24
  src/pyosis/element/interface.py
25
+ src/pyosis/element/manager.py
24
26
  src/pyosis/general/__init__.py
25
27
  src/pyosis/general/interface.py
26
28
  src/pyosis/geometry/__init__.py
27
29
  src/pyosis/geometry/interface.py
30
+ src/pyosis/io/__init__.py
31
+ src/pyosis/io/boundary_info.py
32
+ src/pyosis/io/coordinate.py
33
+ src/pyosis/io/element_info.py
34
+ src/pyosis/io/group_info.py
35
+ src/pyosis/io/material_info.py
36
+ src/pyosis/io/node_info.py
37
+ src/pyosis/io/prestressed_info.py
38
+ src/pyosis/io/response.py
39
+ src/pyosis/io/section_info.py
40
+ src/pyosis/io/stage_info.py
28
41
  src/pyosis/live/__init__.py
29
42
  src/pyosis/live/analysis.py
30
43
  src/pyosis/live/grade.py
31
44
  src/pyosis/live/lane.py
45
+ src/pyosis/live/manager.py
32
46
  src/pyosis/load/__init__.py
33
47
  src/pyosis/load/loadcase.py
48
+ src/pyosis/load/manager.py
34
49
  src/pyosis/load/static.py
35
50
  src/pyosis/load/tendon.py
36
51
  src/pyosis/material/__init__.py
37
52
  src/pyosis/material/interface.py
53
+ src/pyosis/material/manager.py
38
54
  src/pyosis/node/__init__.py
39
55
  src/pyosis/node/interface.py
56
+ src/pyosis/node/manager.py
40
57
  src/pyosis/post/__init__.py
41
- src/pyosis/post/check.py
42
- src/pyosis/post/env.py
43
- src/pyosis/post/loadcase.py
44
- src/pyosis/post/result.py
58
+ src/pyosis/post/combine.py
45
59
  src/pyosis/property/__init__.py
46
60
  src/pyosis/property/comp_thickness.py
47
61
  src/pyosis/property/coordinate.py
@@ -50,9 +64,14 @@ src/pyosis/property/damping.py
50
64
  src/pyosis/property/pu_curve.py
51
65
  src/pyosis/quick_building/__init__.py
52
66
  src/pyosis/quick_building/interface.py
67
+ src/pyosis/result/__init__.py
68
+ src/pyosis/result/check.py
69
+ src/pyosis/result/env.py
70
+ src/pyosis/result/loadcase.py
71
+ src/pyosis/result/result.py
53
72
  src/pyosis/section/__init__.py
54
73
  src/pyosis/section/common.py
55
- src/pyosis/section/io.py
74
+ src/pyosis/section/manager.py
56
75
  src/pyosis/section/numeric.py
57
76
  src/pyosis/section/param.py
58
77
  src/pyosis/section/rebar.py
@@ -60,6 +79,7 @@ src/pyosis/section/rib.py
60
79
  src/pyosis/section/steel.py
61
80
  src/pyosis/stage/__init__.py
62
81
  src/pyosis/stage/define.py
82
+ src/pyosis/stage/manager.py
63
83
  src/pyosis/stage/overall.py
64
84
  src/pyosis/thickness/__init__.py
65
85
  src/pyosis/thickness/interface.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.2.1"
10
+ __version__ = "0.2.3"
11
11
  __author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
12
12
 
13
13
  # from .core import engine
@@ -0,0 +1,7 @@
1
+ '''
2
+ pyosis.boundary 的 Docstring
3
+
4
+ '''
5
+
6
+ from .interface import *
7
+ from .manager import boundary_manager
@@ -0,0 +1,342 @@
1
+ """边界管理器 - 统一管理边界的增删改查
2
+
3
+ 设计理念:
4
+ - 隐藏 HTTP 接口细节,提供原生 Python 风格 API
5
+ - 返回数据类对象而非 HTTP 元组
6
+ - 内部维护边界列表,通过 get 等方法查询,不暴露 HTTP 接口细节
7
+
8
+ 支持的边界类型:GENERAL(一般边界)、MSTSLV(主从约束)、RELEASE(释放梁端约束)、
9
+ ELSTCSPT(弹性支承)
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from dataclasses import dataclass
15
+
16
+ from ..core.client import osis_client
17
+ from .interface import (
18
+ osis_boundary_general,
19
+ osis_boundary_elstcspt,
20
+ osis_boundary_master_slave,
21
+ osis_boundary_release,
22
+ osis_boundary_dle,
23
+ )
24
+
25
+
26
+ # ──────────────────────────────────────────────
27
+ # 数据类
28
+ # ──────────────────────────────────────────────
29
+
30
+
31
+ @dataclass(frozen=True)
32
+ class Boundary:
33
+ """边界对象
34
+
35
+ 由 BoundaryManager 内部创建,用户不应直接实例化。
36
+ """
37
+
38
+ no: int
39
+ name: str = ""
40
+ boundary_type: str = "" # "General", "MstSlv", "Release", "ElstcSpt", "GeneralElstcSpt"
41
+ entity_vec: list[int] | None = None
42
+ is_occupied: bool = False
43
+
44
+ @classmethod
45
+ def _from_dict(cls, d: dict) -> Boundary:
46
+ """从接口 dict 构造 Boundary 对象(内部使用)"""
47
+ type_names = {
48
+ 1: "General",
49
+ 2: "MstSlv",
50
+ 3: "Rigid",
51
+ 4: "Release",
52
+ 5: "ElstcSpt",
53
+ 6: "GeneralElstcSpt",
54
+ }
55
+ return cls(
56
+ no=d.get("no", 0),
57
+ name=d.get("name", ""),
58
+ boundary_type=type_names.get(d.get("type", 0), "Unknown"),
59
+ entity_vec=d.get("entityVec", []),
60
+ is_occupied=d.get("isOccupied", False),
61
+ )
62
+
63
+
64
+ # ──────────────────────────────────────────────
65
+ # 管理类
66
+ # ──────────────────────────────────────────────
67
+
68
+
69
+ class BoundaryManager:
70
+ """边界管理器
71
+
72
+ 统一管理边界的创建、删除和查询。
73
+
74
+ 用法:
75
+ >>> from pyosis.boundary import boundary_manager
76
+ >>> boundary_manager.create_general(1, bX=1, bY=1, bZ=1, bRX=0, bRY=0, bRZ=0) # 创建一般边界
77
+ >>> boundary_manager.create_elstcspt(2, DX=1e10, DY=1e10, DZ=1e10) # 创建弹性支承
78
+ >>> boundary_manager.create_master_slave(3, nNode=1, bX=1, bY=1, bZ=1) # 创建主从约束
79
+ >>> bd = boundary_manager.get(1) # 按编号查询
80
+ >>> all_bds = boundary_manager.all() # 获取全部边界
81
+ >>> boundary_manager.delete(1) # 删除边界
82
+ """
83
+
84
+ def __init__(self) -> None:
85
+ self._boundaries: list[Boundary] = []
86
+ self._bd_map: dict[int, Boundary] = {} # 按编号索引:O(1) 查询
87
+ self._loaded: bool = False
88
+
89
+ # ── 数据加载 ──────────────────────────────
90
+
91
+ def _load(self) -> None:
92
+ """从服务端加载所有边界信息(延迟加载,带缓存)"""
93
+ if self._loaded:
94
+ return
95
+ resp = osis_client("GetAllBoundaryInfo", {})
96
+ if isinstance(resp, tuple):
97
+ raise RuntimeError(f"加载边界信息失败: {resp[1]}")
98
+ self._boundaries = [
99
+ Boundary._from_dict(d) for d in resp.get("data", []) if isinstance(d, dict) and "no" in d
100
+ ]
101
+
102
+ # 构建索引:编号 -> 边界对象 (O(1) 查询)
103
+ self._bd_map = {bd.no: bd for bd in self._boundaries}
104
+
105
+ self._loaded = True
106
+
107
+ def refresh(self) -> None:
108
+ """强制刷新缓存(模型变更后自动调用,也可手动调用)"""
109
+ self._boundaries = []
110
+ self._bd_map = {}
111
+ self._loaded = False
112
+ self._load()
113
+
114
+ # ── 增删改 ────────────────────────────────
115
+
116
+ def create_general(
117
+ self,
118
+ no: int,
119
+ nCoor: int = None,
120
+ bX: bool = 1,
121
+ bY: bool = 1,
122
+ bZ: bool = 1,
123
+ bRX: bool = 1,
124
+ bRY: bool = 1,
125
+ bRZ: bool = 1,
126
+ bRW: bool = 1,
127
+ ) -> None:
128
+ """创建一般边界
129
+
130
+ Args:
131
+ no: 边界编号
132
+ nCoor: 局部坐标系编号,"" 代表缺省
133
+ bX: UX方向,0=释放,1=约束
134
+ bY: UY方向,0=释放,1=约束
135
+ bZ: UZ方向,0=释放,1=约束
136
+ bRX: RX方向,0=释放,1=约束
137
+ bRY: RY方向,0=释放,1=约束
138
+ bRZ: RZ方向,0=释放,1=约束
139
+ bRW: RW方向,0=释放,1=约束
140
+
141
+ Raises:
142
+ RuntimeError: 创建失败时抛出异常
143
+ """
144
+ if nCoor is None:
145
+ nCoor = ""
146
+ ok, err = osis_boundary_general(no, "GENERAL", nCoor, bX, bY, bZ, bRX, bRY, bRZ, bRW)
147
+ if not ok:
148
+ raise RuntimeError(f"创建一般边界 {no} 失败: {err}")
149
+ self._loaded = False
150
+
151
+ def create_elstcspt(
152
+ self,
153
+ no: int,
154
+ nCoor: int = None,
155
+ bX: bool = 1,
156
+ DX: float = 1e13,
157
+ bY: bool = 1,
158
+ DY: float = 1e13,
159
+ bZ: bool = 1,
160
+ DZ: float = 1e13,
161
+ bRX: bool = 1,
162
+ RX: float = 1e16,
163
+ bRY: bool = 1,
164
+ RY: float = 1e16,
165
+ bRZ: bool = 1,
166
+ RZ: float = 1e16,
167
+ ) -> None:
168
+ """创建弹簧单元弹性支承
169
+
170
+ Args:
171
+ no: 边界编号
172
+ nCoor: 局部坐标系编号,固定使用""缺省
173
+ bX: UX方向,0=弹性,1=固定
174
+ DX: 坐标系X轴方向的弹性支承刚度
175
+ bY: UY方向,0=弹性,1=固定
176
+ DY: 坐标系Y轴方向的弹性支承刚度
177
+ bZ: UZ方向,0=弹性,1=固定
178
+ DZ: 坐标系Z轴方向的弹性支承刚度
179
+ bRX: RX方向,0=弹性,1=固定
180
+ RX: 绕坐标系X轴方向的转动弹性刚度
181
+ bRY: RY方向,0=弹性,1=固定
182
+ RY: 绕坐标系Y轴方向的转动弹性刚度
183
+ bRZ: RZ方向,0=弹性,1=固定
184
+ RZ: 绕坐标系Z轴方向的转动弹性刚度
185
+
186
+ Raises:
187
+ RuntimeError: 创建失败时抛出异常
188
+ """
189
+ if nCoor is None:
190
+ nCoor = ""
191
+ ok, err = osis_boundary_elstcspt(
192
+ no, "ELSTCSPT", nCoor, bX, DX, bY, DY, bZ, DZ, bRX, RX, bRY, RY, bRZ, RZ
193
+ )
194
+ if not ok:
195
+ raise RuntimeError(f"创建弹性支承 {no} 失败: {err}")
196
+ self._loaded = False
197
+
198
+ def create_master_slave(
199
+ self,
200
+ no: int,
201
+ nNode: int,
202
+ bX: bool = 1,
203
+ bY: bool = 1,
204
+ bZ: bool = 1,
205
+ bRX: bool = 1,
206
+ bRY: bool = 1,
207
+ bRZ: bool = 1,
208
+ ) -> None:
209
+ """创建主从约束
210
+
211
+ Args:
212
+ no: 边界编号
213
+ nNode: 主节点编号
214
+ bX: UX方向,0=释放,1=约束
215
+ bY: UY方向,0=释放,1=约束
216
+ bZ: UZ方向,0=释放,1=约束
217
+ bRX: RX方向,0=释放,1=约束
218
+ bRY: RY方向,0=释放,1=约束
219
+ bRZ: RZ方向,0=释放,1=约束
220
+
221
+ Raises:
222
+ RuntimeError: 创建失败时抛出异常
223
+ """
224
+ ok, err = osis_boundary_master_slave(no, "MSTSLV", nNode, bX, bY, bZ, bRX, bRY, bRZ)
225
+ if not ok:
226
+ raise RuntimeError(f"创建主从约束 {no} 失败: {err}")
227
+ self._loaded = False
228
+
229
+ def create_release(
230
+ self,
231
+ no: int,
232
+ Fxi_state: bool,
233
+ Fyi_state: bool,
234
+ Fzi_state: bool,
235
+ Mxi_state: bool,
236
+ Myi_state: bool,
237
+ Mzi_state: bool,
238
+ Mbi_state: bool,
239
+ Fxi: float,
240
+ Fyi: float,
241
+ Fzi: float,
242
+ Mxi: float,
243
+ Myi: float,
244
+ Mzi: float,
245
+ Mbi: float,
246
+ Fxj_state: bool,
247
+ Fyj_state: bool,
248
+ Fzj_state: bool,
249
+ Mxj_state: bool,
250
+ Myj_state: bool,
251
+ Mzj_state: bool,
252
+ Mbj_state: bool,
253
+ Fxj: float,
254
+ Fyj: float,
255
+ Fzj: float,
256
+ Mxj: float,
257
+ Myj: float,
258
+ Mzj: float,
259
+ Mbj: float,
260
+ ) -> None:
261
+ """创建释放梁端约束
262
+
263
+ Args:
264
+ no: 边界编号
265
+ Fxi_state等: 端部约束状态,0=释放,1=约束
266
+ Fxi等: 约束值,0-1之间,表示释放后残余的约束能力的百分比
267
+
268
+ Raises:
269
+ RuntimeError: 创建失败时抛出异常
270
+ """
271
+ ok, err = osis_boundary_release(
272
+ no, "RELEASE",
273
+ Fxi_state, Fyi_state, Fzi_state, Mxi_state, Myi_state, Mzi_state, Mbi_state,
274
+ Fxi, Fyi, Fzi, Mxi, Myi, Mzi, Mbi,
275
+ Fxj_state, Fyj_state, Fzj_state, Mxj_state, Myj_state, Mzj_state, Mbj_state,
276
+ Fxj, Fyj, Fzj, Mxj, Myj, Mzj, Mbj,
277
+ )
278
+ if not ok:
279
+ raise RuntimeError(f"创建释放梁端约束 {no} 失败: {err}")
280
+ self._loaded = False
281
+
282
+ def delete(self, no: int) -> None:
283
+ """删除边界
284
+
285
+ Args:
286
+ no: 边界编号
287
+
288
+ Raises:
289
+ RuntimeError: 删除失败时抛出异常
290
+ """
291
+ ok, err = osis_boundary_dle(no)
292
+ if not ok:
293
+ raise RuntimeError(f"删除边界 {no} 失败: {err}")
294
+ self._loaded = False
295
+
296
+ # ── 查询 ──────────────────────────────────
297
+
298
+ def get(self, no: int | list[int]) -> Boundary | list[Boundary | None]:
299
+ """根据编号获取单个或多个边界 (O(k))
300
+
301
+ Args:
302
+ no: 边界编号
303
+
304
+ Returns:
305
+ Boundary 对象或数组;边界不存在返回 None
306
+ """
307
+ self._load()
308
+ if isinstance(no, int):
309
+ return self._bd_map.get(no)
310
+ elif isinstance(no, list):
311
+ return [self._bd_map.get(n) for n in no]
312
+ else:
313
+ raise TypeError(f"不支持的编号类型: {type(no)}")
314
+
315
+ def all(self) -> list[Boundary]:
316
+ """获取所有边界
317
+
318
+ Returns:
319
+ 全部边界列表
320
+ """
321
+ self._load()
322
+ return list(self._boundaries)
323
+
324
+ def count(self) -> int:
325
+ """获取边界总数
326
+
327
+ Returns:
328
+ 边界数量
329
+ """
330
+ self._load()
331
+ return len(self._boundaries)
332
+
333
+ def __repr__(self) -> str:
334
+ self._load()
335
+ return f"BoundaryManager(count={len(self._boundaries)})"
336
+
337
+
338
+ # ──────────────────────────────────────────────
339
+ # 全局单例
340
+ # ──────────────────────────────────────────────
341
+
342
+ boundary_manager = BoundaryManager()
@@ -7,10 +7,11 @@ from ..live import *
7
7
  from ..load import *
8
8
  from ..material import *
9
9
  from ..node import *
10
- from ..post import *
10
+ from ..result import *
11
11
  from ..property import *
12
12
  from ..general import *
13
13
  from ..section import *
14
14
  from ..stage import *
15
15
  from ..geometry import *
16
- from ..thickness import *
16
+ from ..thickness import *
17
+ from ..io import *
@@ -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 tuple(response.json())
48
-
47
+ return response.json()
49
48
  except Exception as e:
50
49
  # 异常时保持和 C++ 一致的返回格式
51
50
  return False, f"调用失败: {str(e)}"
@@ -0,0 +1,2 @@
1
+ from .interface import *
2
+ from .manager import element_manager