osis-python 0.4.6__tar.gz → 0.5.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 (113) hide show
  1. {osis_python-0.4.6/src/osis_python.egg-info → osis_python-0.5.0}/PKG-INFO +1 -1
  2. {osis_python-0.4.6 → osis_python-0.5.0/src/osis_python.egg-info}/PKG-INFO +1 -1
  3. {osis_python-0.4.6 → osis_python-0.5.0}/src/osis_python.egg-info/SOURCES.txt +8 -2
  4. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/__init__.py +1 -1
  5. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/boundary/manager.py +147 -125
  6. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/control/manager.py +16 -16
  7. osis_python-0.5.0/src/pyosis/core/apdl_sync.py +155 -0
  8. osis_python-0.5.0/src/pyosis/core/build.py +2267 -0
  9. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/core/engine.py +9 -0
  10. osis_python-0.5.0/src/pyosis/core/sync_apdl_cli.py +49 -0
  11. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/dynamic/manager.py +74 -17
  12. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/element/interface.py +2 -2
  13. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/element/manager.py +83 -46
  14. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/geometry/manager.py +35 -5
  15. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/live/analysis.py +4 -4
  16. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/live/manager.py +244 -94
  17. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/load/manager.py +437 -275
  18. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/material/manager.py +83 -55
  19. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/node/manager.py +10 -10
  20. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/post/manager.py +4 -4
  21. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/property/component_thickness.py +2 -2
  22. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/property/manager.py +143 -15
  23. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/common.py +11 -10
  24. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/manager.py +562 -469
  25. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/settlement/interface.py +3 -3
  26. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/settlement/manager.py +8 -7
  27. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/stage/manager.py +34 -34
  28. osis_python-0.5.0/src/pyosis/transfer/__init__.py +22 -0
  29. osis_python-0.5.0/src/pyosis/transfer/generator.py +116 -0
  30. osis_python-0.5.0/src/pyosis/transfer/matrix.py +107 -0
  31. osis_python-0.5.0/src/pyosis/transfer/parser.py +216 -0
  32. osis_python-0.5.0/src/pyosis/transfer/routes.py +184 -0
  33. osis_python-0.5.0/src/pyosis/transfer/split.py +44 -0
  34. osis_python-0.5.0/src/pyosis/transfer/sync_exec.py +256 -0
  35. osis_python-0.4.6/src/pyosis/transfer/__init__.py +0 -50
  36. osis_python-0.4.6/src/pyosis/transfer/command_map.py +0 -695
  37. osis_python-0.4.6/src/pyosis/transfer/generator.py +0 -366
  38. osis_python-0.4.6/src/pyosis/transfer/parser.py +0 -150
  39. {osis_python-0.4.6 → osis_python-0.5.0}/LICENSE +0 -0
  40. {osis_python-0.4.6 → osis_python-0.5.0}/README.md +0 -0
  41. {osis_python-0.4.6 → osis_python-0.5.0}/pyproject.toml +0 -0
  42. {osis_python-0.4.6 → osis_python-0.5.0}/setup.cfg +0 -0
  43. {osis_python-0.4.6 → osis_python-0.5.0}/src/osis_python.egg-info/dependency_links.txt +0 -0
  44. {osis_python-0.4.6 → osis_python-0.5.0}/src/osis_python.egg-info/requires.txt +0 -0
  45. {osis_python-0.4.6 → osis_python-0.5.0}/src/osis_python.egg-info/top_level.txt +0 -0
  46. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/boundary/__init__.py +0 -0
  47. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/boundary/interface.py +0 -0
  48. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/control/__init__.py +0 -0
  49. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/control/control.py +0 -0
  50. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/control/io.py +0 -0
  51. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/control/nonlinear.py +0 -0
  52. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/core/__init__.py +0 -0
  53. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/core/all_func.py +0 -0
  54. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/core/basic_manager.py +0 -0
  55. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/core/client.py +0 -0
  56. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/core/command.py +0 -0
  57. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/dynamic/__init__.py +0 -0
  58. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/dynamic/load_to_mass.py +0 -0
  59. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/dynamic/modal.py +0 -0
  60. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/dynamic/seismic.py +0 -0
  61. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/element/__init__.py +0 -0
  62. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/general/__init__.py +0 -0
  63. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/general/interface.py +0 -0
  64. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/geometry/__init__.py +0 -0
  65. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/geometry/interface.py +0 -0
  66. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/live/__init__.py +0 -0
  67. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/live/grade.py +0 -0
  68. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/live/lane.py +0 -0
  69. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/load/__init__.py +0 -0
  70. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/load/loadcase.py +0 -0
  71. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/load/static.py +0 -0
  72. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/load/tendon.py +0 -0
  73. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/material/__init__.py +0 -0
  74. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/material/interface.py +0 -0
  75. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/node/__init__.py +0 -0
  76. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/node/interface.py +0 -0
  77. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/post/__init__.py +0 -0
  78. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/post/combine.py +0 -0
  79. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/post/design_check.py +0 -0
  80. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/post/display.py +0 -0
  81. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/project/__init__.py +0 -0
  82. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/project/interface.py +0 -0
  83. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/project/manager.py +0 -0
  84. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/property/__init__.py +0 -0
  85. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/property/coordinate.py +0 -0
  86. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/property/creep_shrink.py +0 -0
  87. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/property/damping.py +0 -0
  88. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/property/pu_curve.py +0 -0
  89. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/quick_building/__init__.py +0 -0
  90. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/quick_building/interface.py +0 -0
  91. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/result/__init__.py +0 -0
  92. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/result/check.py +0 -0
  93. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/result/env.py +0 -0
  94. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/result/loadcase.py +0 -0
  95. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/result/manager.py +0 -0
  96. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/result/result.py +0 -0
  97. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/__init__.py +0 -0
  98. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/composite.py +0 -0
  99. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/numeric.py +0 -0
  100. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/param.py +0 -0
  101. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/rebar.py +0 -0
  102. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/rib.py +0 -0
  103. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/section/steel.py +0 -0
  104. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/settlement/__init__.py +0 -0
  105. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/stability/__init__.py +0 -0
  106. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/stability/buckling.py +0 -0
  107. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/stability/manager.py +0 -0
  108. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/stage/__init__.py +0 -0
  109. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/stage/define.py +0 -0
  110. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/stage/overall.py +0 -0
  111. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/thickness/__init__.py +0 -0
  112. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/thickness/interface.py +0 -0
  113. {osis_python-0.4.6 → osis_python-0.5.0}/src/pyosis/thickness/manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.4.6
3
+ Version: 0.5.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.4.6
3
+ Version: 0.5.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
@@ -17,10 +17,13 @@ src/pyosis/control/manager.py
17
17
  src/pyosis/control/nonlinear.py
18
18
  src/pyosis/core/__init__.py
19
19
  src/pyosis/core/all_func.py
20
+ src/pyosis/core/apdl_sync.py
20
21
  src/pyosis/core/basic_manager.py
22
+ src/pyosis/core/build.py
21
23
  src/pyosis/core/client.py
22
24
  src/pyosis/core/command.py
23
25
  src/pyosis/core/engine.py
26
+ src/pyosis/core/sync_apdl_cli.py
24
27
  src/pyosis/dynamic/__init__.py
25
28
  src/pyosis/dynamic/load_to_mass.py
26
29
  src/pyosis/dynamic/manager.py
@@ -96,6 +99,9 @@ src/pyosis/thickness/__init__.py
96
99
  src/pyosis/thickness/interface.py
97
100
  src/pyosis/thickness/manager.py
98
101
  src/pyosis/transfer/__init__.py
99
- src/pyosis/transfer/command_map.py
100
102
  src/pyosis/transfer/generator.py
101
- src/pyosis/transfer/parser.py
103
+ src/pyosis/transfer/matrix.py
104
+ src/pyosis/transfer/parser.py
105
+ src/pyosis/transfer/routes.py
106
+ src/pyosis/transfer/split.py
107
+ src/pyosis/transfer/sync_exec.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.4.6"
10
+ __version__ = "0.5.0"
11
11
  __author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
12
12
 
13
13
  from .core.engine import OSISEngine
@@ -20,7 +20,7 @@ from __future__ import annotations
20
20
 
21
21
  from dataclasses import dataclass, field
22
22
  from typing import Any, Literal
23
- from enum import Enum, IntEnum
23
+ from enum import IntEnum
24
24
 
25
25
  from ..core.client import osis_client
26
26
  from .interface import (
@@ -138,13 +138,17 @@ class Boundary:
138
138
 
139
139
  def assign(
140
140
  self,
141
- eOP: Literal["a", "s", "r", "aa", "ra"] = "a",
142
- param: list | None = None,
141
+ op: Literal["a", "s", "r", "aa", "ra"] = "a",
142
+ *param: int | str,
143
143
  ) -> None:
144
144
  """分配边界给节点"""
145
- ok, err = osis_assign_boundary(self.no, eOP, param if param is not None else [])
145
+ if len(param) == 1 and isinstance(param[0], list):
146
+ nodes = param[0]
147
+ else:
148
+ nodes = list(param)
149
+ ok, err = osis_assign_boundary(self.no, op, nodes)
146
150
  if not ok:
147
- raise RuntimeError(f"分配边界 {self.no} 到节点 {param} 失败: {err}")
151
+ raise RuntimeError(f"分配边界 {self.no} 到节点 {nodes} 失败: {err}")
148
152
 
149
153
 
150
154
  @dataclass(frozen=True)
@@ -389,13 +393,13 @@ class BoundaryGroup:
389
393
  self._sync_from_dict(data[0])
390
394
  return self
391
395
 
392
- def _execute(self, operation: str, param: list | None = None) -> None:
396
+ def _execute(self, operation: Literal["c", "a", "s", "r", "aa", "ra", "m", "d"], *param: str | int) -> None:
393
397
  """执行边界组底层操作(内部使用)"""
394
- ok, err = osis_boundary_group(self.name, operation, param)
398
+ ok, err = osis_boundary_group(self.name, operation, list(param))
395
399
  if not ok:
396
400
  raise RuntimeError(f"边界组操作 {self.name} ({operation}) 失败: {err}")
397
401
 
398
- def add(self, boundaries: list[int]) -> BoundaryGroup:
402
+ def add(self, *boundaries: int) -> BoundaryGroup:
399
403
  """向边界组添加边界
400
404
 
401
405
  Args:
@@ -404,10 +408,10 @@ class BoundaryGroup:
404
408
  Returns:
405
409
  更新后的 BoundaryGroup 对象
406
410
  """
407
- self._execute("a", boundaries)
411
+ self._execute("a", *boundaries)
408
412
  return self.refresh()
409
413
 
410
- def remove(self, boundaries: list[int]) -> BoundaryGroup:
414
+ def remove(self, *boundaries: int) -> BoundaryGroup:
411
415
  """从边界组移除边界
412
416
 
413
417
  Args:
@@ -416,10 +420,10 @@ class BoundaryGroup:
416
420
  Returns:
417
421
  更新后的 BoundaryGroup 对象
418
422
  """
419
- self._execute("r", boundaries)
423
+ self._execute("r", *boundaries)
420
424
  return self.refresh()
421
425
 
422
- def replace(self, boundaries: list[int]) -> BoundaryGroup:
426
+ def replace(self, *boundaries: int) -> BoundaryGroup:
423
427
  """替换边界组内边界
424
428
 
425
429
  Args:
@@ -428,7 +432,7 @@ class BoundaryGroup:
428
432
  Returns:
429
433
  更新后的 BoundaryGroup 对象
430
434
  """
431
- self._execute("s", boundaries)
435
+ self._execute("s", *boundaries)
432
436
  return self.refresh()
433
437
 
434
438
  def add_all(self) -> BoundaryGroup:
@@ -458,7 +462,7 @@ class BoundaryGroup:
458
462
  Returns:
459
463
  更新后的 BoundaryGroup 对象
460
464
  """
461
- self._execute("m", [new_name])
465
+ self._execute("m", new_name)
462
466
  self.name = new_name
463
467
  return self.refresh()
464
468
 
@@ -483,9 +487,9 @@ class BoundaryGroupManager:
483
487
  >>> bg = boundary_manager.group.create("桥台1")
484
488
  >>> bg = boundary_manager.group.get("桥台1")
485
489
  >>> # 组成员操作(在对象上调用)
486
- >>> bg.add([1, 2])
487
- >>> bg.remove([1])
488
- >>> bg.replace([3, 4])
490
+ >>> bg.add(1, 2)
491
+ >>> bg.remove(1)
492
+ >>> bg.replace("3by4") # 组内把边界 3 替换为 4
489
493
  """
490
494
 
491
495
  def __init__(self) -> None:
@@ -506,16 +510,16 @@ class BoundaryGroupManager:
506
510
 
507
511
  # ── 增删改 ────────────────────────────────
508
512
 
509
- def create(self, name: str) -> BoundaryGroup:
513
+ def create(self, name: str, op:Literal["c", "a", "s", "r", "aa", "ra", "m", "d"], *param) -> BoundaryGroup:
510
514
  """创建边界组
511
515
 
512
516
  Args:
513
517
  name: 边界组名称
514
-
518
+ op: 操作
515
519
  Returns:
516
520
  创建的 BoundaryGroup 对象
517
521
  """
518
- ok, err = osis_boundary_group(name, "c")
522
+ ok, err = osis_boundary_group(name, op, *param)
519
523
  if not ok:
520
524
  raise RuntimeError(f"创建边界组 {name} 失败: {err}")
521
525
  return self.get(name)
@@ -605,7 +609,7 @@ class BoundaryManager:
605
609
  >>> all_bds = boundary_manager.all()
606
610
  >>> # 边界组操作
607
611
  >>> bg = boundary_manager.group.create("桥台1")
608
- >>> bg.add([1, 2])
612
+ >>> bg.add(1, 2)
609
613
  >>> bg = boundary_manager.group.get("桥台1")
610
614
  """
611
615
 
@@ -635,88 +639,101 @@ class BoundaryManager:
635
639
  return max(bd.no for bd in boundaries) + 1
636
640
 
637
641
  # ── 增删改 ────────────────────────────────
642
+ def create(self, no: int | None, type: str, *args: Any, **kwargs: Any) -> Boundary:
643
+ """创建边界(便捷入口,内部转发到对应 create_* 方法)
644
+
645
+ Args:
646
+ no: 边界编号,None 则自动分配
647
+ type: 边界类型,"GENERAL" / "MSTSLV" / "RELEASE" /
648
+ "ELSTCSPT" / "GES" / "RIGID"
649
+ *args: 按位置传给对应 create_* 的参数
650
+ **kwargs: 按关键字传给对应 create_* 的参数
651
+
652
+ Raises:
653
+ ValueError: 未知的 type
654
+ RuntimeError: 创建失败
655
+
656
+ Examples:
657
+ >>> boundary_manager.create(None, "GENERAL", bX=1, bY=1, bZ=1)
658
+ >>> boundary_manager.create(1, "MSTSLV", nNode=10)
659
+ >>> boundary_manager.create(2, "RIGID", nNodeI=5)
660
+ """
661
+ _creator = {
662
+ "GENERAL": self.create_general,
663
+ "MSTSLV": self.create_master_slave,
664
+ "RELEASE": self.create_release,
665
+ "ELSTCSPT": self.create_elstcspt,
666
+ "GES": self.create_general_elstcspt,
667
+ "RIGID": self.create_rigid,
668
+ }
669
+ type_key = type.upper()
670
+ if type_key not in _creator:
671
+ raise ValueError(
672
+ f"未知边界类型: {type!r},支持: {', '.join(_creator)}"
673
+ )
674
+ return _creator[type_key](no, *args, **kwargs)
638
675
 
639
676
  def create_general(
640
677
  self,
641
- nCoor: int | str = "",
642
- bX: Literal[0, 1] = 1,
643
- bY: Literal[0, 1] = 1,
644
- bZ: Literal[0, 1] = 1,
645
- bRX: Literal[0, 1] = 1,
646
- bRY: Literal[0, 1] = 1,
647
- bRZ: Literal[0, 1] = 1,
648
- bRW: Literal[0, 1] = 1,
649
- no: int | None = None,
678
+ no: int | None,
679
+ coor: int | str = "",
680
+ x: bool = 1,
681
+ y: bool = 1,
682
+ z: bool = 1,
683
+ rx: bool = 1,
684
+ ry: bool = 1,
685
+ rz: bool = 1,
686
+ rw: bool = 1,
650
687
  ) -> GeneralBoundary:
651
688
  """创建一般边界"""
652
689
  if no is None:
653
690
  no = self._next_no()
654
- ok, err = osis_boundary_general(no, "GENERAL", nCoor or "", bX, bY, bZ, bRX, bRY, bRZ, bRW)
691
+ ok, err = osis_boundary_general(no, "GENERAL", coor or "", x, y, z, rx, ry, rz, rw)
655
692
  if not ok:
656
693
  raise RuntimeError(f"创建一般边界 {no} 失败: {err}")
657
694
  return self.get(no) # type: ignore[return-value]
658
695
 
659
696
  def create_master_slave(
660
697
  self,
661
- nNode: int,
662
- bX: Literal[0, 1] = 1,
663
- bY: Literal[0, 1] = 1,
664
- bZ: Literal[0, 1] = 1,
665
- bRX: Literal[0, 1] = 1,
666
- bRY: Literal[0, 1] = 1,
667
- bRZ: Literal[0, 1] = 1,
668
- no: int | None = None,
669
- bCoincident: int | None = 1,
698
+ no: int | None,
699
+ node: int,
700
+ dx: bool = 1,
701
+ dy: bool = 1,
702
+ dz: bool = 1,
703
+ rx: bool = 1,
704
+ ry: bool = 1,
705
+ rz: bool = 1,
706
+ coincident: int | None = 1,
670
707
  ) -> MstSlvBoundary:
671
708
  """创建主从约束"""
672
709
  if no is None:
673
710
  no = self._next_no()
674
- ok, err = osis_boundary_master_slave(no, "MSTSLV", nNode, bX, bY, bZ, bRX, bRY, bRZ,bCoincident)
711
+ ok, err = osis_boundary_master_slave(no, "MSTSLV", node, dx, dy, dz, rx, ry, rz,coincident)
675
712
  if not ok:
676
713
  raise RuntimeError(f"创建主从约束 {no} 失败: {err}")
677
714
  return self.get(no) # type: ignore[return-value]
678
715
 
679
716
  def create_release(
680
717
  self,
681
- Fxi_state: bool,
682
- Fyi_state: bool,
683
- Fzi_state: bool,
684
- Mxi_state: bool,
685
- Myi_state: bool,
686
- Mzi_state: bool,
687
- Mbi_state: bool,
688
- Fxi: float,
689
- Fyi: float,
690
- Fzi: float,
691
- Mxi: float,
692
- Myi: float,
693
- Mzi: float,
694
- Mbi: float,
695
- Fxj_state: bool,
696
- Fyj_state: bool,
697
- Fzj_state: bool,
698
- Mxj_state: bool,
699
- Myj_state: bool,
700
- Mzj_state: bool,
701
- Mbj_state: bool,
702
- Fxj: float,
703
- Fyj: float,
704
- Fzj: float,
705
- Mxj: float,
706
- Myj: float,
707
- Mzj: float,
708
- Mbj: float,
709
- no: int | None = None,
718
+ no: int | None,
719
+ fxi_state: bool,fyi_state: bool,fzi_state: bool,
720
+ mxi_state: bool,myi_state: bool,mzi_state: bool,mbi_state: bool,
721
+ fxi: float,fyi: float,fzi: float,
722
+ mxi: float,myi: float,mzi: float,mbi: float,
723
+ fxj_state: bool,fyj_state: bool,fzj_state: bool,
724
+ mxj_state: bool,myj_state: bool,mzj_state: bool,mbj_state: bool,
725
+ fxj: float,fyj: float,fzj: float,
726
+ mxj: float,myj: float,mzj: float,mbj: float,
710
727
  ) -> ReleaseBoundary:
711
728
  """创建释放梁端约束"""
712
729
  if no is None:
713
730
  no = self._next_no()
714
731
  ok, err = osis_boundary_release(
715
732
  no, "RELEASE",
716
- Fxi_state, Fyi_state, Fzi_state, Mxi_state, Myi_state, Mzi_state, Mbi_state,
717
- Fxi, Fyi, Fzi, Mxi, Myi, Mzi, Mbi,
718
- Fxj_state, Fyj_state, Fzj_state, Mxj_state, Myj_state, Mzj_state, Mbj_state,
719
- Fxj, Fyj, Fzj, Mxj, Myj, Mzj, Mbj,
733
+ fxi_state, fyi_state, fzi_state, mxi_state, myi_state, mzi_state, mbi_state,
734
+ fxi, fyi, fzi, mxi, myi, mzi, mbi,
735
+ fxj_state, fyj_state, fzj_state, mxj_state, myj_state, mzj_state, mbj_state,
736
+ fxj, fyj, fzj, mxj, myj, mzj, mbj,
720
737
  )
721
738
  if not ok:
722
739
  raise RuntimeError(f"创建释放梁端约束 {no} 失败: {err}")
@@ -724,76 +741,81 @@ class BoundaryManager:
724
741
 
725
742
  def create_elstcspt(
726
743
  self,
727
- nCoor: int | str = "",
728
- bX: Literal[0, 1] = 1,
729
- DX: float = 1e13,
730
- bY: Literal[0, 1] = 1,
731
- DY: float = 1e13,
732
- bZ: Literal[0, 1] = 1,
733
- DZ: float = 1e13,
734
- bRX: Literal[0, 1] = 1,
735
- RX: float = 1e16,
736
- bRY: Literal[0, 1] = 1,
737
- RY: float = 1e16,
738
- bRZ: Literal[0, 1] = 1,
739
- RZ: float = 1e16,
740
- no: int | None = None,
744
+ no: int | None,
745
+ coor: int | str = "",
746
+ x: bool = 1,
747
+ dx: float | int = 1e13,
748
+ y: bool = 1,
749
+ dy: float | int = 1e13,
750
+ z: bool = 1,
751
+ dz: float | int = 1e13,
752
+ rx: bool = 1,
753
+ drx: float | int = 1e16,
754
+ ry: bool = 1,
755
+ dry: float | int = 1e16,
756
+ rz: bool = 1,
757
+ drz: float | int = 1e16,
741
758
  ) -> ElstcSptBoundary:
742
759
  """创建弹性支承"""
743
760
  if no is None:
744
761
  no = self._next_no()
745
762
  ok, err = osis_boundary_elstcspt(
746
- no, "ELSTCSPT", nCoor or "", bX, DX, bY, DY, bZ, DZ, bRX, RX, bRY, RY, bRZ, RZ
763
+ no, "ELSTCSPT", coor or "", x, dx, y, dy, z, dz, rx, drx, ry, dry, rz, drz
747
764
  )
748
765
  if not ok:
749
766
  raise RuntimeError(f"创建弹性支承 {no} 失败: {err}")
750
767
  return self.get(no) # type: ignore[return-value]
751
768
 
752
769
  def create_general_elstcspt(
753
- self,
754
- nCoor: int | str = "",
755
- stiffness_matrix: list[float] | None = None,
756
- mass_matrix: list[float] | None = None,
757
- damping_matrix: list[float] | None = None,
758
- no: int | None = None,
770
+ self,
771
+ no: int | None ,
772
+ coor: int | str = "",
773
+ *params: float | int,
774
+ stiffness_matrix: list[float] | None = None,
775
+ mass_matrix: list[float] | None = None,
776
+ damping_matrix: list[float] | None = None,
759
777
  ) -> GeneralElstcSptBoundary:
760
778
  """创建一般弹性支承
761
779
 
780
+ 支持两种调用方式:
781
+ 1) OSIS 平铺(与命令流一致)::
782
+ create(6, "GES", "", K11, K12, ..., K66, bM, bC, ...)
783
+ → create_general_elstcspt("", K11, K12, ..., bM, bC, no=6)
784
+
785
+ 2) 列表写法(手写脚本)::
786
+ create(6, "GES", coor="", stiffness_matrix=[...])
787
+
762
788
  Args:
763
- nCoor: 局部坐标系编号,"" 代表缺省
764
- stiffness_matrix: 6x6 刚度矩阵上三角元素(21个值),必须全部给出
765
- 顺序:K11,K12,K13,K14,K15,K16,K22,K23,K24,K25,K26,K33,K34,K35,K36,K44,K45,K46,K55,K56,K66
766
- mass_matrix: 6x6 质量矩阵上三角元素(21个值),可选
767
- damping_matrix: 6x6 阻尼矩阵上三角元素(21个值),可选
768
789
  no: 边界编号,None 时自动分配
790
+ coor: 局部坐标系编号,"" 代表缺省
791
+ *params: OSIS 平铺参数(K11..K66, bM, [M..], bC, [C..])
792
+ stiffness_matrix: 6x6 刚度矩阵上三角元素(21 个值)
793
+ mass_matrix: 6x6 质量矩阵上三角元素(21 个值),可选
794
+ damping_matrix: 6x6 阻尼矩阵上三角元素(21 个值),可选
769
795
 
770
796
  Returns:
771
797
  GeneralElstcSptBoundary 对象
772
798
  """
773
799
  if no is None:
774
800
  no = self._next_no()
775
- if stiffness_matrix is None:
776
- stiffness_matrix = []
777
-
778
- # 构建参数序列
779
- params = list(stiffness_matrix)
780
-
781
- # 质量矩阵
782
- if mass_matrix:
783
- params.append(1) # bM = 1
784
- params.extend(mass_matrix)
785
- else:
786
- params.append(0) # bM = 0
787
-
788
- # 阻尼矩阵
789
- if damping_matrix:
790
- params.append(1) # bC = 1
791
- params.extend(damping_matrix)
801
+
802
+ if params:
803
+ flat = params
792
804
  else:
793
- params.append(0) # bC = 0
794
-
805
+ flat = list(stiffness_matrix or [])
806
+ if mass_matrix:
807
+ flat.append(1)
808
+ flat.extend(mass_matrix)
809
+ else:
810
+ flat.append(0)
811
+ if damping_matrix:
812
+ flat.append(1)
813
+ flat.extend(damping_matrix)
814
+ else:
815
+ flat.append(0)
816
+
795
817
  ok, err = osis_boundary_general_elstcspt(
796
- no, "GES", nCoor or "", *params
818
+ no, "GES", coor or "", *flat
797
819
  )
798
820
  if not ok:
799
821
  raise RuntimeError(f"创建一般弹性支承 {no} 失败: {err}")
@@ -801,14 +823,14 @@ class BoundaryManager:
801
823
 
802
824
  def create_rigid(
803
825
  self,
826
+ no: int | None,
804
827
  nNodeI: int,
805
- no: int | None = None,
806
828
  ) -> Boundary:
807
829
  """创建刚性连接
808
830
 
809
831
  Args:
810
- nNodeI: 节点1编号(刚性区域的主节点)
811
832
  no: 边界编号,None 时自动分配
833
+ nNodeI: 节点1编号(刚性区域的主节点)
812
834
 
813
835
  Returns:
814
836
  Boundary 对象
@@ -877,9 +899,9 @@ class BoundaryManager:
877
899
  提供边界组的增删改查功能。
878
900
 
879
901
  用法:
880
- >>> boundary_manager.group.create("桥台1")
881
- >>> boundary_manager.group.add("桥台1", [1, 2])
882
- >>> boundary_manager.group.get("桥台1")
902
+ >>> bg = boundary_manager.group.create("桥台1")
903
+ >>> bg.add(1, 2)
904
+ >>> bg = boundary_manager.group.get("桥台1")
883
905
  """
884
906
  return self._group_manager
885
907
 
@@ -94,49 +94,49 @@ class ControlManager:
94
94
 
95
95
  # ── 材料效应开关 ────────────────────────────
96
96
 
97
- def set_calc_tendon(self, enabled: bool = True) -> None:
97
+ def set_calc_tendon(self, enabled: Literal[0,1] = 1) -> None:
98
98
  """是否计算预应力"""
99
99
  ok, err = osis_calc_tendon(enabled)
100
100
  if not ok:
101
101
  raise RuntimeError(f"设置预应力计算失败: {err}")
102
102
 
103
- def set_calc_concurrent_force(self, enabled: bool = True) -> None:
103
+ def set_calc_concurrent_force(self, enabled: Literal[0,1] = 1) -> None:
104
104
  """是否计算并发反力"""
105
105
  ok, err = osis_calc_con_force(enabled)
106
106
  if not ok:
107
107
  raise RuntimeError(f"设置并发反力计算失败: {err}")
108
108
 
109
- def set_calc_shrink(self, enabled: bool = True) -> None:
109
+ def set_calc_shrink(self, enabled: Literal[0,1] = 1) -> None:
110
110
  """是否计算收缩"""
111
111
  ok, err = osis_calc_shrink(enabled)
112
112
  if not ok:
113
113
  raise RuntimeError(f"设置收缩计算失败: {err}")
114
114
 
115
- def set_calc_creep(self, enabled: bool = True) -> None:
115
+ def set_calc_creep(self, enabled: Literal[0,1] = 1) -> None:
116
116
  """是否计算徐变"""
117
117
  ok, err = osis_calc_creep(enabled)
118
118
  if not ok:
119
119
  raise RuntimeError(f"设置徐变计算失败: {err}")
120
120
 
121
- def set_calc_shear(self, enabled: bool = True) -> None:
121
+ def set_calc_shear(self, enabled: Literal[0,1] = 1) -> None:
122
122
  """是否计算剪切"""
123
123
  ok, err = osis_calc_shear(enabled)
124
124
  if not ok:
125
125
  raise RuntimeError(f"设置剪切计算失败: {err}")
126
126
 
127
- def set_calc_relaxation(self, enabled: bool = True) -> None:
127
+ def set_calc_relaxation(self, enabled: Literal[0,1] = 1) -> None:
128
128
  """是否计算钢束松弛"""
129
129
  ok, err = osis_calc_rlx(enabled)
130
130
  if not ok:
131
131
  raise RuntimeError(f"设置钢束松弛计算失败: {err}")
132
132
 
133
- def set_mod_loc_coor(self, enabled: bool = True) -> None:
133
+ def set_mod_loc_coor(self, enabled: Literal[0,1] = 1) -> None:
134
134
  """是否修改变截面单元局部坐标轴来计算内力/应力"""
135
135
  ok, err = osis_mod_loc_coor(enabled)
136
136
  if not ok:
137
137
  raise RuntimeError(f"设置局部坐标轴修正失败: {err}")
138
138
 
139
- def set_inc_tendon(self, enabled: bool = True) -> None:
139
+ def set_inc_tendon(self, enabled: Literal[0,1] = 1) -> None:
140
140
  """是否考虑钢束自重及钢束对截面几何特性的影响"""
141
141
  ok, err = osis_inc_tendon(enabled)
142
142
  if not ok:
@@ -146,8 +146,8 @@ class ControlManager:
146
146
 
147
147
  def set_nonlinear(
148
148
  self,
149
- geom: bool = False,
150
- link: bool = False,
149
+ geom: Literal[0,1] = 0,
150
+ link: Literal[0,1] = 0,
151
151
  ) -> None:
152
152
  """设置非线性控制开关
153
153
 
@@ -159,29 +159,29 @@ class ControlManager:
159
159
  if not ok:
160
160
  raise RuntimeError(f"设置非线性控制失败: {err}")
161
161
 
162
- def set_line_search(self, enabled: bool = True) -> None:
162
+ def set_line_search(self, enabled: Literal[0,1] = 1) -> None:
163
163
  """设置线性搜索开关"""
164
164
  ok, err = osis_ln_srch(enabled)
165
165
  if not ok:
166
166
  raise RuntimeError(f"设置线性搜索失败: {err}")
167
167
 
168
- def set_auto_time_step(self, enabled: bool = True) -> None:
168
+ def set_auto_time_step(self, enabled: Literal[0,1] = 1) -> None:
169
169
  """设置是否自动计算时间荷载步"""
170
170
  ok, err = osis_auto_ts(enabled)
171
171
  if not ok:
172
172
  raise RuntimeError(f"设置自动时间步长失败: {err}")
173
173
 
174
- def set_substitution_steps(self, nls: int, nsbmx: int) -> None:
174
+ def set_substitution_steps(self, ls: int, sbmx: int) -> None:
175
175
  """指定荷载步数和最大荷载子步数"""
176
- ok, err = osis_NSUBST(nls, nsbmx)
176
+ ok, err = osis_NSUBST(ls, sbmx)
177
177
  if not ok:
178
178
  raise RuntimeError(f"设置荷载步数失败: {err}")
179
179
 
180
180
  # ── 模态分析 ────────────────────────────────
181
181
 
182
- def set_modal_opt(self, n_mod: int = 1) -> None:
182
+ def set_modal_opt(self, num: int = 1) -> None:
183
183
  """定义模态分析所需的特征值最大数目"""
184
- ok, err = osis_mod_opt(n_mod)
184
+ ok, err = osis_mod_opt(num)
185
185
  if not ok:
186
186
  raise RuntimeError(f"设置模态分析参数失败: {err}")
187
187