osis-python 0.3.0__tar.gz → 0.3.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 (101) hide show
  1. {osis_python-0.3.0/src/osis_python.egg-info → osis_python-0.3.1}/PKG-INFO +78 -5
  2. {osis_python-0.3.0 → osis_python-0.3.1}/README.md +77 -4
  3. {osis_python-0.3.0 → osis_python-0.3.1/src/osis_python.egg-info}/PKG-INFO +78 -5
  4. {osis_python-0.3.0 → osis_python-0.3.1}/src/osis_python.egg-info/SOURCES.txt +5 -1
  5. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/__init__.py +1 -1
  6. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/boundary/manager.py +25 -0
  7. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/core/engine.py +5 -0
  8. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/live/manager.py +12 -0
  9. osis_python-0.3.1/src/pyosis/transfer/__init__.py +50 -0
  10. osis_python-0.3.1/src/pyosis/transfer/command_map.py +695 -0
  11. osis_python-0.3.1/src/pyosis/transfer/generator.py +366 -0
  12. osis_python-0.3.1/src/pyosis/transfer/parser.py +150 -0
  13. {osis_python-0.3.0 → osis_python-0.3.1}/LICENSE +0 -0
  14. {osis_python-0.3.0 → osis_python-0.3.1}/pyproject.toml +0 -0
  15. {osis_python-0.3.0 → osis_python-0.3.1}/setup.cfg +0 -0
  16. {osis_python-0.3.0 → osis_python-0.3.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
  17. {osis_python-0.3.0 → osis_python-0.3.1}/src/osis_python.egg-info/requires.txt +0 -0
  18. {osis_python-0.3.0 → osis_python-0.3.1}/src/osis_python.egg-info/top_level.txt +0 -0
  19. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/boundary/__init__.py +0 -0
  20. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/boundary/interface.py +0 -0
  21. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/control/__init__.py +0 -0
  22. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/control/control.py +0 -0
  23. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/control/io.py +0 -0
  24. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/control/manager.py +0 -0
  25. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/control/nonlinear.py +0 -0
  26. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/core/__init__.py +0 -0
  27. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/core/all_func.py +0 -0
  28. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/core/client.py +0 -0
  29. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/core/command.py +0 -0
  30. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/dynamic/__init__.py +0 -0
  31. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/dynamic/load_to_mass.py +0 -0
  32. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/dynamic/manager.py +0 -0
  33. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/dynamic/modal.py +0 -0
  34. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/dynamic/seismic.py +0 -0
  35. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/element/__init__.py +0 -0
  36. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/element/interface.py +0 -0
  37. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/element/manager.py +0 -0
  38. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/general/__init__.py +0 -0
  39. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/general/interface.py +0 -0
  40. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/geometry/__init__.py +0 -0
  41. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/geometry/interface.py +0 -0
  42. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/geometry/manager.py +0 -0
  43. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/live/__init__.py +0 -0
  44. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/live/analysis.py +0 -0
  45. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/live/grade.py +0 -0
  46. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/live/lane.py +0 -0
  47. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/load/__init__.py +0 -0
  48. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/load/loadcase.py +0 -0
  49. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/load/manager.py +0 -0
  50. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/load/static.py +0 -0
  51. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/load/tendon.py +0 -0
  52. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/material/__init__.py +0 -0
  53. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/material/interface.py +0 -0
  54. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/material/manager.py +0 -0
  55. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/node/__init__.py +0 -0
  56. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/node/interface.py +0 -0
  57. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/node/manager.py +0 -0
  58. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/post/__init__.py +0 -0
  59. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/post/combine.py +0 -0
  60. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/post/design_check.py +0 -0
  61. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/post/display.py +0 -0
  62. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/post/manager.py +0 -0
  63. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/project/__init__.py +0 -0
  64. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/project/interface.py +0 -0
  65. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/project/manager.py +0 -0
  66. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/property/__init__.py +0 -0
  67. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/property/component_thickness.py +0 -0
  68. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/property/coordinate.py +0 -0
  69. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/property/creep_shrink.py +0 -0
  70. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/property/damping.py +0 -0
  71. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/property/manager.py +0 -0
  72. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/property/pu_curve.py +0 -0
  73. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/quick_building/__init__.py +0 -0
  74. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/quick_building/interface.py +0 -0
  75. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/result/__init__.py +0 -0
  76. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/result/check.py +0 -0
  77. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/result/env.py +0 -0
  78. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/result/loadcase.py +0 -0
  79. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/result/manager.py +0 -0
  80. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/result/result.py +0 -0
  81. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/__init__.py +0 -0
  82. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/common.py +0 -0
  83. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/manager.py +0 -0
  84. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/numeric.py +0 -0
  85. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/param.py +0 -0
  86. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/rebar.py +0 -0
  87. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/rib.py +0 -0
  88. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/section/steel.py +0 -0
  89. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/settlement/__init__.py +0 -0
  90. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/settlement/interface.py +0 -0
  91. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/settlement/manager.py +0 -0
  92. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/stability/__init__.py +0 -0
  93. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/stability/buckling.py +0 -0
  94. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/stability/manager.py +0 -0
  95. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/stage/__init__.py +0 -0
  96. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/stage/define.py +0 -0
  97. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/stage/manager.py +0 -0
  98. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/stage/overall.py +0 -0
  99. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/thickness/__init__.py +0 -0
  100. {osis_python-0.3.0 → osis_python-0.3.1}/src/pyosis/thickness/interface.py +0 -0
  101. {osis_python-0.3.0 → osis_python-0.3.1}/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.3.0
3
+ Version: 0.3.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
@@ -102,7 +102,31 @@ lc.create_gravity()
102
102
  engine.solve()
103
103
  ```
104
104
 
105
- ### 2. Using Managers Directly
105
+ ### 2. Engine Convenience Methods
106
+
107
+ `OSISEngine` provides project-level convenience methods:
108
+
109
+ ```python
110
+ # Project management
111
+ engine.new_project() # Create new project
112
+ engine.save_project() # Save current project
113
+ engine.open_project(path) # Open existing project
114
+
115
+ # Model information
116
+ summary = engine.model_summary() # Returns dict with all manager counts
117
+
118
+ # Import/Export
119
+ engine.export_apdl(path) # Export to APDL format
120
+ engine.import_apdl(path) # Import from APDL format
121
+
122
+ # Result output for calculation book
123
+ engine.output_result_for_calc_book()
124
+
125
+ # Matrix output
126
+ engine.matrix("matrix_1", [[1, 2],[3, 4]])
127
+ ```
128
+
129
+ ### 3. Using Managers Directly
106
130
 
107
131
  If you don't need the convenience methods of Engine, you can also import individual managers directly:
108
132
 
@@ -127,6 +151,9 @@ pyosis adopts a Manager pattern to organize code. Each module corresponds to a M
127
151
  | NodeManager | `engine.node` | Nodes |
128
152
  | ElementManager | `engine.element` | Elements (beam, truss, spring, cable, shell) |
129
153
  | BoundaryManager | `engine.boundary` | Boundaries (general support, master-slave, elastic support, etc.) |
154
+ | GeometryManager | `engine.geometry` | Geometric entities (splines, spatial curves) |
155
+ | PropertyManager | `engine.prop` | Properties (coordinate systems, creep/shrinkage, damping, P-U curves, element thickness assignments) |
156
+ | ThicknessManager | `engine.thickness` | Shell thickness properties |
130
157
  | LoadCaseManager | `engine.load` | Load cases |
131
158
  | StageManager | `engine.stage` | Construction stages |
132
159
  | TendonManager | `engine.tendon` | Tendons (properties + shapes) |
@@ -152,6 +179,15 @@ grp.add([1, 2, 3])
152
179
  bg = engine.boundary.group.create("Abutment Boundaries")
153
180
  bg.add([1, 2])
154
181
 
182
+ # Various boundary types
183
+ engine.boundary.create_general(bX=1, bY=1, bZ=1, bRX=1, bRY=1, bRZ=1) # General support
184
+ engine.boundary.create_master_slave(nMast=1, nSlav=2, dDir=1) # Master-slave
185
+ engine.boundary.create_release(nElem=1, iReleaseEnd=2) # End release
186
+ engine.boundary.create_elstcspt(nNode=1, dK=[1e9, 1e9, 1e9, 0, 0, 0]) # Elastic support
187
+ engine.boundary.create_general_elstcspt(nNode=1, bX=1, bY=1, bZ=1, dKx=1e9, dKy=1e9, dKz=1e9) # General elastic
188
+ engine.boundary.create_rigid(nNode1=1, nNode2=2) # Rigid link
189
+ engine.boundary.create_section_factor(nElem=1, iEnd=1) # Section factor
190
+
155
191
  # Tendons
156
192
  prop = engine.tendon.prop.create_in(
157
193
  "15-10", mat_no=1, e_code="GBT5224_2014",
@@ -168,6 +204,44 @@ lane = engine.live.lane.create("Lane 1")
168
204
  case = engine.live.case.create("Live Load Case 1")
169
205
  ```
170
206
 
207
+ ### Property & Thickness Management
208
+
209
+ ```python
210
+ # Coordinate systems
211
+ engine.prop.coord.create_local("CS1", origin=[0, 0, 0], x_axis=[1, 0, 0], y_axis=[0, 1, 0])
212
+
213
+ # Creep and shrinkage
214
+ engine.prop.creep_shrink.create("Creep1", eCode="JTG3362_2018", eGrade="C30")
215
+
216
+ # Damping
217
+ engine.prop.damping.create("Damping1", dDmp=0.05)
218
+
219
+ # P-U curve (for soil-structure interaction)
220
+ engine.prop.pu_curve.create("PU1", data=[(0, 0), (0.01, 1000), (0.02, 1500)])
221
+
222
+ # Element thickness assignment
223
+ engine.prop.thickness.assign_element(nElem=1, dThick=0.3)
224
+
225
+ # Shell thickness properties
226
+ engine.thickness.create_uniform("Thick1", dThick=0.3)
227
+ engine.thickness.create_tapered("Thick2", dThick1=0.2, dThick2=0.4)
228
+ ```
229
+
230
+ ### Geometry Queries
231
+
232
+ The `GeometryManager` supports querying geometric entities:
233
+
234
+ ```python
235
+ # Get all splines
236
+ splines = engine.geometry.all("spline")
237
+
238
+ # Get a specific spline
239
+ spline = engine.geometry.get("spline", name="curve1")
240
+
241
+ # Filter by type
242
+ arcs = engine.geometry.filter("spline", spline_type="ARC3D")
243
+ ```
244
+
171
245
  ### Data Class Objects
172
246
 
173
247
  Create and query operations return data class objects (dataclass) instead of raw dictionaries:
@@ -209,7 +283,7 @@ df = engine.result.env("Basic Combination Envelope", "EnvEF")
209
283
 
210
284
  # Export design check results
211
285
  df = engine.result.check(
212
- "Concrete", "Ultimate Bending Capacity Check", "Basic Combination"
286
+ "混凝土", "正截面抗弯验算", "Basic Combination"
213
287
  )
214
288
 
215
289
  # Batch export all check results from Check folder
@@ -284,9 +358,8 @@ engine.solve()
284
358
 
285
359
  1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
286
360
  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.
361
+ 3. **Stateless design**: Managers do not cache data. Every query method (`all()`, `get()`, `filter()`) fetches fresh data from OSIS via HTTP. This ensures consistency but incurs network overhead. Cache results locally when iterating in loops.
288
362
  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
363
 
291
364
  ## More Resources
292
365
 
@@ -71,7 +71,31 @@ lc.create_gravity()
71
71
  engine.solve()
72
72
  ```
73
73
 
74
- ### 2. Using Managers Directly
74
+ ### 2. Engine Convenience Methods
75
+
76
+ `OSISEngine` provides project-level convenience methods:
77
+
78
+ ```python
79
+ # Project management
80
+ engine.new_project() # Create new project
81
+ engine.save_project() # Save current project
82
+ engine.open_project(path) # Open existing project
83
+
84
+ # Model information
85
+ summary = engine.model_summary() # Returns dict with all manager counts
86
+
87
+ # Import/Export
88
+ engine.export_apdl(path) # Export to APDL format
89
+ engine.import_apdl(path) # Import from APDL format
90
+
91
+ # Result output for calculation book
92
+ engine.output_result_for_calc_book()
93
+
94
+ # Matrix output
95
+ engine.matrix("matrix_1", [[1, 2],[3, 4]])
96
+ ```
97
+
98
+ ### 3. Using Managers Directly
75
99
 
76
100
  If you don't need the convenience methods of Engine, you can also import individual managers directly:
77
101
 
@@ -96,6 +120,9 @@ pyosis adopts a Manager pattern to organize code. Each module corresponds to a M
96
120
  | NodeManager | `engine.node` | Nodes |
97
121
  | ElementManager | `engine.element` | Elements (beam, truss, spring, cable, shell) |
98
122
  | BoundaryManager | `engine.boundary` | Boundaries (general support, master-slave, elastic support, etc.) |
123
+ | GeometryManager | `engine.geometry` | Geometric entities (splines, spatial curves) |
124
+ | PropertyManager | `engine.prop` | Properties (coordinate systems, creep/shrinkage, damping, P-U curves, element thickness assignments) |
125
+ | ThicknessManager | `engine.thickness` | Shell thickness properties |
99
126
  | LoadCaseManager | `engine.load` | Load cases |
100
127
  | StageManager | `engine.stage` | Construction stages |
101
128
  | TendonManager | `engine.tendon` | Tendons (properties + shapes) |
@@ -121,6 +148,15 @@ grp.add([1, 2, 3])
121
148
  bg = engine.boundary.group.create("Abutment Boundaries")
122
149
  bg.add([1, 2])
123
150
 
151
+ # Various boundary types
152
+ engine.boundary.create_general(bX=1, bY=1, bZ=1, bRX=1, bRY=1, bRZ=1) # General support
153
+ engine.boundary.create_master_slave(nMast=1, nSlav=2, dDir=1) # Master-slave
154
+ engine.boundary.create_release(nElem=1, iReleaseEnd=2) # End release
155
+ engine.boundary.create_elstcspt(nNode=1, dK=[1e9, 1e9, 1e9, 0, 0, 0]) # Elastic support
156
+ engine.boundary.create_general_elstcspt(nNode=1, bX=1, bY=1, bZ=1, dKx=1e9, dKy=1e9, dKz=1e9) # General elastic
157
+ engine.boundary.create_rigid(nNode1=1, nNode2=2) # Rigid link
158
+ engine.boundary.create_section_factor(nElem=1, iEnd=1) # Section factor
159
+
124
160
  # Tendons
125
161
  prop = engine.tendon.prop.create_in(
126
162
  "15-10", mat_no=1, e_code="GBT5224_2014",
@@ -137,6 +173,44 @@ lane = engine.live.lane.create("Lane 1")
137
173
  case = engine.live.case.create("Live Load Case 1")
138
174
  ```
139
175
 
176
+ ### Property & Thickness Management
177
+
178
+ ```python
179
+ # Coordinate systems
180
+ engine.prop.coord.create_local("CS1", origin=[0, 0, 0], x_axis=[1, 0, 0], y_axis=[0, 1, 0])
181
+
182
+ # Creep and shrinkage
183
+ engine.prop.creep_shrink.create("Creep1", eCode="JTG3362_2018", eGrade="C30")
184
+
185
+ # Damping
186
+ engine.prop.damping.create("Damping1", dDmp=0.05)
187
+
188
+ # P-U curve (for soil-structure interaction)
189
+ engine.prop.pu_curve.create("PU1", data=[(0, 0), (0.01, 1000), (0.02, 1500)])
190
+
191
+ # Element thickness assignment
192
+ engine.prop.thickness.assign_element(nElem=1, dThick=0.3)
193
+
194
+ # Shell thickness properties
195
+ engine.thickness.create_uniform("Thick1", dThick=0.3)
196
+ engine.thickness.create_tapered("Thick2", dThick1=0.2, dThick2=0.4)
197
+ ```
198
+
199
+ ### Geometry Queries
200
+
201
+ The `GeometryManager` supports querying geometric entities:
202
+
203
+ ```python
204
+ # Get all splines
205
+ splines = engine.geometry.all("spline")
206
+
207
+ # Get a specific spline
208
+ spline = engine.geometry.get("spline", name="curve1")
209
+
210
+ # Filter by type
211
+ arcs = engine.geometry.filter("spline", spline_type="ARC3D")
212
+ ```
213
+
140
214
  ### Data Class Objects
141
215
 
142
216
  Create and query operations return data class objects (dataclass) instead of raw dictionaries:
@@ -178,7 +252,7 @@ df = engine.result.env("Basic Combination Envelope", "EnvEF")
178
252
 
179
253
  # Export design check results
180
254
  df = engine.result.check(
181
- "Concrete", "Ultimate Bending Capacity Check", "Basic Combination"
255
+ "混凝土", "正截面抗弯验算", "Basic Combination"
182
256
  )
183
257
 
184
258
  # Batch export all check results from Check folder
@@ -253,9 +327,8 @@ engine.solve()
253
327
 
254
328
  1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
255
329
  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.
330
+ 3. **Stateless design**: Managers do not cache data. Every query method (`all()`, `get()`, `filter()`) fetches fresh data from OSIS via HTTP. This ensures consistency but incurs network overhead. Cache results locally when iterating in loops.
257
331
  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
332
 
260
333
  ## More Resources
261
334
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.3.0
3
+ Version: 0.3.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
@@ -102,7 +102,31 @@ lc.create_gravity()
102
102
  engine.solve()
103
103
  ```
104
104
 
105
- ### 2. Using Managers Directly
105
+ ### 2. Engine Convenience Methods
106
+
107
+ `OSISEngine` provides project-level convenience methods:
108
+
109
+ ```python
110
+ # Project management
111
+ engine.new_project() # Create new project
112
+ engine.save_project() # Save current project
113
+ engine.open_project(path) # Open existing project
114
+
115
+ # Model information
116
+ summary = engine.model_summary() # Returns dict with all manager counts
117
+
118
+ # Import/Export
119
+ engine.export_apdl(path) # Export to APDL format
120
+ engine.import_apdl(path) # Import from APDL format
121
+
122
+ # Result output for calculation book
123
+ engine.output_result_for_calc_book()
124
+
125
+ # Matrix output
126
+ engine.matrix("matrix_1", [[1, 2],[3, 4]])
127
+ ```
128
+
129
+ ### 3. Using Managers Directly
106
130
 
107
131
  If you don't need the convenience methods of Engine, you can also import individual managers directly:
108
132
 
@@ -127,6 +151,9 @@ pyosis adopts a Manager pattern to organize code. Each module corresponds to a M
127
151
  | NodeManager | `engine.node` | Nodes |
128
152
  | ElementManager | `engine.element` | Elements (beam, truss, spring, cable, shell) |
129
153
  | BoundaryManager | `engine.boundary` | Boundaries (general support, master-slave, elastic support, etc.) |
154
+ | GeometryManager | `engine.geometry` | Geometric entities (splines, spatial curves) |
155
+ | PropertyManager | `engine.prop` | Properties (coordinate systems, creep/shrinkage, damping, P-U curves, element thickness assignments) |
156
+ | ThicknessManager | `engine.thickness` | Shell thickness properties |
130
157
  | LoadCaseManager | `engine.load` | Load cases |
131
158
  | StageManager | `engine.stage` | Construction stages |
132
159
  | TendonManager | `engine.tendon` | Tendons (properties + shapes) |
@@ -152,6 +179,15 @@ grp.add([1, 2, 3])
152
179
  bg = engine.boundary.group.create("Abutment Boundaries")
153
180
  bg.add([1, 2])
154
181
 
182
+ # Various boundary types
183
+ engine.boundary.create_general(bX=1, bY=1, bZ=1, bRX=1, bRY=1, bRZ=1) # General support
184
+ engine.boundary.create_master_slave(nMast=1, nSlav=2, dDir=1) # Master-slave
185
+ engine.boundary.create_release(nElem=1, iReleaseEnd=2) # End release
186
+ engine.boundary.create_elstcspt(nNode=1, dK=[1e9, 1e9, 1e9, 0, 0, 0]) # Elastic support
187
+ engine.boundary.create_general_elstcspt(nNode=1, bX=1, bY=1, bZ=1, dKx=1e9, dKy=1e9, dKz=1e9) # General elastic
188
+ engine.boundary.create_rigid(nNode1=1, nNode2=2) # Rigid link
189
+ engine.boundary.create_section_factor(nElem=1, iEnd=1) # Section factor
190
+
155
191
  # Tendons
156
192
  prop = engine.tendon.prop.create_in(
157
193
  "15-10", mat_no=1, e_code="GBT5224_2014",
@@ -168,6 +204,44 @@ lane = engine.live.lane.create("Lane 1")
168
204
  case = engine.live.case.create("Live Load Case 1")
169
205
  ```
170
206
 
207
+ ### Property & Thickness Management
208
+
209
+ ```python
210
+ # Coordinate systems
211
+ engine.prop.coord.create_local("CS1", origin=[0, 0, 0], x_axis=[1, 0, 0], y_axis=[0, 1, 0])
212
+
213
+ # Creep and shrinkage
214
+ engine.prop.creep_shrink.create("Creep1", eCode="JTG3362_2018", eGrade="C30")
215
+
216
+ # Damping
217
+ engine.prop.damping.create("Damping1", dDmp=0.05)
218
+
219
+ # P-U curve (for soil-structure interaction)
220
+ engine.prop.pu_curve.create("PU1", data=[(0, 0), (0.01, 1000), (0.02, 1500)])
221
+
222
+ # Element thickness assignment
223
+ engine.prop.thickness.assign_element(nElem=1, dThick=0.3)
224
+
225
+ # Shell thickness properties
226
+ engine.thickness.create_uniform("Thick1", dThick=0.3)
227
+ engine.thickness.create_tapered("Thick2", dThick1=0.2, dThick2=0.4)
228
+ ```
229
+
230
+ ### Geometry Queries
231
+
232
+ The `GeometryManager` supports querying geometric entities:
233
+
234
+ ```python
235
+ # Get all splines
236
+ splines = engine.geometry.all("spline")
237
+
238
+ # Get a specific spline
239
+ spline = engine.geometry.get("spline", name="curve1")
240
+
241
+ # Filter by type
242
+ arcs = engine.geometry.filter("spline", spline_type="ARC3D")
243
+ ```
244
+
171
245
  ### Data Class Objects
172
246
 
173
247
  Create and query operations return data class objects (dataclass) instead of raw dictionaries:
@@ -209,7 +283,7 @@ df = engine.result.env("Basic Combination Envelope", "EnvEF")
209
283
 
210
284
  # Export design check results
211
285
  df = engine.result.check(
212
- "Concrete", "Ultimate Bending Capacity Check", "Basic Combination"
286
+ "混凝土", "正截面抗弯验算", "Basic Combination"
213
287
  )
214
288
 
215
289
  # Batch export all check results from Check folder
@@ -284,9 +358,8 @@ engine.solve()
284
358
 
285
359
  1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
286
360
  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.
361
+ 3. **Stateless design**: Managers do not cache data. Every query method (`all()`, `get()`, `filter()`) fetches fresh data from OSIS via HTTP. This ensures consistency but incurs network overhead. Cache results locally when iterating in loops.
288
362
  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
363
 
291
364
  ## More Resources
292
365
 
@@ -92,4 +92,8 @@ src/pyosis/stage/manager.py
92
92
  src/pyosis/stage/overall.py
93
93
  src/pyosis/thickness/__init__.py
94
94
  src/pyosis/thickness/interface.py
95
- src/pyosis/thickness/manager.py
95
+ src/pyosis/thickness/manager.py
96
+ src/pyosis/transfer/__init__.py
97
+ src/pyosis/transfer/command_map.py
98
+ src/pyosis/transfer/generator.py
99
+ src/pyosis/transfer/parser.py
@@ -7,7 +7,7 @@ A library for extending OSIS functionality.
7
7
  A library that allows users to use CAE with great flexibility.
8
8
  """
9
9
 
10
- __version__ = "0.3.0"
10
+ __version__ = "0.3.1"
11
11
  __author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
12
12
 
13
13
  # from .core import engine
@@ -29,6 +29,7 @@ from .interface import (
29
29
  osis_boundary_master_slave,
30
30
  osis_boundary_release,
31
31
  osis_boundary_general_elstcspt,
32
+ osis_boundary_rigid,
32
33
  osis_boundary_section_factor,
33
34
  osis_boundary_group,
34
35
  osis_boundary_del,
@@ -788,6 +789,30 @@ class BoundaryManager:
788
789
  raise RuntimeError(f"创建一般弹性支承 {no} 失败: {err}")
789
790
  return self.get(no) # type: ignore[return-value]
790
791
 
792
+ def create_rigid(
793
+ self,
794
+ nNodeI: int,
795
+ no: int | None = None,
796
+ ) -> Boundary:
797
+ """创建刚性连接
798
+
799
+ Args:
800
+ nNodeI: 节点1编号(刚性区域的主节点)
801
+ no: 边界编号,None 时自动分配
802
+
803
+ Returns:
804
+ Boundary 对象
805
+
806
+ Notes:
807
+ 用于形成刚性区域的节点号 nodeJ, nodeK, ..., nodeL 由 assign 方法定义
808
+ """
809
+ if no is None:
810
+ no = self._next_no()
811
+ ok, err = osis_boundary_rigid(no, "RIGID", nNodeI)
812
+ if not ok:
813
+ raise RuntimeError(f"创建刚性连接 {no} 失败: {err}")
814
+ return self.get(no) # type: ignore[return-value]
815
+
791
816
  def delete(self, no: int) -> None:
792
817
  """删除边界"""
793
818
  ok, err = osis_boundary_del(no)
@@ -327,6 +327,11 @@ class OSISEngine:
327
327
  "boundaries": self._boundary.count(),
328
328
  "load_cases": self._load.count(),
329
329
  "stages": self._stage.count(),
330
+ "geometry": self._geometry.count(),
331
+ "live_loads": self._live.count(),
332
+ "settlements": self._settlement.count(),
333
+ "tendon_props": self._tendon.prop.count(),
334
+ "tendon_shapes": self._tendon.shape.count(),
330
335
  }
331
336
 
332
337
  def __repr__(self) -> str:
@@ -978,6 +978,18 @@ class LiveManager:
978
978
  """
979
979
  return self._case_manager
980
980
 
981
+ def count(self) -> dict[str, int]:
982
+ """获取活载各组件数量
983
+
984
+ Returns:
985
+ 活载等级、车道、活载工况数量的字典
986
+ """
987
+ return {
988
+ "grades": self._grade_manager.count(),
989
+ "lanes": self._lane_manager.count(),
990
+ "cases": self._case_manager.count(),
991
+ }
992
+
981
993
  def __repr__(self) -> str:
982
994
  return f"LiveManager()"
983
995
 
@@ -0,0 +1,50 @@
1
+ """pyosis 命令流转换模块
2
+
3
+ 提供 OSIS 命令流与 pyosis Engine API 之间的双向转换能力。
4
+
5
+ 主要组件:
6
+ - command_map: 命令映射表
7
+ - parser: 命令流解析器
8
+ - generator: pyosis 代码生成器
9
+
10
+ 用法:
11
+ from pyosis.transfer import CommandParser, PyosisGenerator
12
+
13
+ # 解析命令流
14
+ parser = CommandParser()
15
+ modules = parser.parse_file("path/to/OSIS.out")
16
+
17
+ # 生成 pyosis 代码
18
+ generator = PyosisGenerator()
19
+ code = generator.generate_module("MATERIAL", modules["MATERIAL"])
20
+ """
21
+
22
+ from .command_map import (
23
+ CMD_MAP,
24
+ DISPATCHER_CONFIG,
25
+ CommandMapping,
26
+ lookup_command,
27
+ list_all_commands,
28
+ )
29
+
30
+ from .parser import (
31
+ CommandParser,
32
+ ParsedCommand,
33
+ )
34
+
35
+ from .generator import (
36
+ PyosisGenerator,
37
+ IndexTracker,
38
+ )
39
+
40
+ __all__ = [
41
+ "CMD_MAP",
42
+ "DISPATCHER_CONFIG",
43
+ "CommandMapping",
44
+ "lookup_command",
45
+ "list_all_commands",
46
+ "CommandParser",
47
+ "ParsedCommand",
48
+ "PyosisGenerator",
49
+ "IndexTracker",
50
+ ]