osis-python 0.8.9__tar.gz → 0.9.0__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 (125) hide show
  1. {osis_python-0.8.9/src/osis_python.egg-info → osis_python-0.9.0}/PKG-INFO +1 -1
  2. {osis_python-0.8.9 → osis_python-0.9.0/src/osis_python.egg-info}/PKG-INFO +1 -1
  3. {osis_python-0.8.9 → osis_python-0.9.0}/src/osis_python.egg-info/SOURCES.txt +1 -0
  4. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/__init__.py +1 -1
  5. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/boundary/interface.py +8 -4
  6. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/boundary/manager.py +15 -8
  7. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/control/control.py +15 -0
  8. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/control/manager.py +18 -16
  9. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/control/nonlinear.py +18 -0
  10. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/dynamic/manager.py +48 -1
  11. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/live/grade.py +85 -0
  12. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/live/lane.py +4 -2
  13. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/live/manager.py +200 -29
  14. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/load/manager.py +88 -13
  15. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/load/static.py +64 -2
  16. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/load/tendon.py +1 -1
  17. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/post/design_check.py +8 -8
  18. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/post/manager.py +8 -8
  19. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/strength_prog.py +11 -4
  20. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/manager.py +47 -15
  21. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/stability/manager.py +21 -7
  22. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/stage/define.py +1 -1
  23. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/routes.py +34 -3
  24. osis_python-0.9.0/tests/test_manager_field_layout.py +231 -0
  25. {osis_python-0.8.9 → osis_python-0.9.0}/tests/test_transfer_fixups.py +67 -0
  26. {osis_python-0.8.9 → osis_python-0.9.0}/LICENSE +0 -0
  27. {osis_python-0.8.9 → osis_python-0.9.0}/README.md +0 -0
  28. {osis_python-0.8.9 → osis_python-0.9.0}/pyproject.toml +0 -0
  29. {osis_python-0.8.9 → osis_python-0.9.0}/setup.cfg +0 -0
  30. {osis_python-0.8.9 → osis_python-0.9.0}/src/osis_python.egg-info/dependency_links.txt +0 -0
  31. {osis_python-0.8.9 → osis_python-0.9.0}/src/osis_python.egg-info/requires.txt +0 -0
  32. {osis_python-0.8.9 → osis_python-0.9.0}/src/osis_python.egg-info/top_level.txt +0 -0
  33. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/boundary/__init__.py +0 -0
  34. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/control/__init__.py +0 -0
  35. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/control/io.py +0 -0
  36. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/__init__.py +0 -0
  37. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/all_func.py +0 -0
  38. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/apdl_sync.py +0 -0
  39. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/basic_manager.py +0 -0
  40. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/batch.py +0 -0
  41. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/client.py +0 -0
  42. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/command.py +0 -0
  43. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/engine.py +0 -0
  44. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/enums.py +0 -0
  45. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/exceptions.py +0 -0
  46. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/normalize.py +0 -0
  47. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/references.py +0 -0
  48. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/sdk.py +0 -0
  49. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/solver.py +0 -0
  50. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/core/sync_apdl_cli.py +0 -0
  51. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/display/__init__.py +0 -0
  52. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/display/interface.py +0 -0
  53. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/display/manager.py +0 -0
  54. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/dynamic/__init__.py +0 -0
  55. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/dynamic/load_to_mass.py +0 -0
  56. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/dynamic/modal.py +0 -0
  57. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/dynamic/seismic.py +0 -0
  58. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/element/__init__.py +0 -0
  59. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/element/interface.py +0 -0
  60. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/element/manager.py +0 -0
  61. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/general/__init__.py +0 -0
  62. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/general/interface.py +0 -0
  63. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/geometry/__init__.py +0 -0
  64. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/geometry/interface.py +0 -0
  65. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/geometry/manager.py +0 -0
  66. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/live/__init__.py +0 -0
  67. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/live/analysis.py +0 -0
  68. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/load/__init__.py +0 -0
  69. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/load/environmental.py +0 -0
  70. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/load/loadcase.py +0 -0
  71. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/material/__init__.py +0 -0
  72. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/material/interface.py +0 -0
  73. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/material/manager.py +0 -0
  74. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/node/__init__.py +0 -0
  75. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/node/interface.py +0 -0
  76. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/node/manager.py +0 -0
  77. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/post/__init__.py +0 -0
  78. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/post/combine.py +0 -0
  79. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/post/display.py +0 -0
  80. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/project/__init__.py +0 -0
  81. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/project/interface.py +0 -0
  82. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/project/manager.py +0 -0
  83. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/__init__.py +0 -0
  84. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/component_thickness.py +0 -0
  85. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/coordinate.py +0 -0
  86. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/creep_shrink.py +0 -0
  87. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/damping.py +0 -0
  88. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/manager.py +0 -0
  89. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/property/pu_curve.py +0 -0
  90. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/quick_building/__init__.py +0 -0
  91. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/quick_building/interface.py +0 -0
  92. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/result/__init__.py +0 -0
  93. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/result/check.py +0 -0
  94. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/result/manager.py +0 -0
  95. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/result/routes.py +0 -0
  96. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/__init__.py +0 -0
  97. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/common.py +0 -0
  98. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/composite.py +0 -0
  99. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/numeric.py +0 -0
  100. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/param.py +0 -0
  101. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/rebar.py +0 -0
  102. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/rib.py +0 -0
  103. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/shaped_steel.py +0 -0
  104. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/section/steel.py +0 -0
  105. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/settlement/__init__.py +0 -0
  106. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/settlement/interface.py +0 -0
  107. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/settlement/manager.py +0 -0
  108. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/stability/__init__.py +0 -0
  109. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/stability/buckling.py +0 -0
  110. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/stage/__init__.py +0 -0
  111. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/stage/manager.py +0 -0
  112. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/stage/overall.py +0 -0
  113. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/thickness/__init__.py +0 -0
  114. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/thickness/interface.py +0 -0
  115. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/thickness/manager.py +0 -0
  116. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/__init__.py +0 -0
  117. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/generator.py +0 -0
  118. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/introspect.py +0 -0
  119. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/matrix.py +0 -0
  120. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/out_to_python.py +0 -0
  121. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/parser.py +0 -0
  122. {osis_python-0.8.9 → osis_python-0.9.0}/src/pyosis/transfer/split.py +0 -0
  123. {osis_python-0.8.9 → osis_python-0.9.0}/tests/test_batch.py +0 -0
  124. {osis_python-0.8.9 → osis_python-0.9.0}/tests/test_delete_occupied.py +0 -0
  125. {osis_python-0.8.9 → osis_python-0.9.0}/tests/test_project_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.8.9
3
+ Version: 0.9.0
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.8.9
3
+ Version: 0.9.0
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
@@ -118,5 +118,6 @@ src/pyosis/transfer/routes.py
118
118
  src/pyosis/transfer/split.py
119
119
  tests/test_batch.py
120
120
  tests/test_delete_occupied.py
121
+ tests/test_manager_field_layout.py
121
122
  tests/test_project_manager.py
122
123
  tests/test_transfer_fixups.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.8.9"
10
+ __version__ = "0.9.0"
11
11
 
12
12
  from .core.engine import OSISEngine
13
13
  from .core.batch import batch, flush, batch_state, BatchError
@@ -89,18 +89,22 @@ def osis_boundary_release(nBd: int, eBoundaryType: Literal["RELEASE"],
89
89
  Fxi_state: bool, Fyi_state: bool, Fzi_state: bool, Mxi_state: bool, Myi_state: bool, Mzi_state: bool, Mbi_state: bool,
90
90
  Fxi: float, Fyi: float, Fzi: float, Mxi: float, Myi: float, Mzi: float, Mbi: float,
91
91
  Fxj_state: bool, Fyj_state: bool, Fzj_state: bool, Mxj_state: bool, Myj_state: bool, Mzj_state: bool, Mbj_state: bool,
92
- Fxj: float, Fyj: float, Fzj: float, Mxj: float, Myj: float, Mzj: float, Mbj: float):
92
+ Fxj: float, Fyj: float, Fzj: float, Mxj: float, Myj: float, Mzj: float, Mbj: float,
93
+ Relative: int = 1):
93
94
  '''
94
95
  ## 定义或修改释放梁端约束
95
96
  pyosis.boundary.osis_boundary_release
96
-
97
+
97
98
  Args:
98
99
  nBd (int): 编号
99
100
  eBoundaryType (str): 固定为 RELEASE
100
- \\*_state (bool):
101
+ \\*_state (bool):
101
102
  * 0 = 完全释放
102
103
  * 1 = 完全约束
103
- F\\*i and M\\*i (float): 部分约束的大小,0-1之间,表示释放后残余的约束能力的百分比
104
+ F\\*i and M\\*i (float):
105
+ * Relative = 1 时为残余约束能力,取值 0-1
106
+ * Relative = 0 时为刚度值,前三个量纲为力/长度,后四个为力×长度,且不能小于 0
107
+ Relative (int): 1 = 相对值,0 = 刚度值;可缺省,缺省为 1
104
108
  Returns:
105
109
  tuple (bool, str): 是否成功,失败原因
106
110
  '''
@@ -839,6 +839,7 @@ class BoundaryManager(BasicManager):
839
839
  mxj_state: bool,myj_state: bool,mzj_state: bool,mbj_state: bool,
840
840
  fxj: float,fyj: float,fzj: float,
841
841
  mxj: float,myj: float,mzj: float,mbj: float,
842
+ relative: int = 1,
842
843
  ) -> ReleaseBoundary:
843
844
  '''创建释放梁端约束
844
845
 
@@ -876,6 +877,7 @@ class BoundaryManager(BasicManager):
876
877
  myj: J 端 MY 部分约束残余百分比(0-1)
877
878
  mzj: J 端 MZ 部分约束残余百分比(0-1)
878
879
  mbj: J 端 MB 部分约束残余百分比(0-1)
880
+ relative: 1 = 上面的数值为相对值(0-1),0 = 绝对刚度值;缺省 1
879
881
 
880
882
  Returns:
881
883
  ReleaseBoundary 对象
@@ -894,6 +896,7 @@ class BoundaryManager(BasicManager):
894
896
  fxi, fyi, fzi, mxi, myi, mzi, mbi,
895
897
  fxj_state, fyj_state, fzj_state, mxj_state, myj_state, mzj_state, mbj_state,
896
898
  fxj, fyj, fzj, mxj, myj, mzj, mbj,
899
+ relative,
897
900
  )
898
901
  if not ok:
899
902
  raise RuntimeError(f"创建释放梁端约束 {no} 失败: {err}")
@@ -1109,7 +1112,12 @@ class BoundaryManager(BasicManager):
1109
1112
  if no is None:
1110
1113
  no = self._next_no()
1111
1114
  if str(e_dir).upper() == "VECTOR":
1112
- ori = None
1115
+ # 命令流 VECTOR 形式:SubType, Val, Dir, Vec_x, Vec_y, Vec_z
1116
+ # 位置实参落在 ori, vec_x, vec_y 上,整体后移一位还原
1117
+ if vec_z is None and (vec_x is not None or vec_y is not None):
1118
+ ori, vec_x, vec_y, vec_z = None, ori, vec_x, vec_y
1119
+ else:
1120
+ ori = None
1113
1121
  else:
1114
1122
  vec_x = vec_y = vec_z = None
1115
1123
  ok, err = osis_boundary_unispt(
@@ -1195,11 +1203,10 @@ class BoundaryManager(BasicManager):
1195
1203
  no: int | None,
1196
1204
  coor: int | str = "",
1197
1205
  curve_type: int = 1,
1198
- *,
1199
- soil_type: Literal["SAND", "CLAY"],
1200
- ground_lv: float,
1201
- d: float,
1202
- gamma: float,
1206
+ soil_type: Literal["SAND", "CLAY"] = "SAND",
1207
+ ground_lv: float = 0.0,
1208
+ d: float = 0.0,
1209
+ gamma: float = 0.0,
1203
1210
  phi: float | str | None = None,
1204
1211
  k: float | str | None = None,
1205
1212
  su: float | str | None = None,
@@ -1254,9 +1261,9 @@ class BoundaryManager(BasicManager):
1254
1261
  if float(e50) <= 0:
1255
1262
  raise ValueError(f"参考应变必须大于零: {e50}")
1256
1263
  elif soil == "SAND":
1257
- if phi is None:
1264
+ if phi is None or str(phi).strip() == "":
1258
1265
  raise ValueError("砂土必须给出内摩擦角 phi")
1259
- if su is not None or e50 is not None or j is not None:
1266
+ if any(str(x).strip() != "" for x in (su, e50, j) if x is not None):
1260
1267
  raise ValueError("砂土的 su、e50、j 必须留空")
1261
1268
  else:
1262
1269
  raise ValueError(f"未知土类: {soil_type!r},支持: SAND, CLAY")
@@ -1,5 +1,20 @@
1
+ from typing import Literal
2
+
1
3
  from ..core import REGISTRY
2
4
 
5
+ @REGISTRY.register("Unit")
6
+ def osis_unit(eLength: Literal["mm", "cm", "m", "in"], eForce: Literal["N", "kN", "MN", "lbf", "tonf"]):
7
+ '''
8
+ 设置单位制
9
+
10
+ Args:
11
+ eLength (str): 长度单位,mm / cm / m / in
12
+ eForce (str): 力单位,N / kN / MN / lbf / tonf
13
+ Returns:
14
+ tuple (bool, str): 是否成功,失败原因
15
+ '''
16
+ pass
17
+
3
18
  @REGISTRY.register("Acel")
4
19
  def osis_acel(dG: float = 9.8066):
5
20
  '''
@@ -20,6 +20,7 @@ from typing import Literal
20
20
  from ..core import osis_run
21
21
  from ..core.client import osis_client
22
22
  from .control import (
23
+ osis_unit,
23
24
  osis_acel,
24
25
  osis_calc_tendon,
25
26
  osis_calc_con_force,
@@ -52,22 +53,23 @@ class ControlManager:
52
53
 
53
54
  # ── 单位与项目 ──────────────────────────────
54
55
 
55
- # def set_unit(
56
- # self,
57
- # length: str = "m",
58
- # force: str = "kN",
59
- # temperature: str = "C",
60
- # ) -> None:
61
- # """设置单位制
62
-
63
- # Args:
64
- # length: 长度单位
65
- # force: 力单位
66
- # temperature: 温度单位
67
- # """
68
- # ok, err = osis_set_unit(length, force, temperature)
69
- # if not ok:
70
- # raise RuntimeError(f"设置单位制失败: {err}")
56
+ def set_unit(
57
+ self,
58
+ length: Literal["mm", "cm", "m", "in"] = "m",
59
+ force: Literal["N", "kN", "MN", "lbf", "tonf"] = "kN",
60
+ ) -> None:
61
+ """设置单位制
62
+
63
+ Args:
64
+ length: 长度单位,mm / cm / m / in
65
+ force: 力单位,N / kN / MN / lbf / tonf
66
+
67
+ Raises:
68
+ RuntimeError: 设置失败时抛出异常
69
+ """
70
+ ok, err = osis_unit(length, force)
71
+ if not ok:
72
+ raise RuntimeError(f"设置单位制失败: {err}")
71
73
 
72
74
 
73
75
  def set_gravity_acceleration(self, g: float = 9.8066) -> None:
@@ -32,6 +32,24 @@ def osis_cnv_config(Criteria: str="F", Norm: str="L2", Val: float=1e-4):
32
32
  '''
33
33
  pass
34
34
 
35
+ @REGISTRY.register("CnvConfig")
36
+ def osis_cnv_tol(Criteria: str="F", Norm: str="L2", Val: float=1e-4):
37
+ '''
38
+ 非线性收敛准则(文档命令名 CnvTol;引擎注册名为 CnvConfig)
39
+
40
+ 与 osis_cnv_config 参数相同。命令流里的 CnvTol 由转换器路由到本接口,
41
+ 实际发出引擎可识别的 CnvConfig。
42
+
43
+ Args:
44
+ Criteria (str): 收敛准则,F = 力收敛
45
+ Norm (str): L2 = 二范数
46
+ Val (float): 收敛阈值,须大于 0
47
+
48
+ Returns:
49
+ tuple (bool, str): 是否成功,失败原因
50
+ '''
51
+ pass
52
+
35
53
  @REGISTRY.register("LnSrch")
36
54
  def osis_ln_srch(bFlag: int=0):
37
55
  '''
@@ -123,6 +123,39 @@ class LoadToMass:
123
123
  if not ok:
124
124
  raise RuntimeError(f"移除荷载转换质量项 {lc_name} 从 {self.name} 失败: {err}")
125
125
 
126
+ def include(
127
+ self,
128
+ op: Literal["a", "r"],
129
+ lc_name: str,
130
+ mass_factor: float | None = None,
131
+ g: float | None = None,
132
+ bx: Literal[0, 1] = 1,
133
+ by: Literal[0, 1] = 1,
134
+ bz: Literal[0, 1] = 1,
135
+ bnf: Literal[0, 1] = 1,
136
+ bbf: Literal[0, 1] = 1,
137
+ bsf: Literal[0, 1] = 1,
138
+ ) -> None:
139
+ """按命令流 OP 添加/移除荷载转换质量项。
140
+
141
+ Args:
142
+ op: "a"=添加,"r"=移除
143
+ lc_name: 荷载工况名称
144
+ mass_factor: 质量系数,op="a" 时必填
145
+ g: 重力加速度值,op="a" 时必填
146
+ bx/by/bz/bnf/bbf/bsf: 同 add
147
+ """
148
+ op_key = op.lower()
149
+ if op_key == "a":
150
+ if mass_factor is None or g is None:
151
+ raise ValueError("添加荷载转换质量项须给出质量系数与重力加速度")
152
+ self.add(lc_name, mass_factor, g, bx, by, bz, bnf, bbf, bsf)
153
+ return
154
+ if op_key == "r":
155
+ self.remove(lc_name)
156
+ return
157
+ raise ValueError(f"未知操作: {op!r},支持 a/r")
158
+
126
159
  def _sync_from_dict(self, d: dict) -> None:
127
160
  """用 dict 同步当前对象(内部使用)"""
128
161
  self.name = d.get("name")
@@ -482,7 +515,8 @@ class SeisRspSpecManager(BasicManager):
482
515
  spec_type: 谱类型
483
516
  g: 输入g值
484
517
  input_type: 输入类型
485
- *args: 按位置传给对应 create_* 的参数
518
+ *args: input_type=0 时按命令流字段序传 num, T_i, S_i, ...(也接受直接传
519
+ [(T, S), ...] 数据列表);input_type=1 时按位置传给 create_code
486
520
  **kwargs: 按关键字传给对应 create_* 的参数
487
521
 
488
522
  Raises:
@@ -491,6 +525,7 @@ class SeisRspSpecManager(BasicManager):
491
525
 
492
526
  Examples:
493
527
  >>> data = [(0.1, 0.5), (0.2, 0.8)]
528
+ >>> dynamic_manager.seismic.create("RS1", "A", 9.806, 0, 2, 0.1, 0.5, 0.2, 0.8)
494
529
  >>> dynamic_manager.seismic.create("RS1", "A", 9.806, 0, data)
495
530
  >>> dynamic_manager.seismic.create("RS2", "N", 9.806, 1,
496
531
  ... code="JTGT_2231_01_2020", bridge_type="A", site=2)
@@ -507,6 +542,18 @@ class SeisRspSpecManager(BasicManager):
507
542
  raise ValueError(
508
543
  f"未知 input_type: {input_type!r},支持: 0=导入, 1=按规范生成"
509
544
  )
545
+ if it == 0:
546
+ # 命令流:Name, type, g, inputType, num, T_i, S_i, ...
547
+ # create_import:Name, type, g, spectrum_data, n_num
548
+ if not args:
549
+ return self.create_import(name, spec_type, g)
550
+ if isinstance(args[0], (list, tuple)):
551
+ # 直接调用:create(..., 0, [(T, S), ...])
552
+ return self.create_import(name, spec_type, g, args[0], *args[1:])
553
+ num, spectrum = args[0], list(args[1:])
554
+ if len(spectrum) == 1 and isinstance(spectrum[0], (list, tuple)):
555
+ spectrum = spectrum[0]
556
+ return self.create_import(name, spec_type, g, spectrum, num)
510
557
  return _creator[it](name, spec_type, g, *args, **kwargs)
511
558
 
512
559
  def create_import(
@@ -90,6 +90,91 @@ def osis_livegrade_custom(strName: str, eCode: Literal["CUSTOM"] = "CUSTOM", eLi
90
90
  """
91
91
  pass
92
92
 
93
+ @REGISTRY.register("LiveGrade")
94
+ def osis_livegrade_custom_vehicle(strName: str, eCode: Literal["CUSTOM"] = "CUSTOM",
95
+ eLiveLoadType: Literal["V"] = "V", VehLayout: list = None):
96
+ """定义或修改自定义车辆活载。
97
+
98
+ 命令流:LiveGrade, Name, CUSTOM, V, 轴距, 轴载, ...
99
+
100
+ Args:
101
+ strName (str): 活载名称
102
+ eCode (str): 规范类型,固定为 CUSTOM
103
+ eLiveLoadType (str): 活载类型,固定为 V
104
+ VehLayout (list): 各轴的(距左侧轴的轴距, 轴载),按顺序平铺填入
105
+ [轴距1, 轴载1, 轴距2, 轴载2, ...]
106
+
107
+ Returns:
108
+ tuple (bool, str): 是否成功,失败原因
109
+ """
110
+ pass
111
+
112
+ @REGISTRY.register("LiveGrade")
113
+ def osis_livegrade_custom_nhwcd(strName: str, eCode: Literal["CUSTOM"] = "CUSTOM",
114
+ eLiveLoadType: Literal["NHWCD"] = "NHWCD",
115
+ qk: float = 0.0, L1: float = 0.0, Pk1: float = 0.0,
116
+ L2: float = 0.0, Pk2: float = 0.0):
117
+ """定义或修改新公路车道荷载。
118
+
119
+ 命令流:LiveGrade, Name, CUSTOM, NHWCD, qk, L1, Pk1, L2, Pk2
120
+
121
+ Args:
122
+ strName (str): 活载名称
123
+ eCode (str): 规范类型,固定为 CUSTOM
124
+ eLiveLoadType (str): 活载类型,固定为 NHWCD
125
+ qk (float): 均布荷载
126
+ L1 (float): 跨径1
127
+ Pk1 (float): 小于等于 L1 时的集中荷载值
128
+ L2 (float): 跨径2
129
+ Pk2 (float): 大于等于 L2 时的集中荷载值;L1 与 L2 之间内插
130
+
131
+ Returns:
132
+ tuple (bool, str): 是否成功,失败原因
133
+ """
134
+ pass
135
+
136
+ @REGISTRY.register("LiveGrade")
137
+ def osis_livegrade_custom_nhwrq(strName: str, eCode: Literal["CUSTOM"] = "CUSTOM",
138
+ eLiveLoadType: Literal["NHWRQ"] = "NHWRQ",
139
+ B: float = 0.0, L1: float = 0.0, P1: float = 0.0,
140
+ L2: float = 0.0, P2: float = 0.0):
141
+ """定义或修改新公路人群荷载。
142
+
143
+ 命令流:LiveGrade, Name, CUSTOM, NHWRQ, B, L1, P1, L2, P2
144
+
145
+ Args:
146
+ strName (str): 活载名称
147
+ eCode (str): 规范类型,固定为 CUSTOM
148
+ eLiveLoadType (str): 活载类型,固定为 NHWRQ
149
+ B (float): 人群横向宽度
150
+ L1 (float): 跨径1
151
+ P1 (float): 小于等于 L1 时的人群压强值
152
+ L2 (float): 跨径2
153
+ P2 (float): 大于等于 L2 时的人群压强值;L1 与 L2 之间内插
154
+
155
+ Returns:
156
+ tuple (bool, str): 是否成功,失败原因
157
+ """
158
+ pass
159
+
160
+ @REGISTRY.register("LiveGrade")
161
+ def osis_livegrade_custom_ohwrq(strName: str, eCode: Literal["CUSTOM"] = "CUSTOM",
162
+ eLiveLoadType: Literal["OHWRQ"] = "OHWRQ", P: float = 0.0):
163
+ """定义或修改旧公路人群荷载。
164
+
165
+ 命令流:LiveGrade, Name, CUSTOM, OHWRQ, P
166
+
167
+ Args:
168
+ strName (str): 活载名称
169
+ eCode (str): 规范类型,固定为 CUSTOM
170
+ eLiveLoadType (str): 活载类型,固定为 OHWRQ
171
+ P (float): 人群荷载值
172
+
173
+ Returns:
174
+ tuple (bool, str): 是否成功,失败原因
175
+ """
176
+ pass
177
+
93
178
  @REGISTRY.register("LiveGradeDel")
94
179
  def osis_livegrade_del(strName: str):
95
180
  '''
@@ -24,7 +24,8 @@ def osis_lane_ve(strName: str, eType: Literal["VE"], dLength: float, wheel: floa
24
24
  - ESel (str): 参照纵梁单元组名称(纵梁)
25
25
  - OffsetY (float): 局部坐标系下Y方向偏移量(m),车道路径相对于单元组的横向偏移
26
26
  - OffsetZ (float): 局部坐标系下Z方向偏移量(m),车道路径相对于单元组的竖向偏移
27
- - **当 eRef=1 时**: param = [SplineName]
27
+ - **当 eRef=1 时**: param = [ESel, SplineName]
28
+ - ESel (str): 参照纵梁单元组名称
28
29
  - SplineName (str): 样条曲线名称(需在命令流中预先用数组定义)
29
30
 
30
31
  Returns:
@@ -70,7 +71,8 @@ def osis_lane_tcb(strName: str, eType: Literal["TCB"], ESel: str, dLength: float
70
71
  - RefESel (str): 参照纵梁单元组名称(主梁)
71
72
  - OffsetY (float): 局部坐标系下Y方向偏移量(m)
72
73
  - OffsetZ (float): 局部坐标系下Z方向偏移量(m)
73
- - **当 eRef=1 时**: param = [SplineName]
74
+ - **当 eRef=1 时**: param = [RefESel, SplineName]
75
+ - RefESel (str): 参照纵梁单元组名称(主梁)
74
76
  - SplineName (str): 样条曲线名称
75
77
 
76
78
  Returns: