osis-python 0.2.3__tar.gz → 0.3.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 (133) hide show
  1. osis_python-0.3.0/PKG-INFO +294 -0
  2. osis_python-0.3.0/README.md +263 -0
  3. {osis_python-0.2.3 → osis_python-0.3.0}/pyproject.toml +1 -0
  4. osis_python-0.3.0/src/osis_python.egg-info/PKG-INFO +294 -0
  5. {osis_python-0.2.3 → osis_python-0.3.0}/src/osis_python.egg-info/SOURCES.txt +28 -18
  6. {osis_python-0.2.3 → osis_python-0.3.0}/src/osis_python.egg-info/requires.txt +1 -0
  7. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/__init__.py +1 -1
  8. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/boundary/interface.py +111 -46
  9. osis_python-0.3.0/src/pyosis/boundary/manager.py +852 -0
  10. osis_python-0.3.0/src/pyosis/control/__init__.py +4 -0
  11. osis_python-0.2.3/src/pyosis/control/interface.py → osis_python-0.3.0/src/pyosis/control/control.py +1 -66
  12. osis_python-0.3.0/src/pyosis/control/io.py +23 -0
  13. osis_python-0.3.0/src/pyosis/control/manager.py +196 -0
  14. osis_python-0.3.0/src/pyosis/control/nonlinear.py +71 -0
  15. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/core/all_func.py +9 -4
  16. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/core/client.py +29 -9
  17. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/core/command.py +2 -1
  18. osis_python-0.3.0/src/pyosis/core/engine.py +346 -0
  19. osis_python-0.3.0/src/pyosis/dynamic/__init__.py +12 -0
  20. osis_python-0.3.0/src/pyosis/dynamic/load_to_mass.py +108 -0
  21. osis_python-0.3.0/src/pyosis/dynamic/manager.py +347 -0
  22. osis_python-0.3.0/src/pyosis/dynamic/modal.py +28 -0
  23. osis_python-0.3.0/src/pyosis/dynamic/seismic.py +195 -0
  24. osis_python-0.3.0/src/pyosis/element/__init__.py +2 -0
  25. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/element/interface.py +1 -17
  26. osis_python-0.3.0/src/pyosis/element/manager.py +599 -0
  27. {osis_python-0.2.3/src/pyosis/common → osis_python-0.3.0/src/pyosis/general}/interface.py +70 -14
  28. osis_python-0.3.0/src/pyosis/geometry/__init__.py +2 -0
  29. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/geometry/interface.py +4 -4
  30. osis_python-0.3.0/src/pyosis/geometry/manager.py +321 -0
  31. osis_python-0.3.0/src/pyosis/live/__init__.py +4 -0
  32. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/live/analysis.py +17 -18
  33. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/live/lane.py +1 -1
  34. osis_python-0.3.0/src/pyosis/live/manager.py +989 -0
  35. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/load/__init__.py +1 -1
  36. osis_python-0.3.0/src/pyosis/load/manager.py +1450 -0
  37. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/load/static.py +68 -19
  38. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/load/tendon.py +46 -41
  39. osis_python-0.3.0/src/pyosis/material/__init__.py +2 -0
  40. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/material/manager.py +121 -85
  41. osis_python-0.3.0/src/pyosis/node/__init__.py +2 -0
  42. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/node/manager.py +84 -90
  43. osis_python-0.3.0/src/pyosis/post/__init__.py +4 -0
  44. osis_python-0.3.0/src/pyosis/post/combine.py +145 -0
  45. osis_python-0.3.0/src/pyosis/post/design_check.py +362 -0
  46. osis_python-0.3.0/src/pyosis/post/display.py +76 -0
  47. osis_python-0.3.0/src/pyosis/post/manager.py +557 -0
  48. osis_python-0.3.0/src/pyosis/project/__init__.py +2 -0
  49. osis_python-0.3.0/src/pyosis/project/interface.py +64 -0
  50. osis_python-0.3.0/src/pyosis/project/manager.py +101 -0
  51. osis_python-0.3.0/src/pyosis/property/__init__.py +6 -0
  52. osis_python-0.2.3/src/pyosis/property/comp_thickness.py → osis_python-0.3.0/src/pyosis/property/component_thickness.py +3 -3
  53. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/property/coordinate.py +4 -4
  54. osis_python-0.3.0/src/pyosis/property/damping.py +125 -0
  55. osis_python-0.3.0/src/pyosis/property/manager.py +284 -0
  56. osis_python-0.3.0/src/pyosis/result/__init__.py +4 -0
  57. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/result/check.py +4 -4
  58. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/result/env.py +1 -1
  59. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/result/loadcase.py +1 -1
  60. osis_python-0.3.0/src/pyosis/result/manager.py +272 -0
  61. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/result/result.py +3 -3
  62. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/section/__init__.py +1 -1
  63. osis_python-0.3.0/src/pyosis/section/manager.py +1288 -0
  64. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/section/numeric.py +2 -2
  65. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/section/param.py +44 -6
  66. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/section/rebar.py +1 -1
  67. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/section/rib.py +31 -0
  68. osis_python-0.3.0/src/pyosis/settlement/__init__.py +8 -0
  69. osis_python-0.3.0/src/pyosis/settlement/interface.py +150 -0
  70. osis_python-0.3.0/src/pyosis/settlement/manager.py +368 -0
  71. osis_python-0.3.0/src/pyosis/stability/__init__.py +2 -0
  72. osis_python-0.3.0/src/pyosis/stability/buckling.py +112 -0
  73. osis_python-0.3.0/src/pyosis/stability/manager.py +175 -0
  74. osis_python-0.3.0/src/pyosis/stage/__init__.py +4 -0
  75. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/stage/define.py +18 -18
  76. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/stage/manager.py +201 -190
  77. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/stage/overall.py +6 -6
  78. osis_python-0.3.0/src/pyosis/thickness/__init__.py +2 -0
  79. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/thickness/interface.py +3 -3
  80. osis_python-0.3.0/src/pyosis/thickness/manager.py +76 -0
  81. osis_python-0.2.3/PKG-INFO +0 -111
  82. osis_python-0.2.3/README.md +0 -81
  83. osis_python-0.2.3/src/osis_python.egg-info/PKG-INFO +0 -111
  84. osis_python-0.2.3/src/pyosis/boundary/manager.py +0 -342
  85. osis_python-0.2.3/src/pyosis/common/__init__.py +0 -2
  86. osis_python-0.2.3/src/pyosis/common/project.py +0 -54
  87. osis_python-0.2.3/src/pyosis/core/PyInterface.pyi +0 -157
  88. osis_python-0.2.3/src/pyosis/element/__init__.py +0 -2
  89. osis_python-0.2.3/src/pyosis/element/manager.py +0 -403
  90. osis_python-0.2.3/src/pyosis/general/interface.py +0 -31
  91. osis_python-0.2.3/src/pyosis/geometry/__init__.py +0 -1
  92. osis_python-0.2.3/src/pyosis/io/__init__.py +0 -11
  93. osis_python-0.2.3/src/pyosis/io/boundary_info.py +0 -239
  94. osis_python-0.2.3/src/pyosis/io/coordinate.py +0 -98
  95. osis_python-0.2.3/src/pyosis/io/element_info.py +0 -489
  96. osis_python-0.2.3/src/pyosis/io/group_info.py +0 -82
  97. osis_python-0.2.3/src/pyosis/io/material_info.py +0 -39
  98. osis_python-0.2.3/src/pyosis/io/node_info.py +0 -192
  99. osis_python-0.2.3/src/pyosis/io/prestressed_info.py +0 -170
  100. osis_python-0.2.3/src/pyosis/io/response.py +0 -135
  101. osis_python-0.2.3/src/pyosis/io/section_info.py +0 -162
  102. osis_python-0.2.3/src/pyosis/io/stage_info.py +0 -187
  103. osis_python-0.2.3/src/pyosis/live/__init__.py +0 -11
  104. osis_python-0.2.3/src/pyosis/live/manager.py +0 -668
  105. osis_python-0.2.3/src/pyosis/load/manager.py +0 -392
  106. osis_python-0.2.3/src/pyosis/material/__init__.py +0 -2
  107. osis_python-0.2.3/src/pyosis/node/__init__.py +0 -2
  108. osis_python-0.2.3/src/pyosis/post/__init__.py +0 -1
  109. osis_python-0.2.3/src/pyosis/post/combine.py +0 -90
  110. osis_python-0.2.3/src/pyosis/property/__init__.py +0 -4
  111. osis_python-0.2.3/src/pyosis/property/damping.py +0 -37
  112. osis_python-0.2.3/src/pyosis/quick_building/__init__.py +0 -1
  113. osis_python-0.2.3/src/pyosis/result/__init__.py +0 -3
  114. osis_python-0.2.3/src/pyosis/section/manager.py +0 -1252
  115. osis_python-0.2.3/src/pyosis/stage/__init__.py +0 -4
  116. osis_python-0.2.3/src/pyosis/thickness/__init__.py +0 -1
  117. {osis_python-0.2.3 → osis_python-0.3.0}/LICENSE +0 -0
  118. {osis_python-0.2.3 → osis_python-0.3.0}/setup.cfg +0 -0
  119. {osis_python-0.2.3 → osis_python-0.3.0}/src/osis_python.egg-info/dependency_links.txt +0 -0
  120. {osis_python-0.2.3 → osis_python-0.3.0}/src/osis_python.egg-info/top_level.txt +0 -0
  121. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/boundary/__init__.py +0 -0
  122. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/core/__init__.py +0 -0
  123. {osis_python-0.2.3/src/pyosis/control → osis_python-0.3.0/src/pyosis/general}/__init__.py +0 -0
  124. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/live/grade.py +0 -0
  125. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/load/loadcase.py +0 -0
  126. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/material/interface.py +0 -0
  127. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/node/interface.py +0 -0
  128. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/property/creep_shrink.py +0 -0
  129. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/property/pu_curve.py +0 -0
  130. {osis_python-0.2.3/src/pyosis/general → osis_python-0.3.0/src/pyosis/quick_building}/__init__.py +0 -0
  131. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/quick_building/interface.py +0 -0
  132. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/section/common.py +0 -0
  133. {osis_python-0.2.3 → osis_python-0.3.0}/src/pyosis/section/steel.py +0 -0
@@ -0,0 +1,294 @@
1
+ Metadata-Version: 2.4
2
+ Name: osis-python
3
+ Version: 0.3.0
4
+ Summary: A Python client library for Osis APDL
5
+ Author-email: "CCCC Highway Consultant Co. Ltd." <support@osisbim.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/osis-ai/pyosis
8
+ Project-URL: Documentation, https://github.com/osis-ai/pyosis#readme
9
+ Project-URL: Repository, https://github.com/osis-ai/pyosis.git
10
+ Project-URL: BugTracker, https://github.com/osis-ai/pyosis/issues
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Topic :: Software Development :: Libraries
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: matplotlib>=3.10.7
21
+ Requires-Dist: pandas>=2.3.3
22
+ Requires-Dist: requests>=2.33.1
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest>=7.0; extra == "dev"
25
+ Requires-Dist: black>=23.0; extra == "dev"
26
+ Requires-Dist: mypy>=1.0; extra == "dev"
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=7.0; extra == "test"
29
+ Requires-Dist: pytest-cov>=4.0; extra == "test"
30
+ Dynamic: license-file
31
+
32
+ [简体中文](README.zh-CN.md) | [English](README.md)
33
+
34
+ # pyosis
35
+
36
+ Python client library for **OSIS** Bridge & Tunnel Analysis Platform (developed by CCCC Highway Consultants Co., Ltd.).
37
+
38
+ pyosis provides an object-oriented Python API for automating the creation of bridge/tunnel finite element models, executing analysis solvers, and extracting post-processing results.
39
+
40
+ ## Installation
41
+
42
+ Due to naming conflicts on PyPI, please install using:
43
+
44
+ ```bash
45
+ pip install osis-python
46
+ ```
47
+
48
+ If your mirror hasn't synced yet, use:
49
+
50
+ ```bash
51
+ pip install osis-python -i https://pypi.org/simple
52
+ ```
53
+
54
+ ## Requirements
55
+
56
+ - OSIS >= 5.0 (includes the required Python runtime environment)
57
+ - Python >= 3.8
58
+
59
+ ## Quick Start
60
+
61
+ ### 1. Using OSISEngine (Recommended)
62
+
63
+ `OSISEngine` is the core facade class of pyosis, integrating all module managers and providing a unified project-level entry point:
64
+
65
+ ```python
66
+ from pyosis.core.engine import OSISEngine
67
+
68
+ engine = OSISEngine()
69
+
70
+ # Clear project
71
+ engine.clear()
72
+
73
+ # Set global parameters
74
+ engine.control.set_gravity_acceleration(9.8066)
75
+ engine.control.set_calc_tendon(True)
76
+ engine.control.set_calc_creep(True)
77
+
78
+ # Create sections
79
+ sec = engine.section.create_circle("Circle Section", d=0.5, tw=0.02)
80
+
81
+ # Create materials
82
+ mat = engine.material.create_conc("C30 Concrete", eCode="JTG3362_2018", eGrade="C30")
83
+
84
+ # Create nodes
85
+ n1 = engine.node.create(0, 0, 0)
86
+ n2 = engine.node.create(15, 0, 0)
87
+
88
+ # Create elements
89
+ elem = engine.element.create_beam3d(
90
+ n1.no, n2.no, nMat=mat.no, nSec1=sec.no, nSec2=sec.no
91
+ )
92
+
93
+ # Create boundaries
94
+ bd = engine.boundary.create_general(bX=1, bY=1, bZ=1, bRX=1, bRY=1, bRZ=1)
95
+ bd.assign("a", [n1.no])
96
+
97
+ # Create load case and add loads
98
+ lc = engine.load.create("Self-weight", load_case_type="D")
99
+ lc.create_gravity()
100
+
101
+ # Solve
102
+ engine.solve()
103
+ ```
104
+
105
+ ### 2. Using Managers Directly
106
+
107
+ If you don't need the convenience methods of Engine, you can also import individual managers directly:
108
+
109
+ ```python
110
+ from pyosis.material import material_manager
111
+ from pyosis.node import node_manager
112
+
113
+ mat = material_manager.create_conc("C30", eCode="JTG3362_2018", eGrade="C30")
114
+ node = node_manager.create(0, 0, 0)
115
+ ```
116
+
117
+ ## Core Architecture
118
+
119
+ ### Manager System
120
+
121
+ pyosis adopts a Manager pattern to organize code. Each module corresponds to a Manager:
122
+
123
+ | Manager | Attribute | Description |
124
+ |---------|-----------|-------------|
125
+ | MaterialManager | `engine.material` | Materials (concrete, steel, prestressed, rebar, etc.) |
126
+ | SectionManager | `engine.section` | Sections (box girder, T-girder, hollow slab, steel box, etc.) |
127
+ | NodeManager | `engine.node` | Nodes |
128
+ | ElementManager | `engine.element` | Elements (beam, truss, spring, cable, shell) |
129
+ | BoundaryManager | `engine.boundary` | Boundaries (general support, master-slave, elastic support, etc.) |
130
+ | LoadCaseManager | `engine.load` | Load cases |
131
+ | StageManager | `engine.stage` | Construction stages |
132
+ | TendonManager | `engine.tendon` | Tendons (properties + shapes) |
133
+ | LiveManager | `engine.live` | Live loads (grades + lanes + cases) |
134
+ | SettlementManager | `engine.settlement` | Settlement analysis |
135
+ | StabilityManager | `engine.stability` | Stability analysis |
136
+ | DynamicManager | `engine.dynamic` | Dynamic analysis |
137
+ | PostManager | `engine.post` | Post-processing (load combinations, design checks) |
138
+ | ResultManager | `engine.result` | Result export (load case / envelope / check results) |
139
+ | ControlManager | `engine.control` | Global control parameters |
140
+ | ProjectManager | `engine.project` | Project operations |
141
+
142
+ ### Sub-Managers
143
+
144
+ Some managers contain sub-managers, accessed via attributes:
145
+
146
+ ```python
147
+ # Element groups
148
+ grp = engine.element.group.create("Main Girder Elements")
149
+ grp.add([1, 2, 3])
150
+
151
+ # Boundary groups
152
+ bg = engine.boundary.group.create("Abutment Boundaries")
153
+ bg.add([1, 2])
154
+
155
+ # Tendons
156
+ prop = engine.tendon.prop.create_in(
157
+ "15-10", mat_no=1, e_code="GBT5224_2014",
158
+ diameter=15.2, n_num=10, d_pipe=0.09
159
+ )
160
+ shape = engine.tendon.shape.create_arc3d(
161
+ "N1", n_num=2, prop="15-10",
162
+ element_group="Main Girder Elements", curve_name="curve1"
163
+ )
164
+
165
+ # Live loads
166
+ grade = engine.live.grade.create("Highway-Class I")
167
+ lane = engine.live.lane.create("Lane 1")
168
+ case = engine.live.case.create("Live Load Case 1")
169
+ ```
170
+
171
+ ### Data Class Objects
172
+
173
+ Create and query operations return data class objects (dataclass) instead of raw dictionaries:
174
+
175
+ ```python
176
+ elem = engine.element.get(1)
177
+ print(elem.no) # ID
178
+ print(elem.node_vec) # Node list
179
+ print(elem.mat) # Material ID
180
+
181
+ # Objects support operations (operations下沉 to object)
182
+ lc = engine.load.get("Self-weight")
183
+ lc.create_gravity()
184
+ lc.create_nforce(1, dFx=1000)
185
+ ```
186
+
187
+ ### Explicit Numbering
188
+
189
+ Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
190
+
191
+ ```python
192
+ # Auto-assigned number
193
+ sec = engine.section.create_circle("Section 1", d=0.5)
194
+
195
+ # Explicit number
196
+ sec = engine.section.create_circle("Section 1", d=0.5, no=100)
197
+ ```
198
+
199
+ ## Result Export
200
+
201
+ After solving, you can export various analysis results using `engine.result`. All export methods return pandas DataFrames:
202
+
203
+ ```python
204
+ # Export load case results (element forces)
205
+ df = engine.result.loadcase("Self-weight", "LCEF")
206
+
207
+ # Export envelope results (element forces)
208
+ df = engine.result.env("Basic Combination Envelope", "EnvEF")
209
+
210
+ # Export design check results
211
+ df = engine.result.check(
212
+ "Concrete", "Ultimate Bending Capacity Check", "Basic Combination"
213
+ )
214
+
215
+ # Batch export all check results from Check folder
216
+ results = engine.result.check_all()
217
+ for name, df in results.items():
218
+ print(f"{name}: {len(df)} rows")
219
+ ```
220
+
221
+ Supported result types:
222
+ - **Load case**: `LCEF` (element force), `LCED` (element displacement), `LCND` (node displacement), `LCBF` (boundary reaction), `LCTL` (tendon loss), `LCS` (element stress)
223
+ - **Envelope**: `EnvBF` (boundary reaction), `EnvEF` (element force), `EnvES` (element strain), `EnvS` (element stress), `EnvND` (node displacement)
224
+
225
+ Requires `pandas` to be installed: `pip install pandas`
226
+
227
+ ## Complete Example
228
+
229
+ ```python
230
+ from pyosis.core.engine import OSISEngine
231
+
232
+ engine = OSISEngine()
233
+ engine.clear()
234
+
235
+ # Control parameters
236
+ engine.control.set_gravity_acceleration(9.8066)
237
+ engine.control.set_calc_tendon(True)
238
+ engine.control.set_calc_concurrent_force(True)
239
+ engine.control.set_calc_shrink(True)
240
+ engine.control.set_calc_creep(True)
241
+ engine.control.set_calc_shear(True)
242
+ engine.control.set_calc_relaxation(True)
243
+ engine.control.set_mod_loc_coor(False)
244
+ engine.control.set_inc_tendon(True)
245
+ engine.control.set_nonlinear(geom=False, link=False)
246
+
247
+ # Sections
248
+ engine.section.create_circle("Circle Section 1", d=0.219, tw=0.012, no=1)
249
+ engine.section.create_circle("Circle Section 2", d=0.180, tw=0.008, no=2)
250
+
251
+ # Materials
252
+ engine.material.create_steel(
253
+ "Steel 1", eCode="JTGD64_2015", eGrade="Q345", dDmp=0.05, no=1
254
+ )
255
+
256
+ # Nodes
257
+ engine.node.create(0, 5, 0, no=1)
258
+ engine.node.create(15, 5, 0, no=2)
259
+ engine.node.create(7.5, 0, 0, no=3)
260
+ engine.node.create(20, 0, 0, no=4)
261
+
262
+ # Elements
263
+ engine.element.create_beam3d(1, 3, nMat=1, nSec1=1, nSec2=1, no=1)
264
+ engine.element.create_beam3d(2, 3, nMat=1, nSec1=2, nSec2=2, no=2)
265
+
266
+ # Boundaries
267
+ engine.boundary.create_general(no=1)
268
+ engine.boundary.get(1).assign("a", [1, 2])
269
+
270
+ # Loads
271
+ lc = engine.load.create(
272
+ "Custom Load Case 1",
273
+ load_case_type="USER",
274
+ prompt="Two forces applied at nodes 3 and 4"
275
+ )
276
+ lc.create_nforce(3, dFx=0, dFy=-1000000, dFz=0)
277
+ lc.create_nforce(4, dFx=200000, dFy=0, dFz=0)
278
+
279
+ # Solve
280
+ engine.solve()
281
+ ```
282
+
283
+ ## Important Notes
284
+
285
+ 1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
286
+ 2. **Exception handling**: All operations throw `RuntimeError` on failure. It is recommended to add exception handling in production code.
287
+ 3. **Stateless design**: Managers do not cache data. Frequent calls to `all()` and other query methods incur network overhead. Use cautiously in loops.
288
+ 4. **Number uniqueness**: When explicitly specifying `no`, if the number already exists, the behavior depends on the OSIS underlying implementation (usually overwrites or raises an error).
289
+ 5. **Command mode**: When executing code in OSIS command mode, you can directly send Python code blocks. When executing in an IDE, ensure OSIS is running.
290
+
291
+ ## More Resources
292
+
293
+ - [tests/](tests/): Example code for each module
294
+ - [templetes/](templetes/): Complete bridge modeling template projects
@@ -0,0 +1,263 @@
1
+ [简体中文](README.zh-CN.md) | [English](README.md)
2
+
3
+ # pyosis
4
+
5
+ Python client library for **OSIS** Bridge & Tunnel Analysis Platform (developed by CCCC Highway Consultants Co., Ltd.).
6
+
7
+ pyosis provides an object-oriented Python API for automating the creation of bridge/tunnel finite element models, executing analysis solvers, and extracting post-processing results.
8
+
9
+ ## Installation
10
+
11
+ Due to naming conflicts on PyPI, please install using:
12
+
13
+ ```bash
14
+ pip install osis-python
15
+ ```
16
+
17
+ If your mirror hasn't synced yet, use:
18
+
19
+ ```bash
20
+ pip install osis-python -i https://pypi.org/simple
21
+ ```
22
+
23
+ ## Requirements
24
+
25
+ - OSIS >= 5.0 (includes the required Python runtime environment)
26
+ - Python >= 3.8
27
+
28
+ ## Quick Start
29
+
30
+ ### 1. Using OSISEngine (Recommended)
31
+
32
+ `OSISEngine` is the core facade class of pyosis, integrating all module managers and providing a unified project-level entry point:
33
+
34
+ ```python
35
+ from pyosis.core.engine import OSISEngine
36
+
37
+ engine = OSISEngine()
38
+
39
+ # Clear project
40
+ engine.clear()
41
+
42
+ # Set global parameters
43
+ engine.control.set_gravity_acceleration(9.8066)
44
+ engine.control.set_calc_tendon(True)
45
+ engine.control.set_calc_creep(True)
46
+
47
+ # Create sections
48
+ sec = engine.section.create_circle("Circle Section", d=0.5, tw=0.02)
49
+
50
+ # Create materials
51
+ mat = engine.material.create_conc("C30 Concrete", eCode="JTG3362_2018", eGrade="C30")
52
+
53
+ # Create nodes
54
+ n1 = engine.node.create(0, 0, 0)
55
+ n2 = engine.node.create(15, 0, 0)
56
+
57
+ # Create elements
58
+ elem = engine.element.create_beam3d(
59
+ n1.no, n2.no, nMat=mat.no, nSec1=sec.no, nSec2=sec.no
60
+ )
61
+
62
+ # Create boundaries
63
+ bd = engine.boundary.create_general(bX=1, bY=1, bZ=1, bRX=1, bRY=1, bRZ=1)
64
+ bd.assign("a", [n1.no])
65
+
66
+ # Create load case and add loads
67
+ lc = engine.load.create("Self-weight", load_case_type="D")
68
+ lc.create_gravity()
69
+
70
+ # Solve
71
+ engine.solve()
72
+ ```
73
+
74
+ ### 2. Using Managers Directly
75
+
76
+ If you don't need the convenience methods of Engine, you can also import individual managers directly:
77
+
78
+ ```python
79
+ from pyosis.material import material_manager
80
+ from pyosis.node import node_manager
81
+
82
+ mat = material_manager.create_conc("C30", eCode="JTG3362_2018", eGrade="C30")
83
+ node = node_manager.create(0, 0, 0)
84
+ ```
85
+
86
+ ## Core Architecture
87
+
88
+ ### Manager System
89
+
90
+ pyosis adopts a Manager pattern to organize code. Each module corresponds to a Manager:
91
+
92
+ | Manager | Attribute | Description |
93
+ |---------|-----------|-------------|
94
+ | MaterialManager | `engine.material` | Materials (concrete, steel, prestressed, rebar, etc.) |
95
+ | SectionManager | `engine.section` | Sections (box girder, T-girder, hollow slab, steel box, etc.) |
96
+ | NodeManager | `engine.node` | Nodes |
97
+ | ElementManager | `engine.element` | Elements (beam, truss, spring, cable, shell) |
98
+ | BoundaryManager | `engine.boundary` | Boundaries (general support, master-slave, elastic support, etc.) |
99
+ | LoadCaseManager | `engine.load` | Load cases |
100
+ | StageManager | `engine.stage` | Construction stages |
101
+ | TendonManager | `engine.tendon` | Tendons (properties + shapes) |
102
+ | LiveManager | `engine.live` | Live loads (grades + lanes + cases) |
103
+ | SettlementManager | `engine.settlement` | Settlement analysis |
104
+ | StabilityManager | `engine.stability` | Stability analysis |
105
+ | DynamicManager | `engine.dynamic` | Dynamic analysis |
106
+ | PostManager | `engine.post` | Post-processing (load combinations, design checks) |
107
+ | ResultManager | `engine.result` | Result export (load case / envelope / check results) |
108
+ | ControlManager | `engine.control` | Global control parameters |
109
+ | ProjectManager | `engine.project` | Project operations |
110
+
111
+ ### Sub-Managers
112
+
113
+ Some managers contain sub-managers, accessed via attributes:
114
+
115
+ ```python
116
+ # Element groups
117
+ grp = engine.element.group.create("Main Girder Elements")
118
+ grp.add([1, 2, 3])
119
+
120
+ # Boundary groups
121
+ bg = engine.boundary.group.create("Abutment Boundaries")
122
+ bg.add([1, 2])
123
+
124
+ # Tendons
125
+ prop = engine.tendon.prop.create_in(
126
+ "15-10", mat_no=1, e_code="GBT5224_2014",
127
+ diameter=15.2, n_num=10, d_pipe=0.09
128
+ )
129
+ shape = engine.tendon.shape.create_arc3d(
130
+ "N1", n_num=2, prop="15-10",
131
+ element_group="Main Girder Elements", curve_name="curve1"
132
+ )
133
+
134
+ # Live loads
135
+ grade = engine.live.grade.create("Highway-Class I")
136
+ lane = engine.live.lane.create("Lane 1")
137
+ case = engine.live.case.create("Live Load Case 1")
138
+ ```
139
+
140
+ ### Data Class Objects
141
+
142
+ Create and query operations return data class objects (dataclass) instead of raw dictionaries:
143
+
144
+ ```python
145
+ elem = engine.element.get(1)
146
+ print(elem.no) # ID
147
+ print(elem.node_vec) # Node list
148
+ print(elem.mat) # Material ID
149
+
150
+ # Objects support operations (operations下沉 to object)
151
+ lc = engine.load.get("Self-weight")
152
+ lc.create_gravity()
153
+ lc.create_nforce(1, dFx=1000)
154
+ ```
155
+
156
+ ### Explicit Numbering
157
+
158
+ Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
159
+
160
+ ```python
161
+ # Auto-assigned number
162
+ sec = engine.section.create_circle("Section 1", d=0.5)
163
+
164
+ # Explicit number
165
+ sec = engine.section.create_circle("Section 1", d=0.5, no=100)
166
+ ```
167
+
168
+ ## Result Export
169
+
170
+ After solving, you can export various analysis results using `engine.result`. All export methods return pandas DataFrames:
171
+
172
+ ```python
173
+ # Export load case results (element forces)
174
+ df = engine.result.loadcase("Self-weight", "LCEF")
175
+
176
+ # Export envelope results (element forces)
177
+ df = engine.result.env("Basic Combination Envelope", "EnvEF")
178
+
179
+ # Export design check results
180
+ df = engine.result.check(
181
+ "Concrete", "Ultimate Bending Capacity Check", "Basic Combination"
182
+ )
183
+
184
+ # Batch export all check results from Check folder
185
+ results = engine.result.check_all()
186
+ for name, df in results.items():
187
+ print(f"{name}: {len(df)} rows")
188
+ ```
189
+
190
+ Supported result types:
191
+ - **Load case**: `LCEF` (element force), `LCED` (element displacement), `LCND` (node displacement), `LCBF` (boundary reaction), `LCTL` (tendon loss), `LCS` (element stress)
192
+ - **Envelope**: `EnvBF` (boundary reaction), `EnvEF` (element force), `EnvES` (element strain), `EnvS` (element stress), `EnvND` (node displacement)
193
+
194
+ Requires `pandas` to be installed: `pip install pandas`
195
+
196
+ ## Complete Example
197
+
198
+ ```python
199
+ from pyosis.core.engine import OSISEngine
200
+
201
+ engine = OSISEngine()
202
+ engine.clear()
203
+
204
+ # Control parameters
205
+ engine.control.set_gravity_acceleration(9.8066)
206
+ engine.control.set_calc_tendon(True)
207
+ engine.control.set_calc_concurrent_force(True)
208
+ engine.control.set_calc_shrink(True)
209
+ engine.control.set_calc_creep(True)
210
+ engine.control.set_calc_shear(True)
211
+ engine.control.set_calc_relaxation(True)
212
+ engine.control.set_mod_loc_coor(False)
213
+ engine.control.set_inc_tendon(True)
214
+ engine.control.set_nonlinear(geom=False, link=False)
215
+
216
+ # Sections
217
+ engine.section.create_circle("Circle Section 1", d=0.219, tw=0.012, no=1)
218
+ engine.section.create_circle("Circle Section 2", d=0.180, tw=0.008, no=2)
219
+
220
+ # Materials
221
+ engine.material.create_steel(
222
+ "Steel 1", eCode="JTGD64_2015", eGrade="Q345", dDmp=0.05, no=1
223
+ )
224
+
225
+ # Nodes
226
+ engine.node.create(0, 5, 0, no=1)
227
+ engine.node.create(15, 5, 0, no=2)
228
+ engine.node.create(7.5, 0, 0, no=3)
229
+ engine.node.create(20, 0, 0, no=4)
230
+
231
+ # Elements
232
+ engine.element.create_beam3d(1, 3, nMat=1, nSec1=1, nSec2=1, no=1)
233
+ engine.element.create_beam3d(2, 3, nMat=1, nSec1=2, nSec2=2, no=2)
234
+
235
+ # Boundaries
236
+ engine.boundary.create_general(no=1)
237
+ engine.boundary.get(1).assign("a", [1, 2])
238
+
239
+ # Loads
240
+ lc = engine.load.create(
241
+ "Custom Load Case 1",
242
+ load_case_type="USER",
243
+ prompt="Two forces applied at nodes 3 and 4"
244
+ )
245
+ lc.create_nforce(3, dFx=0, dFy=-1000000, dFz=0)
246
+ lc.create_nforce(4, dFx=200000, dFy=0, dFz=0)
247
+
248
+ # Solve
249
+ engine.solve()
250
+ ```
251
+
252
+ ## Important Notes
253
+
254
+ 1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
255
+ 2. **Exception handling**: All operations throw `RuntimeError` on failure. It is recommended to add exception handling in production code.
256
+ 3. **Stateless design**: Managers do not cache data. Frequent calls to `all()` and other query methods incur network overhead. Use cautiously in loops.
257
+ 4. **Number uniqueness**: When explicitly specifying `no`, if the number already exists, the behavior depends on the OSIS underlying implementation (usually overwrites or raises an error).
258
+ 5. **Command mode**: When executing code in OSIS command mode, you can directly send Python code blocks. When executing in an IDE, ensure OSIS is running.
259
+
260
+ ## More Resources
261
+
262
+ - [tests/](tests/): Example code for each module
263
+ - [templetes/](templetes/): Complete bridge modeling template projects
@@ -34,6 +34,7 @@ classifiers = [
34
34
  dependencies = [
35
35
  "matplotlib>=3.10.7",
36
36
  "pandas>=2.3.3",
37
+ "requests>=2.33.1",
37
38
  ]
38
39
 
39
40
  [tool.setuptools.dynamic]