osis-python 0.3.9__tar.gz → 0.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. {osis_python-0.3.9/src/osis_python.egg-info → osis_python-0.4.1}/PKG-INFO +1 -1
  2. {osis_python-0.3.9 → osis_python-0.4.1/src/osis_python.egg-info}/PKG-INFO +1 -1
  3. {osis_python-0.3.9 → osis_python-0.4.1}/src/osis_python.egg-info/SOURCES.txt +1 -0
  4. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/__init__.py +1 -1
  5. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/boundary/manager.py +3 -3
  6. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/core/__init__.py +1 -0
  7. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/core/client.py +18 -1
  8. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/core/engine.py +18 -2
  9. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/dynamic/load_to_mass.py +4 -4
  10. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/dynamic/manager.py +65 -24
  11. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/dynamic/seismic.py +12 -8
  12. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/element/manager.py +46 -1
  13. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/live/manager.py +16 -0
  14. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/load/manager.py +1 -0
  15. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/post/manager.py +14 -0
  16. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/common.py +3 -3
  17. osis_python-0.4.1/src/pyosis/section/composite.py +229 -0
  18. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/manager.py +875 -586
  19. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/rebar.py +35 -0
  20. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/settlement/interface.py +8 -8
  21. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/settlement/manager.py +12 -12
  22. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/stability/buckling.py +4 -4
  23. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/stability/manager.py +6 -6
  24. {osis_python-0.3.9 → osis_python-0.4.1}/LICENSE +0 -0
  25. {osis_python-0.3.9 → osis_python-0.4.1}/README.md +0 -0
  26. {osis_python-0.3.9 → osis_python-0.4.1}/pyproject.toml +0 -0
  27. {osis_python-0.3.9 → osis_python-0.4.1}/setup.cfg +0 -0
  28. {osis_python-0.3.9 → osis_python-0.4.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
  29. {osis_python-0.3.9 → osis_python-0.4.1}/src/osis_python.egg-info/requires.txt +0 -0
  30. {osis_python-0.3.9 → osis_python-0.4.1}/src/osis_python.egg-info/top_level.txt +0 -0
  31. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/boundary/__init__.py +0 -0
  32. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/boundary/interface.py +0 -0
  33. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/control/__init__.py +0 -0
  34. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/control/control.py +0 -0
  35. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/control/io.py +0 -0
  36. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/control/manager.py +0 -0
  37. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/control/nonlinear.py +0 -0
  38. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/core/all_func.py +0 -0
  39. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/core/command.py +0 -0
  40. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/dynamic/__init__.py +0 -0
  41. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/dynamic/modal.py +0 -0
  42. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/element/__init__.py +0 -0
  43. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/element/interface.py +0 -0
  44. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/general/__init__.py +0 -0
  45. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/general/interface.py +0 -0
  46. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/geometry/__init__.py +0 -0
  47. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/geometry/interface.py +0 -0
  48. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/geometry/manager.py +0 -0
  49. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/live/__init__.py +0 -0
  50. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/live/analysis.py +0 -0
  51. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/live/grade.py +0 -0
  52. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/live/lane.py +0 -0
  53. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/load/__init__.py +0 -0
  54. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/load/loadcase.py +0 -0
  55. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/load/static.py +0 -0
  56. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/load/tendon.py +0 -0
  57. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/material/__init__.py +0 -0
  58. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/material/interface.py +0 -0
  59. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/material/manager.py +0 -0
  60. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/node/__init__.py +0 -0
  61. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/node/interface.py +0 -0
  62. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/node/manager.py +0 -0
  63. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/post/__init__.py +0 -0
  64. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/post/combine.py +0 -0
  65. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/post/design_check.py +0 -0
  66. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/post/display.py +0 -0
  67. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/project/__init__.py +0 -0
  68. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/project/interface.py +0 -0
  69. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/project/manager.py +0 -0
  70. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/property/__init__.py +0 -0
  71. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/property/component_thickness.py +0 -0
  72. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/property/coordinate.py +0 -0
  73. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/property/creep_shrink.py +0 -0
  74. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/property/damping.py +0 -0
  75. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/property/manager.py +0 -0
  76. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/property/pu_curve.py +0 -0
  77. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/quick_building/__init__.py +0 -0
  78. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/quick_building/interface.py +0 -0
  79. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/result/__init__.py +0 -0
  80. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/result/check.py +0 -0
  81. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/result/env.py +0 -0
  82. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/result/loadcase.py +0 -0
  83. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/result/manager.py +0 -0
  84. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/result/result.py +0 -0
  85. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/__init__.py +0 -0
  86. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/numeric.py +0 -0
  87. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/param.py +0 -0
  88. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/rib.py +0 -0
  89. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/section/steel.py +0 -0
  90. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/settlement/__init__.py +0 -0
  91. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/stability/__init__.py +0 -0
  92. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/stage/__init__.py +0 -0
  93. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/stage/define.py +0 -0
  94. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/stage/manager.py +0 -0
  95. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/stage/overall.py +0 -0
  96. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/thickness/__init__.py +0 -0
  97. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/thickness/interface.py +0 -0
  98. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/thickness/manager.py +0 -0
  99. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/transfer/__init__.py +0 -0
  100. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/transfer/command_map.py +0 -0
  101. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/transfer/generator.py +0 -0
  102. {osis_python-0.3.9 → osis_python-0.4.1}/src/pyosis/transfer/parser.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.3.9
3
+ Version: 0.4.1
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.3.9
3
+ Version: 0.4.1
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
@@ -74,6 +74,7 @@ src/pyosis/result/manager.py
74
74
  src/pyosis/result/result.py
75
75
  src/pyosis/section/__init__.py
76
76
  src/pyosis/section/common.py
77
+ src/pyosis/section/composite.py
77
78
  src/pyosis/section/manager.py
78
79
  src/pyosis/section/numeric.py
79
80
  src/pyosis/section/param.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.3.9"
10
+ __version__ = "0.4.1"
11
11
  __author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
12
12
 
13
13
  from .core.engine import OSISEngine
@@ -293,7 +293,7 @@ class ElstcSptBoundary(Boundary):
293
293
  is_occupied=d.get("isOccupied"),
294
294
  is_selected=d.get("isSelected"),
295
295
  is_ploted=d.get("isPloted"),
296
- constraints=list(d.get("constraints")),
296
+ # constraints=list(d.get("constraints")),
297
297
  coor_no=d.get("coorNO"),
298
298
  k_values=list(d.get("k")),
299
299
  elastic_k=list(d.get("elasticK")),
@@ -333,8 +333,8 @@ class GeneralElstcSptBoundary(Boundary):
333
333
  flag_m=d.get("flagM"),
334
334
  flag_c=d.get("flagC"),
335
335
  stiffness_matrix=list(d.get("stiffnessMatrix")),
336
- mass_matrix=list(d.get("massMatrix")),
337
- damping_matrix=list(d.get("dampingMatrix")),
336
+ # mass_matrix=list(d.get("massMatrix")),
337
+ # damping_matrix=list(d.get("dampingMatrix")),
338
338
  )
339
339
 
340
340
  def __repr__(self) -> str:
@@ -9,3 +9,4 @@ OSISEngine中的函数,将会分发到各个模块,被再次封装,意图
9
9
  """
10
10
 
11
11
  from .command import REGISTRY, osis_run, set_run_mode
12
+ from .client import set_osis_port, set_osis_url
@@ -24,6 +24,23 @@ session = requests.Session()
24
24
  session.mount("http://", adapter)
25
25
  session.mount("https://", adapter) # 如果你后续用HTTPS
26
26
 
27
+ DEFAULT_PORT = 18080
28
+ DEFAULT_URL = "http://localhost"
29
+
30
+ def set_osis_url(url):
31
+ '''
32
+ 设置OSIS默认网址
33
+ '''
34
+ global DEFAULT_URL
35
+ DEFAULT_URL = url
36
+
37
+ def set_osis_port(port):
38
+ '''
39
+ 设置要连接的OSIS端口
40
+ '''
41
+ global DEFAULT_PORT
42
+ DEFAULT_PORT = port
43
+
27
44
  # ========== 通用客户端函数(复用连接池) ==========
28
45
  def osis_client(func_name: str, payload: dict, base_url=None) -> dict:
29
46
  """
@@ -34,7 +51,7 @@ def osis_client(func_name: str, payload: dict, base_url=None) -> dict:
34
51
  Returns:
35
52
  异常时返回 (False, 错误信息)
36
53
  """
37
- base_url = base_url or os.environ.get("OSIS_URL", "http://localhost:18080")
54
+ base_url = base_url or os.environ.get("OSIS_URL", f"{DEFAULT_URL}:{DEFAULT_PORT}")
38
55
  url = f"{base_url}/{func_name}"
39
56
 
40
57
  try:
@@ -19,6 +19,7 @@
19
19
 
20
20
  from __future__ import annotations
21
21
 
22
+ import os
22
23
  from typing import Any
23
24
 
24
25
  from ..material.manager import MaterialManager, material_manager
@@ -48,6 +49,7 @@ from ..general.interface import (
48
49
  osis_solve,
49
50
  )
50
51
  from .command import osis_run
52
+ from .client import set_osis_port, set_osis_url
51
53
 
52
54
 
53
55
  class OSISEngine:
@@ -81,7 +83,12 @@ class OSISEngine:
81
83
  - matrix(), output_result_for_calc_book()
82
84
  """
83
85
 
84
- def __init__(self) -> None:
86
+ def __init__(self, port=None, url="http://localhost") -> None:
87
+ '''
88
+ Args:
89
+ port (int): OSIS 端口号,为 `None` 自动尝试加载 `OSIS_HTTP_PORT` 环境变量,加载失败将设为默认值 18080
90
+ url (str): OSIS 网址
91
+ '''
85
92
  # 引用全局单例管理器
86
93
  self._material = material_manager
87
94
  self._section = section_manager
@@ -103,6 +110,15 @@ class OSISEngine:
103
110
  self._post = post_manager
104
111
  self._result = result_manager
105
112
 
113
+ # OSIS端口与网址
114
+ if port is None:
115
+ self._port = os.environ.get("OSIS_HTTP_PORT", 18080) # 如果设置了环境变量
116
+ else:
117
+ self._port = port
118
+ self._url = url
119
+ set_osis_url(self._url)
120
+ set_osis_port(self._port)
121
+
106
122
  # ──────────────────────────────────────────
107
123
  # 子管理器属性
108
124
  # ──────────────────────────────────────────
@@ -306,7 +322,7 @@ class OSISEngine:
306
322
  path (str): 完整文件名
307
323
 
308
324
  Notes:
309
- path 中如果不输入绝对路径的话,默认使用程序执行文件所在的路径,比如“D:\Rbin\X.sml”。
325
+ path 中如果不输入绝对路径的话,默认使用程序执行文件所在的路径,比如“D:\\Rbin\\X.sml”。
310
326
  """
311
327
  self.control.import_apdl(path)
312
328
 
@@ -42,12 +42,12 @@ def osis_ltm_anal_del(strName: str):
42
42
 
43
43
 
44
44
  @REGISTRY.register("LTMAnalMod")
45
- def osis_ltm_anal_mod(nOld: int, nNew: int):
46
- """修改荷载转换质量编号。
45
+ def osis_ltm_anal_mod(old_name: str, new_name: str):
46
+ """修改荷载转换质量名称。
47
47
 
48
48
  Args:
49
- nOld (int): 旧编号
50
- nNew (int): 新编号
49
+ old_name (str): 旧名称
50
+ new_name (str): 新名称
51
51
 
52
52
  Returns:
53
53
  tuple (bool, str): 返回一个元组,包含:
@@ -7,7 +7,7 @@
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
- from dataclasses import dataclass
10
+ from dataclasses import dataclass, field
11
11
  from typing import Literal
12
12
 
13
13
  from .load_to_mass import (
@@ -28,18 +28,54 @@ from .seismic import (
28
28
  )
29
29
  from ..core.client import osis_client
30
30
 
31
-
31
+ @dataclass(frozen=False)
32
+ class LoadToMassLcPara:
33
+ """荷载转换质量中的单个荷载工况参数"""
34
+ load_case: str
35
+ mass_factor: float
36
+ g: float
37
+ mass_dir: list[int] = field(default_factory=lambda: [1, 1, 1]) # [X, Y, Z]
38
+ trans_node_force: bool = True # transNForce
39
+ trans_beam_force: bool = True # transBForce
40
+ trans_surface_force: bool = False # transSForce
41
+ @classmethod
42
+ def _from_dict(cls, d: dict) -> LoadToMassLcPara:
43
+ return cls(
44
+ load_case=d.get("loadCase"),
45
+ mass_factor=d.get("massFactor"),
46
+ g=d.get("G"),
47
+ mass_dir=list(d.get("massDir") or [1, 1, 1]),
48
+ trans_node_force=bool(d.get("transNForce")),
49
+ trans_beam_force=bool(d.get("transBForce")),
50
+ trans_surface_force=bool(d.get("transSForce")),
51
+ )
32
52
  # ──────────────────────────────────────────────
33
53
  # 管理类
34
54
  # ──────────────────────────────────────────────
35
55
  @dataclass(frozen=False)
36
56
  class LoadToMass:
37
57
  name: str
58
+ no: int
59
+ analysis_type: int = 0
60
+ ok: bool = False
61
+ related_stages: list[int] = field(default_factory=list)
62
+ lc_paras_count: int = 0
63
+ lc_paras: list[LoadToMassLcPara] = field(default_factory=list)
38
64
 
39
65
  @classmethod
40
66
  def _from_dict(cls, d: dict) -> LoadToMass:
41
67
  return cls(
42
68
  name=d.get("name"),
69
+ no=d.get("no"),
70
+ analysis_type=d.get("analysisType", 0),
71
+ ok=bool(d.get("ok")),
72
+ related_stages=list(d.get("relatedStages") or []),
73
+ lc_paras_count=d.get("lcParasCount", 0),
74
+ lc_paras=[
75
+ LoadToMassLcPara._from_dict(p)
76
+ for p in (d.get("lcParas") or [])
77
+ if isinstance(p, dict)
78
+ ],
43
79
  )
44
80
 
45
81
  class LoadToMassManager:
@@ -102,16 +138,16 @@ class LoadToMassManager:
102
138
  if not ok:
103
139
  raise RuntimeError(f"删除荷载转换质量 {name} 失败: {err}")
104
140
 
105
- def renumber_ltm(self, old_no: int, new_no: int) -> None:
106
- """修改荷载转换质量编号。
141
+ def rename_ltm(self, old_name: str, new_name: str) -> None:
142
+ """修改荷载转换质量名称。
107
143
 
108
144
  Args:
109
- old_no: 旧编号
110
- new_no: 新编号
145
+ old_name: 旧名称
146
+ new_name: 新名称
111
147
  """
112
- ok, err = osis_ltm_anal_mod(old_no, new_no)
148
+ ok, err = osis_ltm_anal_mod(old_name, new_name)
113
149
  if not ok:
114
- raise RuntimeError(f"修改荷载转换质量编号 {old_no} -> {new_no} 失败: {err}")
150
+ raise RuntimeError(f"修改荷载转换质量名称 {old_name} -> {new_name} 失败: {err}")
115
151
 
116
152
  def add_ltm(
117
153
  self,
@@ -262,7 +298,7 @@ class SeisRspSpecManager:
262
298
  names = [str(name)]
263
299
  if not isinstance(names, list):
264
300
  raise TypeError(f"不支持的名称类型: {type(name)}")
265
- resp = osis_client("GetSeisRspSpecInfoByNames", {"name": names})
301
+ resp = osis_client("GetSeisRspSpecByNames", {"name": names})
266
302
  if not resp['success']:
267
303
  raise RuntimeError(f"{resp['error']}")
268
304
  rsp = [SeisRspSpec._from_dict(d) if d else None for d in resp.get("data", [])]
@@ -291,8 +327,13 @@ class SeisRspSpecManager:
291
327
  g: 输入g值
292
328
  spectrum_data: 反应谱数据列表,每个元素为 (周期, 谱值) 元组
293
329
  """
294
- n_num = len(spectrum_data)
295
- ok, err = osis_seis_rsp_spec_import(name, spec_type, g, n_num, spectrum_data)
330
+ if spectrum_data and isinstance(spectrum_data[0], tuple):
331
+ n_num = len(spectrum_data)
332
+ flat = [v for pair in spectrum_data for v in pair]
333
+ else:
334
+ flat = list(spectrum_data)
335
+ n_num = len(flat) // 2
336
+ ok, err = osis_seis_rsp_spec_import(name, spec_type, g, 0, n_num, flat)
296
337
  if not ok:
297
338
  raise RuntimeError(f"创建地震反应谱 {name} 失败: {err}")
298
339
 
@@ -332,7 +373,7 @@ class SeisRspSpecManager:
332
373
  delta_t: 周期间隔
333
374
  """
334
375
  ok, err = osis_seis_rsp_spec_code(
335
- name, spec_type, g,
376
+ name, spec_type, g,1,
336
377
  code, bridge_type, is_long_span, level, intensity,
337
378
  site, direction, period, ksi, t, delta_t
338
379
  )
@@ -349,16 +390,16 @@ class SeisRspSpecManager:
349
390
  if not ok:
350
391
  raise RuntimeError(f"删除地震反应谱 {name} 失败: {err}")
351
392
 
352
- def renumber_rsp_spec(self, old_no: int, new_no: int) -> None:
353
- """修改地震反应谱编号。
393
+ def rename_rsp_spec(self, old_name: str, new_name: str) -> None:
394
+ """修改地震反应谱名称。
354
395
 
355
396
  Args:
356
- old_no: 旧编号
357
- new_no: 新编号
397
+ old_name: 旧名称
398
+ new_name: 新名称
358
399
  """
359
- ok, err = osis_seis_rsp_spec_mod(old_no, new_no)
400
+ ok, err = osis_seis_rsp_spec_mod(old_name, new_name)
360
401
  if not ok:
361
- raise RuntimeError(f"修改地震反应谱编号 {old_no} -> {new_no} 失败: {err}")
402
+ raise RuntimeError(f"修改地震反应谱名称 {old_name} -> {new_name} 失败: {err}")
362
403
 
363
404
  @dataclass(frozen=False)
364
405
  class RspecAnal:
@@ -474,16 +515,16 @@ class RspecAnalManager:
474
515
  if not ok:
475
516
  raise RuntimeError(f"删除反应谱工况 {name} 失败: {err}")
476
517
 
477
- def renumber_rspec_anal(self, old_no: int, new_no: int) -> None:
478
- """修改反应谱工况编号。
518
+ def rename_rspec_anal(self, old_name: str, new_name: str) -> None:
519
+ """修改反应谱工况名称。
479
520
 
480
521
  Args:
481
- old_no: 旧编号
482
- new_no: 新编号
522
+ old_name: 旧名称
523
+ new_name: 新名称
483
524
  """
484
- ok, err = osis_rspec_anal_mod(old_no, new_no)
525
+ ok, err = osis_rspec_anal_mod(old_name, new_name)
485
526
  if not ok:
486
- raise RuntimeError(f"修改反应谱工况编号 {old_no} -> {new_no} 失败: {err}")
527
+ raise RuntimeError(f"修改反应谱工况名称 {old_name} -> {new_name} 失败: {err}")
487
528
 
488
529
  class DynamicManager:
489
530
  """动力分析管理器
@@ -18,6 +18,7 @@ def osis_seis_rsp_spec_import(
18
18
  strName: str,
19
19
  strType: Literal["N", "A", "V", "D"],
20
20
  dG: float,
21
+ inputType: int,
21
22
  nNum: int,
22
23
  spectrum_data: list[tuple[float, float]],
23
24
  ):
@@ -27,6 +28,7 @@ def osis_seis_rsp_spec_import(
27
28
  strName (str): 名称
28
29
  strType (str): 谱类型,N=无量纲加速度谱,A=加速度谱,V=速度谱,D=位移谱
29
30
  dG (float): 输入g值
31
+ inputtype:类型,0 = 导入
30
32
  nNum (int): 点数
31
33
  spectrum_data (list): 反应谱数据列表,每个元素为 (周期, 谱值) 元组
32
34
 
@@ -49,6 +51,7 @@ def osis_seis_rsp_spec_code(
49
51
  strName: str,
50
52
  strType: Literal["N", "A", "V", "D"],
51
53
  dG: float,
54
+ inputType: int = 1,
52
55
  strCode: str = "JTGT_2231_01_2020",
53
56
  strBridgeType: Literal["A", "B", "C", "D"] = "A",
54
57
  nIsLongSpan: Literal[0, 1] = 0,
@@ -67,6 +70,7 @@ def osis_seis_rsp_spec_code(
67
70
  strName (str): 名称
68
71
  strType (str): 谱类型,N=无量纲加速度谱,A=加速度谱,V=速度谱,D=位移谱
69
72
  dG (float): 输入g值
73
+ inputtype:类型,1 = 按规范生成
70
74
  strCode (str): 规范名称,如 "JTGT_2231_01_2020"
71
75
  strBridgeType (str): 桥梁类别,A/B/C/D
72
76
  nIsLongSpan (int): 0=非高速公路和一级公路上的B类大桥特大桥,1=高速公路和一级公路上的B类大桥特大桥
@@ -111,12 +115,12 @@ def osis_seis_rsp_spec_del(strName: str):
111
115
 
112
116
 
113
117
  @REGISTRY.register("SeisRspSpecMod")
114
- def osis_seis_rsp_spec_mod(nOld: int, nNew: int):
115
- """修改地震反应谱编号。
118
+ def osis_seis_rsp_spec_mod(old_name: str, new_name: str):
119
+ """修改地震反应谱名称。
116
120
 
117
121
  Args:
118
- nOld (int): 旧编号
119
- nNew (int): 新编号
122
+ old_name (int): 旧名称
123
+ new_name (int): 新名称
120
124
 
121
125
  Returns:
122
126
  tuple (bool, str): 返回一个元组,包含:
@@ -180,12 +184,12 @@ def osis_rspec_anal_del(strName: str):
180
184
 
181
185
 
182
186
  @REGISTRY.register("RSpecAnalMod")
183
- def osis_rspec_anal_mod(nOld: int, nNew: int):
184
- """修改反应谱工况编号。
187
+ def osis_rspec_anal_mod(old_name: str, new_name: str):
188
+ """修改反应谱工况名称。
185
189
 
186
190
  Args:
187
- nOld (int): 旧编号
188
- nNew (int): 新编号
191
+ old_name (str): 旧名称
192
+ new_name (str): 新名称
189
193
 
190
194
  Returns:
191
195
  tuple (bool, str): 返回一个元组,包含:
@@ -24,6 +24,9 @@ from .interface import (
24
24
  osis_element_del,
25
25
  osis_element_mod,
26
26
  osis_element_group,
27
+ osis_taperele,
28
+ osis_element_tapereledel,
29
+ osis_element_taperelemod,
27
30
  )
28
31
 
29
32
 
@@ -380,6 +383,48 @@ class TaperEleGroupManager:
380
383
  taper_ele_groups = [TaperEleGroup._from_dict(d) for d in resp.get("data", []) if "name" in d]
381
384
  return taper_ele_groups
382
385
 
386
+ def create(
387
+ self,
388
+ name: str,
389
+ z_type: Literal["0", "1"],
390
+ z_trans: float = 1.0,
391
+ z_pos: Literal["0", "1"] = "0",
392
+ z_dis: float = 0.0,
393
+ y_type: Literal["0", "1"] = "0",
394
+ y_trans: float = 1.0,
395
+ y_pos: Literal["0", "1"] = "0",
396
+ y_dis: float = 0.0,
397
+ *eles: str,
398
+
399
+ ) -> TaperEleGroup:
400
+ """创建变截面单元组"""
401
+ ok, err = osis_taperele(
402
+ name,
403
+ z_type,
404
+ z_trans,
405
+ z_pos,
406
+ z_dis,
407
+ y_type,
408
+ y_trans,
409
+ y_pos,
410
+ y_dis,
411
+ *eles,
412
+ )
413
+ if not ok:
414
+ raise RuntimeError(f"创建变截面单元组 {name} 失败: {err}")
415
+ return self.get(name)
416
+
417
+ def delete(self, name: str) -> None:
418
+ ok, err = osis_element_tapereledel(name)
419
+ if not ok:
420
+ raise RuntimeError(f"删除变截面单元组 {name} 失败: {err}")
421
+
422
+ def rename(self, old_name: str, new_name: str) -> TaperEleGroup:
423
+ ok, err = osis_element_taperelemod(old_name, new_name)
424
+ if not ok:
425
+ raise RuntimeError(f"重命名变截面单元组 {old_name} -> {new_name} 失败: {err}")
426
+ return self.get(new_name)
427
+
383
428
  def get(self, name: str | list[str]) -> TaperEleGroup | list[TaperEleGroup | None] | None:
384
429
  """根据名称获取变截面单元组
385
430
  Args:
@@ -570,7 +615,7 @@ class ElementManager:
570
615
  ok, err = osis_element_shell(no, "SHELL", bIsThin, nMat, nThk, node1, node2, node3, node4)
571
616
  if not ok:
572
617
  raise RuntimeError(f"创建壳单元 {no} 失败: {err}")
573
- return self.get(no) # type: ignore[return-value]
618
+ return self.get(no)
574
619
 
575
620
  def delete(self, no: int) -> None:
576
621
  """删除单元"""
@@ -267,6 +267,13 @@ class LiveCase:
267
267
  - SUSPENSION: 悬索桥
268
268
  - CUSTOM: 自定义,直接输入基频
269
269
  mu_params: 冲击系数计算参数列表(根据桥型不同参数不同)
270
+ * SIMPLE = 桥长、弹模、惯性矩、质量
271
+ * CONTINUOUS = 基频计算常数a、基频计算常数b、桥长、弹模、惯性矩、质量
272
+ * ARCH = 拱厚变化系数、拱桥矢跨比、桥长、弹模、惯性矩,质量
273
+ * CABLE_STAYED = 计算常数、主跨跨径
274
+ * CABLE_STAYED_AUX = 计算常数、主跨跨径
275
+ * SUSPENSION = 主跨跨径、弹模、惯性矩、主缆水平拉力、质量
276
+ * CUSTOM = 用户直接输入基频
270
277
  lane_names: 车道名称列表
271
278
 
272
279
  Returns:
@@ -316,6 +323,13 @@ class LiveCase:
316
323
  - SUSPENSION: 悬索桥
317
324
  - CUSTOM: 自定义,直接输入基频
318
325
  mu_params: 冲击系数计算参数列表(根据桥型不同参数不同)
326
+ * SIMPLE = 桥长、弹模、惯性矩、质量
327
+ * CONTINUOUS = 基频计算常数a、基频计算常数b、桥长、弹模、惯性矩、质量
328
+ * ARCH = 拱厚变化系数、拱桥矢跨比、桥长、弹模、惯性矩,质量
329
+ * CABLE_STAYED = 计算常数、主跨跨径
330
+ * CABLE_STAYED_AUX = 计算常数、主跨跨径
331
+ * SUSPENSION = 主跨跨径、弹模、惯性矩、主缆水平拉力、质量
332
+ * CUSTOM = 用户直接输入基频
319
333
  lane_names: 车道名称列表
320
334
 
321
335
  Returns:
@@ -501,6 +515,8 @@ class LiveGradeManager:
501
515
  Raises:
502
516
  RuntimeError: 创建失败时抛出异常
503
517
  """
518
+ raise RuntimeError(f"暂不支持创建LiveGrade对象")
519
+ # TODO 需要修改DB文件grade字段值
504
520
  ok, err = osis_livegrade_crowd(name, "JTGD60_2015", "CROWD", eBridgeType, dPara)
505
521
  if not ok:
506
522
  raise RuntimeError(f"创建人群荷载等级 {name} 失败: {err}")
@@ -606,6 +606,7 @@ class LoadCase:
606
606
  Returns:
607
607
  更新后的 LoadCase 对象
608
608
  """
609
+ raise Exception("暂不支持添加单元面荷载(方向向量)到工况")
609
610
  ok, err = osis_load_surface_load_vector(
610
611
  "ESRFC", self.name, strEntity, strPlanei, strDir,
611
612
  strXi, strYi, strZi, strP1i, strP2i, strP3i, strP4i
@@ -10,6 +10,8 @@ from __future__ import annotations
10
10
 
11
11
  from typing import Literal
12
12
 
13
+ from ..core import osis_run
14
+
13
15
  from .combine import (
14
16
  osis_combine_create,
15
17
  osis_combine_post,
@@ -495,6 +497,18 @@ class PostManager:
495
497
  if not ok:
496
498
  raise RuntimeError(f"删除验算作用 ({item}) 失败: {err}")
497
499
 
500
+ # ═══════════════════════════════════════════
501
+ # 快捷功能
502
+ # ═══════════════════════════════════════════
503
+
504
+ def combination_and_check(self):
505
+ '''
506
+ 自动组合与验算
507
+ '''
508
+ ok, err = osis_run("CombinationAndCheck")
509
+ if not ok:
510
+ raise RuntimeError(f"自动组合与验算失败: {err}")
511
+
498
512
  # ═══════════════════════════════════════════
499
513
  # 结果显示
500
514
  # ═══════════════════════════════════════════
@@ -371,7 +371,7 @@ def osis_section_conventionalbox(nSec: int, strName: str, eSectionType: Literal[
371
371
  pass
372
372
 
373
373
  @REGISTRY.register('Section')
374
- def osis_section_flat_box(nSec: int, strName: str, eSectionType: Literal["FLATBOX"]="FLATBOX",
374
+ def osis_section_streamed_box(nSec: int, strName: str, eSectionType: Literal["STREAMEDBOX"]="STREAMEDBOX",
375
375
  H: float=4.0, BtL: float=20.0, BtR: float=20.0, BbL: float=10.5, BbR: float=10.5, Bs: float=0.8,
376
376
  Tt: float=0.28, Tb1: float=0.27, Tb2: float=0.27, Tw: float=0.25, Ttj: float=0.5, Tbj: float=0.27, Twj: float=0.4,
377
377
  nCellNum: int=5, Bi1: float=4.7, Bi2: float=6.85, Bi3: float=6, Bi4: float=6.85,
@@ -384,12 +384,12 @@ def osis_section_flat_box(nSec: int, strName: str, eSectionType: Literal["FLATBO
384
384
  eSlopeType: Literal["Integral", "CastInPlace"]="Integral",
385
385
  i: float=0.0, i1: float=0.0, i2: float=0.0, i3: float=0.0, i4: float=0.0,
386
386
  R1: float=0.5, R2: float=0.2):
387
- """定义或修改扁平箱梁截面(FlatBox)。
387
+ """定义或修改扁平箱梁截面(STREAMEDBOX)。
388
388
 
389
389
  Args:
390
390
  nSec (int): 截面编号,从1开始编号。
391
391
  strName (str): 截面名称。
392
- eSectionType (str): 截面类型,固定为 FLATBOX
392
+ eSectionType (str): 截面类型,固定为 STREAMEDBOX
393
393
  H (float): 截面高度。
394
394
  BtL (float): 设计线左顶板宽。
395
395
  BtR (float): 设计线右顶板宽。