osis-python 0.4.0__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.4.0/src/osis_python.egg-info → osis_python-0.4.1}/PKG-INFO +1 -1
  2. {osis_python-0.4.0 → osis_python-0.4.1/src/osis_python.egg-info}/PKG-INFO +1 -1
  3. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/__init__.py +1 -1
  4. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/core/__init__.py +1 -0
  5. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/core/client.py +18 -1
  6. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/core/engine.py +18 -2
  7. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/dynamic/load_to_mass.py +4 -4
  8. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/dynamic/manager.py +27 -22
  9. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/dynamic/seismic.py +12 -8
  10. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/element/manager.py +1 -1
  11. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/live/manager.py +14 -0
  12. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/load/manager.py +1 -0
  13. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/post/manager.py +1 -1
  14. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/manager.py +32 -4
  15. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/rebar.py +35 -0
  16. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/settlement/interface.py +8 -8
  17. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/settlement/manager.py +12 -12
  18. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/stability/buckling.py +4 -4
  19. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/stability/manager.py +6 -6
  20. {osis_python-0.4.0 → osis_python-0.4.1}/LICENSE +0 -0
  21. {osis_python-0.4.0 → osis_python-0.4.1}/README.md +0 -0
  22. {osis_python-0.4.0 → osis_python-0.4.1}/pyproject.toml +0 -0
  23. {osis_python-0.4.0 → osis_python-0.4.1}/setup.cfg +0 -0
  24. {osis_python-0.4.0 → osis_python-0.4.1}/src/osis_python.egg-info/SOURCES.txt +0 -0
  25. {osis_python-0.4.0 → osis_python-0.4.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
  26. {osis_python-0.4.0 → osis_python-0.4.1}/src/osis_python.egg-info/requires.txt +0 -0
  27. {osis_python-0.4.0 → osis_python-0.4.1}/src/osis_python.egg-info/top_level.txt +0 -0
  28. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/boundary/__init__.py +0 -0
  29. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/boundary/interface.py +0 -0
  30. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/boundary/manager.py +0 -0
  31. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/control/__init__.py +0 -0
  32. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/control/control.py +0 -0
  33. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/control/io.py +0 -0
  34. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/control/manager.py +0 -0
  35. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/control/nonlinear.py +0 -0
  36. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/core/all_func.py +0 -0
  37. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/core/command.py +0 -0
  38. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/dynamic/__init__.py +0 -0
  39. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/dynamic/modal.py +0 -0
  40. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/element/__init__.py +0 -0
  41. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/element/interface.py +0 -0
  42. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/general/__init__.py +0 -0
  43. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/general/interface.py +0 -0
  44. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/geometry/__init__.py +0 -0
  45. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/geometry/interface.py +0 -0
  46. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/geometry/manager.py +0 -0
  47. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/live/__init__.py +0 -0
  48. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/live/analysis.py +0 -0
  49. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/live/grade.py +0 -0
  50. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/live/lane.py +0 -0
  51. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/load/__init__.py +0 -0
  52. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/load/loadcase.py +0 -0
  53. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/load/static.py +0 -0
  54. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/load/tendon.py +0 -0
  55. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/material/__init__.py +0 -0
  56. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/material/interface.py +0 -0
  57. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/material/manager.py +0 -0
  58. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/node/__init__.py +0 -0
  59. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/node/interface.py +0 -0
  60. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/node/manager.py +0 -0
  61. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/post/__init__.py +0 -0
  62. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/post/combine.py +0 -0
  63. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/post/design_check.py +0 -0
  64. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/post/display.py +0 -0
  65. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/project/__init__.py +0 -0
  66. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/project/interface.py +0 -0
  67. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/project/manager.py +0 -0
  68. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/property/__init__.py +0 -0
  69. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/property/component_thickness.py +0 -0
  70. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/property/coordinate.py +0 -0
  71. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/property/creep_shrink.py +0 -0
  72. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/property/damping.py +0 -0
  73. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/property/manager.py +0 -0
  74. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/property/pu_curve.py +0 -0
  75. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/quick_building/__init__.py +0 -0
  76. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/quick_building/interface.py +0 -0
  77. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/result/__init__.py +0 -0
  78. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/result/check.py +0 -0
  79. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/result/env.py +0 -0
  80. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/result/loadcase.py +0 -0
  81. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/result/manager.py +0 -0
  82. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/result/result.py +0 -0
  83. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/__init__.py +0 -0
  84. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/common.py +0 -0
  85. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/composite.py +0 -0
  86. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/numeric.py +0 -0
  87. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/param.py +0 -0
  88. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/rib.py +0 -0
  89. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/section/steel.py +0 -0
  90. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/settlement/__init__.py +0 -0
  91. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/stability/__init__.py +0 -0
  92. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/stage/__init__.py +0 -0
  93. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/stage/define.py +0 -0
  94. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/stage/manager.py +0 -0
  95. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/stage/overall.py +0 -0
  96. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/thickness/__init__.py +0 -0
  97. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/thickness/interface.py +0 -0
  98. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/thickness/manager.py +0 -0
  99. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/transfer/__init__.py +0 -0
  100. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/transfer/command_map.py +0 -0
  101. {osis_python-0.4.0 → osis_python-0.4.1}/src/pyosis/transfer/generator.py +0 -0
  102. {osis_python-0.4.0 → 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.4.0
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.4.0
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
@@ -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.4.0"
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
@@ -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): 返回一个元组,包含:
@@ -138,16 +138,16 @@ class LoadToMassManager:
138
138
  if not ok:
139
139
  raise RuntimeError(f"删除荷载转换质量 {name} 失败: {err}")
140
140
 
141
- def renumber_ltm(self, old_no: int, new_no: int) -> None:
142
- """修改荷载转换质量编号。
141
+ def rename_ltm(self, old_name: str, new_name: str) -> None:
142
+ """修改荷载转换质量名称。
143
143
 
144
144
  Args:
145
- old_no: 旧编号
146
- new_no: 新编号
145
+ old_name: 旧名称
146
+ new_name: 新名称
147
147
  """
148
- ok, err = osis_ltm_anal_mod(old_no, new_no)
148
+ ok, err = osis_ltm_anal_mod(old_name, new_name)
149
149
  if not ok:
150
- raise RuntimeError(f"修改荷载转换质量编号 {old_no} -> {new_no} 失败: {err}")
150
+ raise RuntimeError(f"修改荷载转换质量名称 {old_name} -> {new_name} 失败: {err}")
151
151
 
152
152
  def add_ltm(
153
153
  self,
@@ -298,7 +298,7 @@ class SeisRspSpecManager:
298
298
  names = [str(name)]
299
299
  if not isinstance(names, list):
300
300
  raise TypeError(f"不支持的名称类型: {type(name)}")
301
- resp = osis_client("GetSeisRspSpecInfoByNames", {"name": names})
301
+ resp = osis_client("GetSeisRspSpecByNames", {"name": names})
302
302
  if not resp['success']:
303
303
  raise RuntimeError(f"{resp['error']}")
304
304
  rsp = [SeisRspSpec._from_dict(d) if d else None for d in resp.get("data", [])]
@@ -327,8 +327,13 @@ class SeisRspSpecManager:
327
327
  g: 输入g值
328
328
  spectrum_data: 反应谱数据列表,每个元素为 (周期, 谱值) 元组
329
329
  """
330
- n_num = len(spectrum_data)
331
- 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)
332
337
  if not ok:
333
338
  raise RuntimeError(f"创建地震反应谱 {name} 失败: {err}")
334
339
 
@@ -368,7 +373,7 @@ class SeisRspSpecManager:
368
373
  delta_t: 周期间隔
369
374
  """
370
375
  ok, err = osis_seis_rsp_spec_code(
371
- name, spec_type, g,
376
+ name, spec_type, g,1,
372
377
  code, bridge_type, is_long_span, level, intensity,
373
378
  site, direction, period, ksi, t, delta_t
374
379
  )
@@ -385,16 +390,16 @@ class SeisRspSpecManager:
385
390
  if not ok:
386
391
  raise RuntimeError(f"删除地震反应谱 {name} 失败: {err}")
387
392
 
388
- def renumber_rsp_spec(self, old_no: int, new_no: int) -> None:
389
- """修改地震反应谱编号。
393
+ def rename_rsp_spec(self, old_name: str, new_name: str) -> None:
394
+ """修改地震反应谱名称。
390
395
 
391
396
  Args:
392
- old_no: 旧编号
393
- new_no: 新编号
397
+ old_name: 旧名称
398
+ new_name: 新名称
394
399
  """
395
- ok, err = osis_seis_rsp_spec_mod(old_no, new_no)
400
+ ok, err = osis_seis_rsp_spec_mod(old_name, new_name)
396
401
  if not ok:
397
- raise RuntimeError(f"修改地震反应谱编号 {old_no} -> {new_no} 失败: {err}")
402
+ raise RuntimeError(f"修改地震反应谱名称 {old_name} -> {new_name} 失败: {err}")
398
403
 
399
404
  @dataclass(frozen=False)
400
405
  class RspecAnal:
@@ -510,16 +515,16 @@ class RspecAnalManager:
510
515
  if not ok:
511
516
  raise RuntimeError(f"删除反应谱工况 {name} 失败: {err}")
512
517
 
513
- def renumber_rspec_anal(self, old_no: int, new_no: int) -> None:
514
- """修改反应谱工况编号。
518
+ def rename_rspec_anal(self, old_name: str, new_name: str) -> None:
519
+ """修改反应谱工况名称。
515
520
 
516
521
  Args:
517
- old_no: 旧编号
518
- new_no: 新编号
522
+ old_name: 旧名称
523
+ new_name: 新名称
519
524
  """
520
- ok, err = osis_rspec_anal_mod(old_no, new_no)
525
+ ok, err = osis_rspec_anal_mod(old_name, new_name)
521
526
  if not ok:
522
- raise RuntimeError(f"修改反应谱工况编号 {old_no} -> {new_no} 失败: {err}")
527
+ raise RuntimeError(f"修改反应谱工况名称 {old_name} -> {new_name} 失败: {err}")
523
528
 
524
529
  class DynamicManager:
525
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): 返回一个元组,包含:
@@ -615,7 +615,7 @@ class ElementManager:
615
615
  ok, err = osis_element_shell(no, "SHELL", bIsThin, nMat, nThk, node1, node2, node3, node4)
616
616
  if not ok:
617
617
  raise RuntimeError(f"创建壳单元 {no} 失败: {err}")
618
- return self.get(no) # type: ignore[return-value]
618
+ return self.get(no)
619
619
 
620
620
  def delete(self, no: int) -> None:
621
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:
@@ -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
@@ -501,7 +501,7 @@ class PostManager:
501
501
  # 快捷功能
502
502
  # ═══════════════════════════════════════════
503
503
 
504
- def combination_and_check():
504
+ def combination_and_check(self):
505
505
  '''
506
506
  自动组合与验算
507
507
  '''
@@ -67,7 +67,7 @@ from .rebar import (
67
67
  osis_rebar_s_shear_stirrup,
68
68
  osis_rebar_s_web_vertical,
69
69
  osis_rebar_s_torsional_stirrup,
70
- osis_rebar_s_del,
70
+ osis_rebar_s_del, osis_rebar_l_circle,
71
71
  )
72
72
  from .rib import (
73
73
  osis_rib_flat,
@@ -337,8 +337,10 @@ class Section:
337
337
  d_coor_y: 中心点 Y 坐标
338
338
  d_coor_z: 中心点 Z 坐标
339
339
  diameter: 钢筋直径,范围 D4-D50
340
+ Notes:
341
+ 基于截面坐标的原点去计算相对于顶底板线的位置
340
342
  """
341
- ok, err = osis_rebar_l_point(self.no, n_rebar_no, "Point", n_material_no, d_coor_y, d_coor_z, diameter)
343
+ ok, err = osis_rebar_l_point(self.no, n_rebar_no, "POINT", n_material_no, d_coor_y, d_coor_z, diameter)
342
344
  if not ok:
343
345
  raise RuntimeError(f"添加截面 {self.no} 纵向钢筋 {n_rebar_no} 失败: {err}")
344
346
 
@@ -366,9 +368,11 @@ class Section:
366
368
  n_num: 数量
367
369
  d_interval: 间距
368
370
  diameter: 钢筋直径,范围 D4-D50
371
+ Notes:
372
+ 基于距离顶、底的距离来定位
369
373
  """
370
374
  ok, err = osis_rebar_l_line_a(
371
- self.no, n_rebar_no, "LineA", n_material_no,
375
+ self.no, n_rebar_no, "LINEA", n_material_no,
372
376
  y_ref, y_ref_value, z_ref, z_ref_value,
373
377
  n_num, d_interval, diameter,
374
378
  )
@@ -405,14 +409,38 @@ class Section:
405
409
  layout_ref: 分布参考,StartPoint=起点,MidPoint=中点,EndPoint=终点
406
410
  n_has_end_rebar: 1=有端筋,0=无端筋
407
411
  diameter: 钢筋直径,范围 D4-D50
412
+ Notes:
413
+ 基于截面坐标的原点去计算相对于顶底板线的位置
408
414
  """
409
415
  ok, err = osis_rebar_l_line_b(
410
- self.no, n_rebar_no, "LineB", n_material_no,
416
+ self.no, n_rebar_no, "LINEB", n_material_no,
411
417
  d_start_y, d_start_z, d_end_y, d_end_z,
412
418
  n_method, n_num, d_interval, layout_ref, n_has_end_rebar, diameter,
413
419
  )
414
420
  if not ok:
415
421
  raise RuntimeError(f"添加截面 {self.no} 纵向钢筋(LineB) {n_rebar_no} 失败: {err}")
422
+ def add_rebar_circle(
423
+ self,
424
+ n_rebar_no: int,
425
+ n_material_no: int,
426
+ d_center_y: float,
427
+ d_center_z: float,
428
+ d_radius: float,
429
+ n_method: Literal[0, 1],
430
+ n_num: int,
431
+ d_interval: float,
432
+ diameter: str,
433
+ ) -> None:
434
+ """添加纵向钢筋(圆形输入)"""
435
+ ok, err = osis_rebar_l_circle(
436
+ self.no, n_rebar_no, "Circle", n_material_no,
437
+ d_center_y, d_center_z, d_radius,
438
+ n_method, n_num, d_interval, diameter,
439
+ )
440
+ if not ok:
441
+ raise RuntimeError(
442
+ f"添加截面 {self.no} 纵向钢筋(Circle) {n_rebar_no} 失败: {err}"
443
+ )
416
444
 
417
445
  def delete_rebar(self, n_rebar_no: int) -> None:
418
446
  """删除纵向钢筋
@@ -78,7 +78,42 @@ def osis_rebar_l_line_b(SecNo: int, RebarLNo: int, RebarLType: Literal["LineB"],
78
78
  - str: 失败原因(如果操作失败)
79
79
  """
80
80
  pass
81
+ @REGISTRY.register("RebarL")
82
+ def osis_rebar_l_circle(
83
+ SecNo: int,
84
+ RebarLNo: int,
85
+ RebarLType: Literal["Circle"],
86
+ MaterialNo: int,
87
+ CenterY: float,
88
+ CenterZ: float,
89
+ Radius: float,
90
+ Method: Literal[0, 1],
91
+ Num: int,
92
+ Interval: float,
93
+ Diameter: str,
94
+ ):
95
+ """定义或修改纵向钢筋,通过圆形输入。
81
96
 
97
+ Args:
98
+ SecNo (int): 截面编号。
99
+ RebarLNo (int): 钢筋编号。
100
+ RebarLType (str): 钢筋类型,固定为 Circle。
101
+ MaterialNo (int): 钢筋材料编号。
102
+ CenterY (float): 圆心 Y 坐标。
103
+ CenterZ (float): 圆心 Z 坐标。
104
+ Radius (float): 圆的半径。
105
+ Method (int): 1=输入数量,0=输入间距。
106
+ Num (int): 数量。
107
+ Interval (float): 间距。
108
+ Diameter (str): 钢筋直径,范围为 D4–D50。
109
+
110
+ Returns:
111
+ tuple (bool, str): 返回一个元组,包含:
112
+ - bool: 操作是否成功
113
+ - str: 失败原因(如果操作失败)
114
+ """
115
+ pass
116
+
82
117
  @REGISTRY.register("RebarLDel")
83
118
  def osis_rebar_l_del(SecNo: int, RebarLNo: int):
84
119
  """删除纵向钢筋。
@@ -56,12 +56,12 @@ def osis_setl_grp_del(strName: str):
56
56
 
57
57
 
58
58
  @REGISTRY.register("SetlGrpMod")
59
- def osis_setl_grp_mod(nOld: int, nNew: int):
60
- """修改沉降组编号。
59
+ def osis_setl_grp_mod(old_name: str, new_name: str):
60
+ """修改沉降组名称。
61
61
 
62
62
  Args:
63
- nOld (int): 旧编号
64
- nNew (int): 新编号
63
+ old_name (int): 旧名称
64
+ new_name (int): 新名称
65
65
 
66
66
  Returns:
67
67
  tuple (bool, str): 返回一个元组,包含:
@@ -102,12 +102,12 @@ def osis_setl_anal_del(strName: str):
102
102
 
103
103
 
104
104
  @REGISTRY.register("SetlAnalMod")
105
- def osis_setl_anal_mod(nOld: int, nNew: int):
106
- """修改沉降荷载工况编号。
105
+ def osis_setl_anal_mod(old_name: str, new_name: str):
106
+ """修改沉降荷载工况名称
107
107
 
108
108
  Args:
109
- nOld (int): 旧编号
110
- nNew (int): 新编号
109
+ old_name (str): 旧名称
110
+ new_name (str): 新名称
111
111
 
112
112
  Returns:
113
113
  tuple (bool, str): 返回一个元组,包含:
@@ -199,16 +199,16 @@ class SettlementGroupManager:
199
199
  if not ok:
200
200
  raise RuntimeError(f"删除沉降组 {name} 失败: {err}")
201
201
 
202
- def renumber(self, old_no: int, new_no: int) -> None:
203
- """修改沉降组编号
202
+ def rename(self, old_name: str, new_name: str) -> None:
203
+ """修改沉降组名称
204
204
 
205
205
  Args:
206
- old_no: 旧编号
207
- new_no: 新编号
206
+ old_name: 旧名称
207
+ new_name: 新名称
208
208
  """
209
- ok, err = osis_setl_grp_mod(old_no, new_no)
209
+ ok, err = osis_setl_grp_mod(old_name, new_name)
210
210
  if not ok:
211
- raise RuntimeError(f"修改沉降组编号 {old_no} -> {new_no} 失败: {err}")
211
+ raise RuntimeError(f"修改沉降组名称 {old_name} -> {new_name} 失败: {err}")
212
212
 
213
213
  def get(self, name: str | list[str]) -> SettlementGroup | list[SettlementGroup | None] | None:
214
214
  """根据名称获取单个或多个沉降组
@@ -313,16 +313,16 @@ class SettlementManager:
313
313
  if not ok:
314
314
  raise RuntimeError(f"删除沉降荷载工况 {name} 失败: {err}")
315
315
 
316
- def renumber(self, old_no: int, new_no: int) -> None:
317
- """修改沉降荷载工况编号
316
+ def rename(self, old_name: str, new_name: str) -> None:
317
+ """修改沉降荷载工况名称
318
318
 
319
319
  Args:
320
- old_no: 旧编号
321
- new_no: 新编号
320
+ old_name: 旧名称
321
+ new_name: 新名称
322
322
  """
323
- ok, err = osis_setl_anal_mod(old_no, new_no)
323
+ ok, err = osis_setl_anal_mod(old_name, new_name)
324
324
  if not ok:
325
- raise RuntimeError(f"修改沉降荷载工况编号 {old_no} -> {new_no} 失败: {err}")
325
+ raise RuntimeError(f"修改沉降荷载工况名称 {old_name} -> {new_name} 失败: {err}")
326
326
 
327
327
  def get(self, name: str | list[str]) -> Settlement | list[Settlement | None] | None:
328
328
  """根据名称获取单个或多个沉降工况
@@ -43,12 +43,12 @@ def osis_buckl_anal_del(strName: str):
43
43
 
44
44
 
45
45
  @REGISTRY.register("BucklAnalMod")
46
- def osis_buckl_anal_mod(nOld: int, nNew: int):
47
- """修改屈曲工况编号。
46
+ def osis_buckl_anal_mod(ole_name: str, new_name: str):
47
+ """修改屈曲工况名称。
48
48
 
49
49
  Args:
50
- nOld (int): 旧编号
51
- nNew (int): 新编号
50
+ ole_name (str): 旧名称
51
+ new_name (str): 新名称
52
52
 
53
53
  Returns:
54
54
  tuple (bool, str): 返回一个元组,包含:
@@ -146,16 +146,16 @@ class StabilityManager:
146
146
  if not ok:
147
147
  raise RuntimeError(f"删除屈曲工况 {name} 失败: {err}")
148
148
 
149
- def renumber(self, old_no: int, new_no: int) -> None:
150
- """修改屈曲工况编号。
149
+ def rename(self, old_name: str, new_name: str) -> None:
150
+ """修改屈曲工况名称。
151
151
 
152
152
  Args:
153
- old_no: 旧编号
154
- new_no: 新编号
153
+ old_name: 旧名称
154
+ new_name: 新名称
155
155
  """
156
- ok, err = osis_buckl_anal_mod(old_no, new_no)
156
+ ok, err = osis_buckl_anal_mod(old_name, new_name)
157
157
  if not ok:
158
- raise RuntimeError(f"修改屈曲工况编号 {old_no} -> {new_no} 失败: {err}")
158
+ raise RuntimeError(f"修改屈曲工况名称 {old_name} -> {new_name} 失败: {err}")
159
159
 
160
160
  # ── 荷载工况管理 ──────────────────────────────
161
161
 
File without changes
File without changes
File without changes
File without changes