osis-python 0.4.1__tar.gz → 0.4.6__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.
- {osis_python-0.4.1/src/osis_python.egg-info → osis_python-0.4.6}/PKG-INFO +18 -26
- {osis_python-0.4.1 → osis_python-0.4.6}/README.md +17 -25
- {osis_python-0.4.1 → osis_python-0.4.6/src/osis_python.egg-info}/PKG-INFO +18 -26
- {osis_python-0.4.1 → osis_python-0.4.6}/src/osis_python.egg-info/SOURCES.txt +1 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/__init__.py +1 -1
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/boundary/interface.py +6 -5
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/boundary/manager.py +16 -1
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/control/manager.py +1 -1
- osis_python-0.4.6/src/pyosis/core/basic_manager.py +19 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/core/client.py +2 -1
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/core/engine.py +55 -42
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/dynamic/manager.py +212 -105
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/element/interface.py +19 -19
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/element/manager.py +86 -36
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/geometry/manager.py +7 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/live/grade.py +19 -2
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/live/manager.py +63 -1
- osis_python-0.4.6/src/pyosis/load/loadcase.py +89 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/load/manager.py +110 -40
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/load/static.py +36 -24
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/material/interface.py +3 -3
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/material/manager.py +8 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/node/interface.py +3 -3
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/node/manager.py +7 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/post/design_check.py +2 -5
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/post/manager.py +1 -1
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/property/coordinate.py +19 -19
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/property/creep_shrink.py +2 -2
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/property/damping.py +4 -4
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/property/manager.py +198 -6
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/property/pu_curve.py +6 -6
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/common.py +10 -10
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/composite.py +93 -9
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/manager.py +1021 -858
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/numeric.py +1 -1
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/rib.py +10 -9
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/settlement/manager.py +17 -2
- osis_python-0.4.6/src/pyosis/stability/__init__.py +2 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/stability/manager.py +78 -78
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/stage/manager.py +27 -17
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/thickness/manager.py +56 -1
- osis_python-0.4.1/src/pyosis/load/loadcase.py +0 -62
- osis_python-0.4.1/src/pyosis/stability/__init__.py +0 -2
- {osis_python-0.4.1 → osis_python-0.4.6}/LICENSE +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/pyproject.toml +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/setup.cfg +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/osis_python.egg-info/requires.txt +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/control/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/control/control.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/control/io.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/control/nonlinear.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/core/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/core/all_func.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/core/command.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/dynamic/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/dynamic/load_to_mass.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/dynamic/modal.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/dynamic/seismic.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/element/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/general/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/geometry/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/geometry/interface.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/live/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/live/analysis.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/live/lane.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/load/tendon.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/material/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/node/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/post/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/post/combine.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/post/display.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/project/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/project/interface.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/project/manager.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/property/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/property/component_thickness.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/quick_building/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/result/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/result/check.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/result/env.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/result/loadcase.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/result/manager.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/result/result.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/param.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/rebar.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/section/steel.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/settlement/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/settlement/interface.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/stability/buckling.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/stage/define.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/stage/overall.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/thickness/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/thickness/interface.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/transfer/__init__.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/transfer/command_map.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/transfer/generator.py +0 -0
- {osis_python-0.4.1 → osis_python-0.4.6}/src/pyosis/transfer/parser.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.6
|
|
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
|
|
@@ -76,10 +76,10 @@ engine.control.set_calc_tendon(True)
|
|
|
76
76
|
engine.control.set_calc_creep(True)
|
|
77
77
|
|
|
78
78
|
# Create sections
|
|
79
|
-
sec = engine.section.create_circle("
|
|
79
|
+
sec = engine.section.create_circle("CircleSection", d=0.5, tw=0.02)
|
|
80
80
|
|
|
81
81
|
# Create materials
|
|
82
|
-
mat = engine.material.create_conc("
|
|
82
|
+
mat = engine.material.create_conc("C30Concrete", eCode="JTG3362_2018", eGrade="C30")
|
|
83
83
|
|
|
84
84
|
# Create nodes
|
|
85
85
|
n1 = engine.node.create(0, 0, 0)
|
|
@@ -172,11 +172,11 @@ Some managers contain sub-managers, accessed via attributes:
|
|
|
172
172
|
|
|
173
173
|
```python
|
|
174
174
|
# Element groups
|
|
175
|
-
grp = engine.element.group.create("
|
|
175
|
+
grp = engine.element.group.create("MainGirderElements")
|
|
176
176
|
grp.add([1, 2, 3])
|
|
177
177
|
|
|
178
178
|
# Boundary groups
|
|
179
|
-
bg = engine.boundary.group.create("
|
|
179
|
+
bg = engine.boundary.group.create("AbutmentBoundaries")
|
|
180
180
|
bg.add([1, 2])
|
|
181
181
|
|
|
182
182
|
# Various boundary types
|
|
@@ -195,13 +195,13 @@ prop = engine.tendon.prop.create_in(
|
|
|
195
195
|
)
|
|
196
196
|
shape = engine.tendon.shape.create_arc3d(
|
|
197
197
|
"N1", n_num=2, prop="15-10",
|
|
198
|
-
element_group="
|
|
198
|
+
element_group="MainGirderElements", curve_name="curve1"
|
|
199
199
|
)
|
|
200
200
|
|
|
201
201
|
# Live loads
|
|
202
|
-
grade = engine.live.grade.create("
|
|
203
|
-
lane = engine.live.lane.create("
|
|
204
|
-
case = engine.live.case.create("
|
|
202
|
+
grade = engine.live.grade.create("HighwayClassI")
|
|
203
|
+
lane = engine.live.lane.create("Lane1")
|
|
204
|
+
case = engine.live.case.create("LiveLoadCase 1")
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
### Property & Thickness Management
|
|
@@ -264,10 +264,10 @@ Some `create_*` functions support explicit numbering via the `no` parameter. If
|
|
|
264
264
|
|
|
265
265
|
```python
|
|
266
266
|
# Auto-assigned number
|
|
267
|
-
sec = engine.section.create_circle("
|
|
267
|
+
sec = engine.section.create_circle("Section1", d=0.5)
|
|
268
268
|
|
|
269
269
|
# Explicit number
|
|
270
|
-
sec = engine.section.create_circle("
|
|
270
|
+
sec = engine.section.create_circle("Section1", d=0.5, no=100)
|
|
271
271
|
```
|
|
272
272
|
|
|
273
273
|
## Result Export
|
|
@@ -279,11 +279,11 @@ After solving, you can export various analysis results using `engine.result`. Al
|
|
|
279
279
|
df = engine.result.loadcase("Self-weight", "LCEF")
|
|
280
280
|
|
|
281
281
|
# Export envelope results (element forces)
|
|
282
|
-
df = engine.result.env("
|
|
282
|
+
df = engine.result.env("BasicCombinationEnvelope", "EnvEF")
|
|
283
283
|
|
|
284
284
|
# Export design check results
|
|
285
285
|
df = engine.result.check(
|
|
286
|
-
"混凝土", "正截面抗弯验算", "
|
|
286
|
+
"混凝土", "正截面抗弯验算", "基本组合"
|
|
287
287
|
)
|
|
288
288
|
|
|
289
289
|
# Batch export all check results from Check folder
|
|
@@ -296,7 +296,7 @@ Supported result types:
|
|
|
296
296
|
- **Load case**: `LCEF` (element force), `LCED` (element displacement), `LCND` (node displacement), `LCBF` (boundary reaction), `LCTL` (tendon loss), `LCS` (element stress)
|
|
297
297
|
- **Envelope**: `EnvBF` (boundary reaction), `EnvEF` (element force), `EnvES` (element strain), `EnvS` (element stress), `EnvND` (node displacement)
|
|
298
298
|
|
|
299
|
-
Requires `pandas` to be installed: `
|
|
299
|
+
Requires `pandas` to be installed: `python -m install pandas`
|
|
300
300
|
|
|
301
301
|
## Complete Example
|
|
302
302
|
|
|
@@ -319,12 +319,12 @@ engine.control.set_inc_tendon(True)
|
|
|
319
319
|
engine.control.set_nonlinear(geom=False, link=False)
|
|
320
320
|
|
|
321
321
|
# Sections
|
|
322
|
-
engine.section.create_circle("
|
|
323
|
-
engine.section.create_circle("
|
|
322
|
+
engine.section.create_circle("CircleSection1", d=0.219, tw=0.012, no=1)
|
|
323
|
+
engine.section.create_circle("CircleSection2", d=0.180, tw=0.008, no=2)
|
|
324
324
|
|
|
325
325
|
# Materials
|
|
326
326
|
engine.material.create_steel(
|
|
327
|
-
"
|
|
327
|
+
"Steel1", eCode="JTGD64_2015", eGrade="Q345", dDmp=0.05, no=1
|
|
328
328
|
)
|
|
329
329
|
|
|
330
330
|
# Nodes
|
|
@@ -343,7 +343,7 @@ engine.boundary.get(1).assign("a", [1, 2])
|
|
|
343
343
|
|
|
344
344
|
# Loads
|
|
345
345
|
lc = engine.load.create(
|
|
346
|
-
"
|
|
346
|
+
"CustomLoadCase1",
|
|
347
347
|
load_case_type="USER",
|
|
348
348
|
prompt="Two forces applied at nodes 3 and 4"
|
|
349
349
|
)
|
|
@@ -354,14 +354,6 @@ lc.create_nforce(4, dFx=200000, dFy=0, dFz=0)
|
|
|
354
354
|
engine.solve()
|
|
355
355
|
```
|
|
356
356
|
|
|
357
|
-
## Important Notes
|
|
358
|
-
|
|
359
|
-
1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
|
|
360
|
-
2. **Exception handling**: All operations throw `RuntimeError` on failure. It is recommended to add exception handling in production code.
|
|
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.
|
|
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).
|
|
363
|
-
|
|
364
357
|
## More Resources
|
|
365
358
|
|
|
366
359
|
- [tests/](tests/): Example code for each module
|
|
367
|
-
- [templetes/](templetes/): Complete bridge modeling template projects
|
|
@@ -45,10 +45,10 @@ engine.control.set_calc_tendon(True)
|
|
|
45
45
|
engine.control.set_calc_creep(True)
|
|
46
46
|
|
|
47
47
|
# Create sections
|
|
48
|
-
sec = engine.section.create_circle("
|
|
48
|
+
sec = engine.section.create_circle("CircleSection", d=0.5, tw=0.02)
|
|
49
49
|
|
|
50
50
|
# Create materials
|
|
51
|
-
mat = engine.material.create_conc("
|
|
51
|
+
mat = engine.material.create_conc("C30Concrete", eCode="JTG3362_2018", eGrade="C30")
|
|
52
52
|
|
|
53
53
|
# Create nodes
|
|
54
54
|
n1 = engine.node.create(0, 0, 0)
|
|
@@ -141,11 +141,11 @@ Some managers contain sub-managers, accessed via attributes:
|
|
|
141
141
|
|
|
142
142
|
```python
|
|
143
143
|
# Element groups
|
|
144
|
-
grp = engine.element.group.create("
|
|
144
|
+
grp = engine.element.group.create("MainGirderElements")
|
|
145
145
|
grp.add([1, 2, 3])
|
|
146
146
|
|
|
147
147
|
# Boundary groups
|
|
148
|
-
bg = engine.boundary.group.create("
|
|
148
|
+
bg = engine.boundary.group.create("AbutmentBoundaries")
|
|
149
149
|
bg.add([1, 2])
|
|
150
150
|
|
|
151
151
|
# Various boundary types
|
|
@@ -164,13 +164,13 @@ prop = engine.tendon.prop.create_in(
|
|
|
164
164
|
)
|
|
165
165
|
shape = engine.tendon.shape.create_arc3d(
|
|
166
166
|
"N1", n_num=2, prop="15-10",
|
|
167
|
-
element_group="
|
|
167
|
+
element_group="MainGirderElements", curve_name="curve1"
|
|
168
168
|
)
|
|
169
169
|
|
|
170
170
|
# Live loads
|
|
171
|
-
grade = engine.live.grade.create("
|
|
172
|
-
lane = engine.live.lane.create("
|
|
173
|
-
case = engine.live.case.create("
|
|
171
|
+
grade = engine.live.grade.create("HighwayClassI")
|
|
172
|
+
lane = engine.live.lane.create("Lane1")
|
|
173
|
+
case = engine.live.case.create("LiveLoadCase 1")
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
### Property & Thickness Management
|
|
@@ -233,10 +233,10 @@ Some `create_*` functions support explicit numbering via the `no` parameter. If
|
|
|
233
233
|
|
|
234
234
|
```python
|
|
235
235
|
# Auto-assigned number
|
|
236
|
-
sec = engine.section.create_circle("
|
|
236
|
+
sec = engine.section.create_circle("Section1", d=0.5)
|
|
237
237
|
|
|
238
238
|
# Explicit number
|
|
239
|
-
sec = engine.section.create_circle("
|
|
239
|
+
sec = engine.section.create_circle("Section1", d=0.5, no=100)
|
|
240
240
|
```
|
|
241
241
|
|
|
242
242
|
## Result Export
|
|
@@ -248,11 +248,11 @@ After solving, you can export various analysis results using `engine.result`. Al
|
|
|
248
248
|
df = engine.result.loadcase("Self-weight", "LCEF")
|
|
249
249
|
|
|
250
250
|
# Export envelope results (element forces)
|
|
251
|
-
df = engine.result.env("
|
|
251
|
+
df = engine.result.env("BasicCombinationEnvelope", "EnvEF")
|
|
252
252
|
|
|
253
253
|
# Export design check results
|
|
254
254
|
df = engine.result.check(
|
|
255
|
-
"混凝土", "正截面抗弯验算", "
|
|
255
|
+
"混凝土", "正截面抗弯验算", "基本组合"
|
|
256
256
|
)
|
|
257
257
|
|
|
258
258
|
# Batch export all check results from Check folder
|
|
@@ -265,7 +265,7 @@ Supported result types:
|
|
|
265
265
|
- **Load case**: `LCEF` (element force), `LCED` (element displacement), `LCND` (node displacement), `LCBF` (boundary reaction), `LCTL` (tendon loss), `LCS` (element stress)
|
|
266
266
|
- **Envelope**: `EnvBF` (boundary reaction), `EnvEF` (element force), `EnvES` (element strain), `EnvS` (element stress), `EnvND` (node displacement)
|
|
267
267
|
|
|
268
|
-
Requires `pandas` to be installed: `
|
|
268
|
+
Requires `pandas` to be installed: `python -m install pandas`
|
|
269
269
|
|
|
270
270
|
## Complete Example
|
|
271
271
|
|
|
@@ -288,12 +288,12 @@ engine.control.set_inc_tendon(True)
|
|
|
288
288
|
engine.control.set_nonlinear(geom=False, link=False)
|
|
289
289
|
|
|
290
290
|
# Sections
|
|
291
|
-
engine.section.create_circle("
|
|
292
|
-
engine.section.create_circle("
|
|
291
|
+
engine.section.create_circle("CircleSection1", d=0.219, tw=0.012, no=1)
|
|
292
|
+
engine.section.create_circle("CircleSection2", d=0.180, tw=0.008, no=2)
|
|
293
293
|
|
|
294
294
|
# Materials
|
|
295
295
|
engine.material.create_steel(
|
|
296
|
-
"
|
|
296
|
+
"Steel1", eCode="JTGD64_2015", eGrade="Q345", dDmp=0.05, no=1
|
|
297
297
|
)
|
|
298
298
|
|
|
299
299
|
# Nodes
|
|
@@ -312,7 +312,7 @@ engine.boundary.get(1).assign("a", [1, 2])
|
|
|
312
312
|
|
|
313
313
|
# Loads
|
|
314
314
|
lc = engine.load.create(
|
|
315
|
-
"
|
|
315
|
+
"CustomLoadCase1",
|
|
316
316
|
load_case_type="USER",
|
|
317
317
|
prompt="Two forces applied at nodes 3 and 4"
|
|
318
318
|
)
|
|
@@ -323,14 +323,6 @@ lc.create_nforce(4, dFx=200000, dFy=0, dFz=0)
|
|
|
323
323
|
engine.solve()
|
|
324
324
|
```
|
|
325
325
|
|
|
326
|
-
## Important Notes
|
|
327
|
-
|
|
328
|
-
1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
|
|
329
|
-
2. **Exception handling**: All operations throw `RuntimeError` on failure. It is recommended to add exception handling in production code.
|
|
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.
|
|
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).
|
|
332
|
-
|
|
333
326
|
## More Resources
|
|
334
327
|
|
|
335
328
|
- [tests/](tests/): Example code for each module
|
|
336
|
-
- [templetes/](templetes/): Complete bridge modeling template projects
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.6
|
|
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
|
|
@@ -76,10 +76,10 @@ engine.control.set_calc_tendon(True)
|
|
|
76
76
|
engine.control.set_calc_creep(True)
|
|
77
77
|
|
|
78
78
|
# Create sections
|
|
79
|
-
sec = engine.section.create_circle("
|
|
79
|
+
sec = engine.section.create_circle("CircleSection", d=0.5, tw=0.02)
|
|
80
80
|
|
|
81
81
|
# Create materials
|
|
82
|
-
mat = engine.material.create_conc("
|
|
82
|
+
mat = engine.material.create_conc("C30Concrete", eCode="JTG3362_2018", eGrade="C30")
|
|
83
83
|
|
|
84
84
|
# Create nodes
|
|
85
85
|
n1 = engine.node.create(0, 0, 0)
|
|
@@ -172,11 +172,11 @@ Some managers contain sub-managers, accessed via attributes:
|
|
|
172
172
|
|
|
173
173
|
```python
|
|
174
174
|
# Element groups
|
|
175
|
-
grp = engine.element.group.create("
|
|
175
|
+
grp = engine.element.group.create("MainGirderElements")
|
|
176
176
|
grp.add([1, 2, 3])
|
|
177
177
|
|
|
178
178
|
# Boundary groups
|
|
179
|
-
bg = engine.boundary.group.create("
|
|
179
|
+
bg = engine.boundary.group.create("AbutmentBoundaries")
|
|
180
180
|
bg.add([1, 2])
|
|
181
181
|
|
|
182
182
|
# Various boundary types
|
|
@@ -195,13 +195,13 @@ prop = engine.tendon.prop.create_in(
|
|
|
195
195
|
)
|
|
196
196
|
shape = engine.tendon.shape.create_arc3d(
|
|
197
197
|
"N1", n_num=2, prop="15-10",
|
|
198
|
-
element_group="
|
|
198
|
+
element_group="MainGirderElements", curve_name="curve1"
|
|
199
199
|
)
|
|
200
200
|
|
|
201
201
|
# Live loads
|
|
202
|
-
grade = engine.live.grade.create("
|
|
203
|
-
lane = engine.live.lane.create("
|
|
204
|
-
case = engine.live.case.create("
|
|
202
|
+
grade = engine.live.grade.create("HighwayClassI")
|
|
203
|
+
lane = engine.live.lane.create("Lane1")
|
|
204
|
+
case = engine.live.case.create("LiveLoadCase 1")
|
|
205
205
|
```
|
|
206
206
|
|
|
207
207
|
### Property & Thickness Management
|
|
@@ -264,10 +264,10 @@ Some `create_*` functions support explicit numbering via the `no` parameter. If
|
|
|
264
264
|
|
|
265
265
|
```python
|
|
266
266
|
# Auto-assigned number
|
|
267
|
-
sec = engine.section.create_circle("
|
|
267
|
+
sec = engine.section.create_circle("Section1", d=0.5)
|
|
268
268
|
|
|
269
269
|
# Explicit number
|
|
270
|
-
sec = engine.section.create_circle("
|
|
270
|
+
sec = engine.section.create_circle("Section1", d=0.5, no=100)
|
|
271
271
|
```
|
|
272
272
|
|
|
273
273
|
## Result Export
|
|
@@ -279,11 +279,11 @@ After solving, you can export various analysis results using `engine.result`. Al
|
|
|
279
279
|
df = engine.result.loadcase("Self-weight", "LCEF")
|
|
280
280
|
|
|
281
281
|
# Export envelope results (element forces)
|
|
282
|
-
df = engine.result.env("
|
|
282
|
+
df = engine.result.env("BasicCombinationEnvelope", "EnvEF")
|
|
283
283
|
|
|
284
284
|
# Export design check results
|
|
285
285
|
df = engine.result.check(
|
|
286
|
-
"混凝土", "正截面抗弯验算", "
|
|
286
|
+
"混凝土", "正截面抗弯验算", "基本组合"
|
|
287
287
|
)
|
|
288
288
|
|
|
289
289
|
# Batch export all check results from Check folder
|
|
@@ -296,7 +296,7 @@ Supported result types:
|
|
|
296
296
|
- **Load case**: `LCEF` (element force), `LCED` (element displacement), `LCND` (node displacement), `LCBF` (boundary reaction), `LCTL` (tendon loss), `LCS` (element stress)
|
|
297
297
|
- **Envelope**: `EnvBF` (boundary reaction), `EnvEF` (element force), `EnvES` (element strain), `EnvS` (element stress), `EnvND` (node displacement)
|
|
298
298
|
|
|
299
|
-
Requires `pandas` to be installed: `
|
|
299
|
+
Requires `pandas` to be installed: `python -m install pandas`
|
|
300
300
|
|
|
301
301
|
## Complete Example
|
|
302
302
|
|
|
@@ -319,12 +319,12 @@ engine.control.set_inc_tendon(True)
|
|
|
319
319
|
engine.control.set_nonlinear(geom=False, link=False)
|
|
320
320
|
|
|
321
321
|
# Sections
|
|
322
|
-
engine.section.create_circle("
|
|
323
|
-
engine.section.create_circle("
|
|
322
|
+
engine.section.create_circle("CircleSection1", d=0.219, tw=0.012, no=1)
|
|
323
|
+
engine.section.create_circle("CircleSection2", d=0.180, tw=0.008, no=2)
|
|
324
324
|
|
|
325
325
|
# Materials
|
|
326
326
|
engine.material.create_steel(
|
|
327
|
-
"
|
|
327
|
+
"Steel1", eCode="JTGD64_2015", eGrade="Q345", dDmp=0.05, no=1
|
|
328
328
|
)
|
|
329
329
|
|
|
330
330
|
# Nodes
|
|
@@ -343,7 +343,7 @@ engine.boundary.get(1).assign("a", [1, 2])
|
|
|
343
343
|
|
|
344
344
|
# Loads
|
|
345
345
|
lc = engine.load.create(
|
|
346
|
-
"
|
|
346
|
+
"CustomLoadCase1",
|
|
347
347
|
load_case_type="USER",
|
|
348
348
|
prompt="Two forces applied at nodes 3 and 4"
|
|
349
349
|
)
|
|
@@ -354,14 +354,6 @@ lc.create_nforce(4, dFx=200000, dFy=0, dFz=0)
|
|
|
354
354
|
engine.solve()
|
|
355
355
|
```
|
|
356
356
|
|
|
357
|
-
## Important Notes
|
|
358
|
-
|
|
359
|
-
1. **OSIS must be running**: Before executing code, ensure the OSIS software is launched and logged in. pyosis communicates with OSIS via HTTP.
|
|
360
|
-
2. **Exception handling**: All operations throw `RuntimeError` on failure. It is recommended to add exception handling in production code.
|
|
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.
|
|
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).
|
|
363
|
-
|
|
364
357
|
## More Resources
|
|
365
358
|
|
|
366
359
|
- [tests/](tests/): Example code for each module
|
|
367
|
-
- [templetes/](templetes/): Complete bridge modeling template projects
|
|
@@ -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.
|
|
10
|
+
__version__ = "0.4.6"
|
|
11
11
|
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
|
|
12
12
|
|
|
13
13
|
from .core.engine import OSISEngine
|
|
@@ -46,7 +46,7 @@ def osis_boundary_general(nBd: int, eBoundaryType: Literal["GENERAL"]="GENERAL",
|
|
|
46
46
|
pass
|
|
47
47
|
|
|
48
48
|
@REGISTRY.register("Boundary")
|
|
49
|
-
def osis_boundary_master_slave(nBd: int, eBoundaryType: Literal["MSTSLV"]="MSTSLV", nNode: int = 1, bX: bool = 1, bY: bool = 1, bZ: bool = 1, bRX: bool = 1, bRY: bool = 1, bRZ: bool = 1):
|
|
49
|
+
def osis_boundary_master_slave(nBd: int, eBoundaryType: Literal["MSTSLV"]="MSTSLV", nNode: int = 1, bX: bool = 1, bY: bool = 1, bZ: bool = 1, bRX: bool = 1, bRY: bool = 1, bRZ: bool = 1, bCoincident: Literal[0, 1] | None = 1):
|
|
50
50
|
'''
|
|
51
51
|
## 定义或修改主从约束
|
|
52
52
|
pyosis.boundary.osis_boundary_master_slave
|
|
@@ -61,6 +61,7 @@ def osis_boundary_master_slave(nBd: int, eBoundaryType: Literal["MSTSLV"]="MSTSL
|
|
|
61
61
|
bRX (bool): 0 = 释放,1 = 约束
|
|
62
62
|
bRY (bool): 0 = 释放,1 = 约束
|
|
63
63
|
bRZ (bool): 0 = 释放,1 = 约束
|
|
64
|
+
bCoincident: 0 = 仅同位移约束,默认1,可缺省
|
|
64
65
|
Returns:
|
|
65
66
|
tuple (bool, str): 是否成功,失败原因
|
|
66
67
|
'''
|
|
@@ -69,7 +70,7 @@ def osis_boundary_master_slave(nBd: int, eBoundaryType: Literal["MSTSLV"]="MSTSL
|
|
|
69
70
|
@REGISTRY.register("Boundary")
|
|
70
71
|
def osis_boundary_rigid(nBd: int, eBoundaryType: Literal["RIGID"], nNodeI: int):
|
|
71
72
|
'''
|
|
72
|
-
##
|
|
73
|
+
## 定义或修改刚性连接
|
|
73
74
|
|
|
74
75
|
Args:
|
|
75
76
|
nBd (int): 编号
|
|
@@ -95,10 +96,10 @@ def osis_boundary_release(nBd: int, eBoundaryType: Literal["RELEASE"],
|
|
|
95
96
|
|
|
96
97
|
Args:
|
|
97
98
|
nBd (int): 编号
|
|
98
|
-
eBoundaryType (str): 固定为
|
|
99
|
+
eBoundaryType (str): 固定为 RELEASE
|
|
99
100
|
\\*_state (bool):
|
|
100
|
-
* 0 =
|
|
101
|
-
* 1 =
|
|
101
|
+
* 0 = 完全释放
|
|
102
|
+
* 1 = 完全约束
|
|
102
103
|
F\\*i and M\\*i (float): 部分约束的大小,0-1之间,表示释放后残余的约束能力的百分比
|
|
103
104
|
Returns:
|
|
104
105
|
tuple (bool, str): 是否成功,失败原因
|
|
@@ -577,6 +577,13 @@ class BoundaryGroupManager:
|
|
|
577
577
|
"""获取边界组总数"""
|
|
578
578
|
return len(self._load())
|
|
579
579
|
|
|
580
|
+
def clear(self) -> None:
|
|
581
|
+
"""清空所有边界组"""
|
|
582
|
+
try:
|
|
583
|
+
[self.delete(bg.name) for bg in self.all()]
|
|
584
|
+
except Exception as e:
|
|
585
|
+
raise Exception(f"清空所有边界组失败: {e},被占用,无法删除")
|
|
586
|
+
|
|
580
587
|
def __repr__(self) -> str:
|
|
581
588
|
return f"BoundaryGroupManager()"
|
|
582
589
|
|
|
@@ -659,11 +666,12 @@ class BoundaryManager:
|
|
|
659
666
|
bRY: Literal[0, 1] = 1,
|
|
660
667
|
bRZ: Literal[0, 1] = 1,
|
|
661
668
|
no: int | None = None,
|
|
669
|
+
bCoincident: int | None = 1,
|
|
662
670
|
) -> MstSlvBoundary:
|
|
663
671
|
"""创建主从约束"""
|
|
664
672
|
if no is None:
|
|
665
673
|
no = self._next_no()
|
|
666
|
-
ok, err = osis_boundary_master_slave(no, "MSTSLV", nNode, bX, bY, bZ, bRX, bRY, bRZ)
|
|
674
|
+
ok, err = osis_boundary_master_slave(no, "MSTSLV", nNode, bX, bY, bZ, bRX, bRY, bRZ,bCoincident)
|
|
667
675
|
if not ok:
|
|
668
676
|
raise RuntimeError(f"创建主从约束 {no} 失败: {err}")
|
|
669
677
|
return self.get(no) # type: ignore[return-value]
|
|
@@ -853,6 +861,13 @@ class BoundaryManager:
|
|
|
853
861
|
"""获取边界总数"""
|
|
854
862
|
return len(self._load())
|
|
855
863
|
|
|
864
|
+
def clear(self) -> None:
|
|
865
|
+
"""清空所有边界"""
|
|
866
|
+
try:
|
|
867
|
+
[self.delete(b.no) for b in self.all()]
|
|
868
|
+
except Exception as e:
|
|
869
|
+
raise Exception(f"清空所有边界失败: {e},被占用,无法删除")
|
|
870
|
+
|
|
856
871
|
# ── 子管理器 ──────────────────────────────
|
|
857
872
|
|
|
858
873
|
@property
|
|
@@ -90,6 +90,13 @@ class OSISEngine:
|
|
|
90
90
|
url (str): OSIS 网址
|
|
91
91
|
'''
|
|
92
92
|
# 引用全局单例管理器
|
|
93
|
+
self._project = project_manager
|
|
94
|
+
|
|
95
|
+
### 前处理 ###
|
|
96
|
+
self._control = control_manager
|
|
97
|
+
self._geometry = geometry_manager
|
|
98
|
+
self._property = property_manager
|
|
99
|
+
self._thickness = thickness_manager
|
|
93
100
|
self._material = material_manager
|
|
94
101
|
self._section = section_manager
|
|
95
102
|
self._node = node_manager
|
|
@@ -97,16 +104,13 @@ class OSISEngine:
|
|
|
97
104
|
self._boundary = boundary_manager
|
|
98
105
|
self._load = loadcase_manager
|
|
99
106
|
self._tendon = tendon_manager
|
|
100
|
-
self._stage = stage_manager
|
|
101
107
|
self._live = live_manager
|
|
102
|
-
self._control = control_manager
|
|
103
|
-
self._project = project_manager
|
|
104
|
-
self._geometry = geometry_manager
|
|
105
|
-
self._property = property_manager
|
|
106
|
-
self._thickness = thickness_manager
|
|
107
108
|
self._settlement = settlement_manager
|
|
108
109
|
self._stability = stability_manager
|
|
109
110
|
self._dynamic = dynamic_manager
|
|
111
|
+
self._stage = stage_manager
|
|
112
|
+
|
|
113
|
+
### 后处理 ###
|
|
110
114
|
self._post = post_manager
|
|
111
115
|
self._result = result_manager
|
|
112
116
|
|
|
@@ -123,6 +127,33 @@ class OSISEngine:
|
|
|
123
127
|
# 子管理器属性
|
|
124
128
|
# ──────────────────────────────────────────
|
|
125
129
|
|
|
130
|
+
@property
|
|
131
|
+
def project(self) -> ProjectManager:
|
|
132
|
+
"""项目管理器(创建、打开、保存项目)"""
|
|
133
|
+
return self._project
|
|
134
|
+
|
|
135
|
+
### 前处理 ###
|
|
136
|
+
|
|
137
|
+
@property
|
|
138
|
+
def control(self) -> ControlManager:
|
|
139
|
+
"""控制管理器(全局参数、分析设置)"""
|
|
140
|
+
return self._control
|
|
141
|
+
|
|
142
|
+
@property
|
|
143
|
+
def geometry(self) -> GeometryManager:
|
|
144
|
+
"""几何管理器(三维样条曲线)"""
|
|
145
|
+
return self._geometry
|
|
146
|
+
|
|
147
|
+
@property
|
|
148
|
+
def prop(self) -> PropertyManager:
|
|
149
|
+
"""属性管理器(坐标系、收缩徐变、阻尼等)"""
|
|
150
|
+
return self._property
|
|
151
|
+
|
|
152
|
+
@property
|
|
153
|
+
def thickness(self) -> ThicknessManager:
|
|
154
|
+
"""厚度管理器(壳厚度特性)"""
|
|
155
|
+
return self._thickness
|
|
156
|
+
|
|
126
157
|
@property
|
|
127
158
|
def material(self) -> MaterialManager:
|
|
128
159
|
"""材料管理器"""
|
|
@@ -153,11 +184,6 @@ class OSISEngine:
|
|
|
153
184
|
"""荷载工况管理器"""
|
|
154
185
|
return self._load
|
|
155
186
|
|
|
156
|
-
@property
|
|
157
|
-
def stage(self) -> StageManager:
|
|
158
|
-
"""施工阶段管理器"""
|
|
159
|
-
return self._stage
|
|
160
|
-
|
|
161
187
|
@property
|
|
162
188
|
def tendon(self) -> TendonManager:
|
|
163
189
|
"""钢束管理器"""
|
|
@@ -168,36 +194,11 @@ class OSISEngine:
|
|
|
168
194
|
"""活载管理器"""
|
|
169
195
|
return self._live
|
|
170
196
|
|
|
171
|
-
@property
|
|
172
|
-
def geometry(self) -> GeometryManager:
|
|
173
|
-
"""几何管理器(三维样条曲线)"""
|
|
174
|
-
return self._geometry
|
|
175
|
-
|
|
176
|
-
@property
|
|
177
|
-
def prop(self) -> PropertyManager:
|
|
178
|
-
"""属性管理器(坐标系、收缩徐变、阻尼等)"""
|
|
179
|
-
return self._property
|
|
180
|
-
|
|
181
|
-
@property
|
|
182
|
-
def thickness(self) -> ThicknessManager:
|
|
183
|
-
"""厚度管理器(壳厚度特性)"""
|
|
184
|
-
return self._thickness
|
|
185
|
-
|
|
186
|
-
@property
|
|
187
|
-
def control(self) -> ControlManager:
|
|
188
|
-
"""控制管理器(全局参数、分析设置)"""
|
|
189
|
-
return self._control
|
|
190
|
-
|
|
191
|
-
@property
|
|
192
|
-
def project(self) -> ProjectManager:
|
|
193
|
-
"""项目管理器(创建、打开、保存项目)"""
|
|
194
|
-
return self._project
|
|
195
|
-
|
|
196
197
|
@property
|
|
197
198
|
def settlement(self) -> SettlementManager:
|
|
198
199
|
"""沉降分析管理器"""
|
|
199
200
|
return self._settlement
|
|
200
|
-
|
|
201
|
+
|
|
201
202
|
@property
|
|
202
203
|
def stability(self) -> StabilityManager:
|
|
203
204
|
"""稳定分析管理器(屈曲分析)"""
|
|
@@ -207,6 +208,13 @@ class OSISEngine:
|
|
|
207
208
|
def dynamic(self) -> DynamicManager:
|
|
208
209
|
"""动力分析管理器(荷载转换质量、模态、反应谱)"""
|
|
209
210
|
return self._dynamic
|
|
211
|
+
|
|
212
|
+
@property
|
|
213
|
+
def stage(self) -> StageManager:
|
|
214
|
+
"""施工阶段管理器"""
|
|
215
|
+
return self._stage
|
|
216
|
+
|
|
217
|
+
### 后处理 ###
|
|
210
218
|
|
|
211
219
|
@property
|
|
212
220
|
def post(self) -> PostManager:
|
|
@@ -337,18 +345,23 @@ class OSISEngine:
|
|
|
337
345
|
各组件数量的字典
|
|
338
346
|
"""
|
|
339
347
|
return {
|
|
348
|
+
# "controls": # 没必要
|
|
349
|
+
"geometries": self._geometry.count(),
|
|
350
|
+
"properties": self.prop.count(),
|
|
351
|
+
# "thickness": self._thickness.count(),
|
|
340
352
|
"materials": self._material.count(),
|
|
341
353
|
"sections": self._section.count(),
|
|
342
354
|
"nodes": self._node.count(),
|
|
343
355
|
"elements": self._element.count(),
|
|
344
356
|
"boundaries": self._boundary.count(),
|
|
345
|
-
"
|
|
346
|
-
"stages": self._stage.count(),
|
|
347
|
-
"geometry": self._geometry.count(),
|
|
348
|
-
"live_loads": self._live.count(),
|
|
349
|
-
"settlements": self._settlement.count(),
|
|
357
|
+
"loadcases": self._load.count(),
|
|
350
358
|
"tendon_props": self._tendon.prop.count(),
|
|
351
359
|
"tendon_shapes": self._tendon.shape.count(),
|
|
360
|
+
"lives": self._live.count(),
|
|
361
|
+
"settlements": self._settlement.count(),
|
|
362
|
+
"stabilities": self._stability.count(),
|
|
363
|
+
"dynamic": self._dynamic.count(),
|
|
364
|
+
"stages": self._stage.count(),
|
|
352
365
|
}
|
|
353
366
|
|
|
354
367
|
def __repr__(self) -> str:
|