osis-python 0.2.3__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.
- osis_python-0.3.1/PKG-INFO +367 -0
- osis_python-0.3.1/README.md +336 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/pyproject.toml +1 -0
- osis_python-0.3.1/src/osis_python.egg-info/PKG-INFO +367 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/osis_python.egg-info/SOURCES.txt +32 -18
- {osis_python-0.2.3 → osis_python-0.3.1}/src/osis_python.egg-info/requires.txt +1 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/__init__.py +1 -1
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/boundary/interface.py +111 -46
- osis_python-0.3.1/src/pyosis/boundary/manager.py +877 -0
- osis_python-0.3.1/src/pyosis/control/__init__.py +4 -0
- osis_python-0.2.3/src/pyosis/control/interface.py → osis_python-0.3.1/src/pyosis/control/control.py +1 -66
- osis_python-0.3.1/src/pyosis/control/io.py +23 -0
- osis_python-0.3.1/src/pyosis/control/manager.py +196 -0
- osis_python-0.3.1/src/pyosis/control/nonlinear.py +71 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/core/all_func.py +9 -4
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/core/client.py +29 -9
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/core/command.py +2 -1
- osis_python-0.3.1/src/pyosis/core/engine.py +351 -0
- osis_python-0.3.1/src/pyosis/dynamic/__init__.py +12 -0
- osis_python-0.3.1/src/pyosis/dynamic/load_to_mass.py +108 -0
- osis_python-0.3.1/src/pyosis/dynamic/manager.py +347 -0
- osis_python-0.3.1/src/pyosis/dynamic/modal.py +28 -0
- osis_python-0.3.1/src/pyosis/dynamic/seismic.py +195 -0
- osis_python-0.3.1/src/pyosis/element/__init__.py +2 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/element/interface.py +1 -17
- osis_python-0.3.1/src/pyosis/element/manager.py +599 -0
- {osis_python-0.2.3/src/pyosis/common → osis_python-0.3.1/src/pyosis/general}/interface.py +70 -14
- osis_python-0.3.1/src/pyosis/geometry/__init__.py +2 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/geometry/interface.py +4 -4
- osis_python-0.3.1/src/pyosis/geometry/manager.py +321 -0
- osis_python-0.3.1/src/pyosis/live/__init__.py +4 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/live/analysis.py +17 -18
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/live/lane.py +1 -1
- osis_python-0.3.1/src/pyosis/live/manager.py +1001 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/load/__init__.py +1 -1
- osis_python-0.3.1/src/pyosis/load/manager.py +1450 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/load/static.py +68 -19
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/load/tendon.py +46 -41
- osis_python-0.3.1/src/pyosis/material/__init__.py +2 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/material/manager.py +121 -85
- osis_python-0.3.1/src/pyosis/node/__init__.py +2 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/node/manager.py +84 -90
- osis_python-0.3.1/src/pyosis/post/__init__.py +4 -0
- osis_python-0.3.1/src/pyosis/post/combine.py +145 -0
- osis_python-0.3.1/src/pyosis/post/design_check.py +362 -0
- osis_python-0.3.1/src/pyosis/post/display.py +76 -0
- osis_python-0.3.1/src/pyosis/post/manager.py +557 -0
- osis_python-0.3.1/src/pyosis/project/__init__.py +2 -0
- osis_python-0.3.1/src/pyosis/project/interface.py +64 -0
- osis_python-0.3.1/src/pyosis/project/manager.py +101 -0
- osis_python-0.3.1/src/pyosis/property/__init__.py +6 -0
- osis_python-0.2.3/src/pyosis/property/comp_thickness.py → osis_python-0.3.1/src/pyosis/property/component_thickness.py +3 -3
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/property/coordinate.py +4 -4
- osis_python-0.3.1/src/pyosis/property/damping.py +125 -0
- osis_python-0.3.1/src/pyosis/property/manager.py +284 -0
- osis_python-0.3.1/src/pyosis/result/__init__.py +4 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/result/check.py +4 -4
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/result/env.py +1 -1
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/result/loadcase.py +1 -1
- osis_python-0.3.1/src/pyosis/result/manager.py +272 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/result/result.py +3 -3
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/section/__init__.py +1 -1
- osis_python-0.3.1/src/pyosis/section/manager.py +1288 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/section/numeric.py +2 -2
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/section/param.py +44 -6
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/section/rebar.py +1 -1
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/section/rib.py +31 -0
- osis_python-0.3.1/src/pyosis/settlement/__init__.py +8 -0
- osis_python-0.3.1/src/pyosis/settlement/interface.py +150 -0
- osis_python-0.3.1/src/pyosis/settlement/manager.py +368 -0
- osis_python-0.3.1/src/pyosis/stability/__init__.py +2 -0
- osis_python-0.3.1/src/pyosis/stability/buckling.py +112 -0
- osis_python-0.3.1/src/pyosis/stability/manager.py +175 -0
- osis_python-0.3.1/src/pyosis/stage/__init__.py +4 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/stage/define.py +18 -18
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/stage/manager.py +201 -190
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/stage/overall.py +6 -6
- osis_python-0.3.1/src/pyosis/thickness/__init__.py +2 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/thickness/interface.py +3 -3
- osis_python-0.3.1/src/pyosis/thickness/manager.py +76 -0
- osis_python-0.3.1/src/pyosis/transfer/__init__.py +50 -0
- osis_python-0.3.1/src/pyosis/transfer/command_map.py +695 -0
- osis_python-0.3.1/src/pyosis/transfer/generator.py +366 -0
- osis_python-0.3.1/src/pyosis/transfer/parser.py +150 -0
- osis_python-0.2.3/PKG-INFO +0 -111
- osis_python-0.2.3/README.md +0 -81
- osis_python-0.2.3/src/osis_python.egg-info/PKG-INFO +0 -111
- osis_python-0.2.3/src/pyosis/boundary/manager.py +0 -342
- osis_python-0.2.3/src/pyosis/common/__init__.py +0 -2
- osis_python-0.2.3/src/pyosis/common/project.py +0 -54
- osis_python-0.2.3/src/pyosis/core/PyInterface.pyi +0 -157
- osis_python-0.2.3/src/pyosis/element/__init__.py +0 -2
- osis_python-0.2.3/src/pyosis/element/manager.py +0 -403
- osis_python-0.2.3/src/pyosis/general/interface.py +0 -31
- osis_python-0.2.3/src/pyosis/geometry/__init__.py +0 -1
- osis_python-0.2.3/src/pyosis/io/__init__.py +0 -11
- osis_python-0.2.3/src/pyosis/io/boundary_info.py +0 -239
- osis_python-0.2.3/src/pyosis/io/coordinate.py +0 -98
- osis_python-0.2.3/src/pyosis/io/element_info.py +0 -489
- osis_python-0.2.3/src/pyosis/io/group_info.py +0 -82
- osis_python-0.2.3/src/pyosis/io/material_info.py +0 -39
- osis_python-0.2.3/src/pyosis/io/node_info.py +0 -192
- osis_python-0.2.3/src/pyosis/io/prestressed_info.py +0 -170
- osis_python-0.2.3/src/pyosis/io/response.py +0 -135
- osis_python-0.2.3/src/pyosis/io/section_info.py +0 -162
- osis_python-0.2.3/src/pyosis/io/stage_info.py +0 -187
- osis_python-0.2.3/src/pyosis/live/__init__.py +0 -11
- osis_python-0.2.3/src/pyosis/live/manager.py +0 -668
- osis_python-0.2.3/src/pyosis/load/manager.py +0 -392
- osis_python-0.2.3/src/pyosis/material/__init__.py +0 -2
- osis_python-0.2.3/src/pyosis/node/__init__.py +0 -2
- osis_python-0.2.3/src/pyosis/post/__init__.py +0 -1
- osis_python-0.2.3/src/pyosis/post/combine.py +0 -90
- osis_python-0.2.3/src/pyosis/property/__init__.py +0 -4
- osis_python-0.2.3/src/pyosis/property/damping.py +0 -37
- osis_python-0.2.3/src/pyosis/quick_building/__init__.py +0 -1
- osis_python-0.2.3/src/pyosis/result/__init__.py +0 -3
- osis_python-0.2.3/src/pyosis/section/manager.py +0 -1252
- osis_python-0.2.3/src/pyosis/stage/__init__.py +0 -4
- osis_python-0.2.3/src/pyosis/thickness/__init__.py +0 -1
- {osis_python-0.2.3 → osis_python-0.3.1}/LICENSE +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/setup.cfg +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/core/__init__.py +0 -0
- {osis_python-0.2.3/src/pyosis/control → osis_python-0.3.1/src/pyosis/general}/__init__.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/material/interface.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/property/creep_shrink.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.2.3/src/pyosis/general → osis_python-0.3.1/src/pyosis/quick_building}/__init__.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/section/common.py +0 -0
- {osis_python-0.2.3 → osis_python-0.3.1}/src/pyosis/section/steel.py +0 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: osis-python
|
|
3
|
+
Version: 0.3.1
|
|
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. 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
|
|
130
|
+
|
|
131
|
+
If you don't need the convenience methods of Engine, you can also import individual managers directly:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from pyosis.material import material_manager
|
|
135
|
+
from pyosis.node import node_manager
|
|
136
|
+
|
|
137
|
+
mat = material_manager.create_conc("C30", eCode="JTG3362_2018", eGrade="C30")
|
|
138
|
+
node = node_manager.create(0, 0, 0)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Core Architecture
|
|
142
|
+
|
|
143
|
+
### Manager System
|
|
144
|
+
|
|
145
|
+
pyosis adopts a Manager pattern to organize code. Each module corresponds to a Manager:
|
|
146
|
+
|
|
147
|
+
| Manager | Attribute | Description |
|
|
148
|
+
|---------|-----------|-------------|
|
|
149
|
+
| MaterialManager | `engine.material` | Materials (concrete, steel, prestressed, rebar, etc.) |
|
|
150
|
+
| SectionManager | `engine.section` | Sections (box girder, T-girder, hollow slab, steel box, etc.) |
|
|
151
|
+
| NodeManager | `engine.node` | Nodes |
|
|
152
|
+
| ElementManager | `engine.element` | Elements (beam, truss, spring, cable, shell) |
|
|
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 |
|
|
157
|
+
| LoadCaseManager | `engine.load` | Load cases |
|
|
158
|
+
| StageManager | `engine.stage` | Construction stages |
|
|
159
|
+
| TendonManager | `engine.tendon` | Tendons (properties + shapes) |
|
|
160
|
+
| LiveManager | `engine.live` | Live loads (grades + lanes + cases) |
|
|
161
|
+
| SettlementManager | `engine.settlement` | Settlement analysis |
|
|
162
|
+
| StabilityManager | `engine.stability` | Stability analysis |
|
|
163
|
+
| DynamicManager | `engine.dynamic` | Dynamic analysis |
|
|
164
|
+
| PostManager | `engine.post` | Post-processing (load combinations, design checks) |
|
|
165
|
+
| ResultManager | `engine.result` | Result export (load case / envelope / check results) |
|
|
166
|
+
| ControlManager | `engine.control` | Global control parameters |
|
|
167
|
+
| ProjectManager | `engine.project` | Project operations |
|
|
168
|
+
|
|
169
|
+
### Sub-Managers
|
|
170
|
+
|
|
171
|
+
Some managers contain sub-managers, accessed via attributes:
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
# Element groups
|
|
175
|
+
grp = engine.element.group.create("Main Girder Elements")
|
|
176
|
+
grp.add([1, 2, 3])
|
|
177
|
+
|
|
178
|
+
# Boundary groups
|
|
179
|
+
bg = engine.boundary.group.create("Abutment Boundaries")
|
|
180
|
+
bg.add([1, 2])
|
|
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
|
+
|
|
191
|
+
# Tendons
|
|
192
|
+
prop = engine.tendon.prop.create_in(
|
|
193
|
+
"15-10", mat_no=1, e_code="GBT5224_2014",
|
|
194
|
+
diameter=15.2, n_num=10, d_pipe=0.09
|
|
195
|
+
)
|
|
196
|
+
shape = engine.tendon.shape.create_arc3d(
|
|
197
|
+
"N1", n_num=2, prop="15-10",
|
|
198
|
+
element_group="Main Girder Elements", curve_name="curve1"
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
# Live loads
|
|
202
|
+
grade = engine.live.grade.create("Highway-Class I")
|
|
203
|
+
lane = engine.live.lane.create("Lane 1")
|
|
204
|
+
case = engine.live.case.create("Live Load Case 1")
|
|
205
|
+
```
|
|
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
|
+
|
|
245
|
+
### Data Class Objects
|
|
246
|
+
|
|
247
|
+
Create and query operations return data class objects (dataclass) instead of raw dictionaries:
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
elem = engine.element.get(1)
|
|
251
|
+
print(elem.no) # ID
|
|
252
|
+
print(elem.node_vec) # Node list
|
|
253
|
+
print(elem.mat) # Material ID
|
|
254
|
+
|
|
255
|
+
# Objects support operations (operations下沉 to object)
|
|
256
|
+
lc = engine.load.get("Self-weight")
|
|
257
|
+
lc.create_gravity()
|
|
258
|
+
lc.create_nforce(1, dFx=1000)
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Explicit Numbering
|
|
262
|
+
|
|
263
|
+
Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
|
|
264
|
+
|
|
265
|
+
```python
|
|
266
|
+
# Auto-assigned number
|
|
267
|
+
sec = engine.section.create_circle("Section 1", d=0.5)
|
|
268
|
+
|
|
269
|
+
# Explicit number
|
|
270
|
+
sec = engine.section.create_circle("Section 1", d=0.5, no=100)
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Result Export
|
|
274
|
+
|
|
275
|
+
After solving, you can export various analysis results using `engine.result`. All export methods return pandas DataFrames:
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
# Export load case results (element forces)
|
|
279
|
+
df = engine.result.loadcase("Self-weight", "LCEF")
|
|
280
|
+
|
|
281
|
+
# Export envelope results (element forces)
|
|
282
|
+
df = engine.result.env("Basic Combination Envelope", "EnvEF")
|
|
283
|
+
|
|
284
|
+
# Export design check results
|
|
285
|
+
df = engine.result.check(
|
|
286
|
+
"混凝土", "正截面抗弯验算", "Basic Combination"
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
# Batch export all check results from Check folder
|
|
290
|
+
results = engine.result.check_all()
|
|
291
|
+
for name, df in results.items():
|
|
292
|
+
print(f"{name}: {len(df)} rows")
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Supported result types:
|
|
296
|
+
- **Load case**: `LCEF` (element force), `LCED` (element displacement), `LCND` (node displacement), `LCBF` (boundary reaction), `LCTL` (tendon loss), `LCS` (element stress)
|
|
297
|
+
- **Envelope**: `EnvBF` (boundary reaction), `EnvEF` (element force), `EnvES` (element strain), `EnvS` (element stress), `EnvND` (node displacement)
|
|
298
|
+
|
|
299
|
+
Requires `pandas` to be installed: `pip install pandas`
|
|
300
|
+
|
|
301
|
+
## Complete Example
|
|
302
|
+
|
|
303
|
+
```python
|
|
304
|
+
from pyosis.core.engine import OSISEngine
|
|
305
|
+
|
|
306
|
+
engine = OSISEngine()
|
|
307
|
+
engine.clear()
|
|
308
|
+
|
|
309
|
+
# Control parameters
|
|
310
|
+
engine.control.set_gravity_acceleration(9.8066)
|
|
311
|
+
engine.control.set_calc_tendon(True)
|
|
312
|
+
engine.control.set_calc_concurrent_force(True)
|
|
313
|
+
engine.control.set_calc_shrink(True)
|
|
314
|
+
engine.control.set_calc_creep(True)
|
|
315
|
+
engine.control.set_calc_shear(True)
|
|
316
|
+
engine.control.set_calc_relaxation(True)
|
|
317
|
+
engine.control.set_mod_loc_coor(False)
|
|
318
|
+
engine.control.set_inc_tendon(True)
|
|
319
|
+
engine.control.set_nonlinear(geom=False, link=False)
|
|
320
|
+
|
|
321
|
+
# Sections
|
|
322
|
+
engine.section.create_circle("Circle Section 1", d=0.219, tw=0.012, no=1)
|
|
323
|
+
engine.section.create_circle("Circle Section 2", d=0.180, tw=0.008, no=2)
|
|
324
|
+
|
|
325
|
+
# Materials
|
|
326
|
+
engine.material.create_steel(
|
|
327
|
+
"Steel 1", eCode="JTGD64_2015", eGrade="Q345", dDmp=0.05, no=1
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
# Nodes
|
|
331
|
+
engine.node.create(0, 5, 0, no=1)
|
|
332
|
+
engine.node.create(15, 5, 0, no=2)
|
|
333
|
+
engine.node.create(7.5, 0, 0, no=3)
|
|
334
|
+
engine.node.create(20, 0, 0, no=4)
|
|
335
|
+
|
|
336
|
+
# Elements
|
|
337
|
+
engine.element.create_beam3d(1, 3, nMat=1, nSec1=1, nSec2=1, no=1)
|
|
338
|
+
engine.element.create_beam3d(2, 3, nMat=1, nSec1=2, nSec2=2, no=2)
|
|
339
|
+
|
|
340
|
+
# Boundaries
|
|
341
|
+
engine.boundary.create_general(no=1)
|
|
342
|
+
engine.boundary.get(1).assign("a", [1, 2])
|
|
343
|
+
|
|
344
|
+
# Loads
|
|
345
|
+
lc = engine.load.create(
|
|
346
|
+
"Custom Load Case 1",
|
|
347
|
+
load_case_type="USER",
|
|
348
|
+
prompt="Two forces applied at nodes 3 and 4"
|
|
349
|
+
)
|
|
350
|
+
lc.create_nforce(3, dFx=0, dFy=-1000000, dFz=0)
|
|
351
|
+
lc.create_nforce(4, dFx=200000, dFy=0, dFz=0)
|
|
352
|
+
|
|
353
|
+
# Solve
|
|
354
|
+
engine.solve()
|
|
355
|
+
```
|
|
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
|
+
## More Resources
|
|
365
|
+
|
|
366
|
+
- [tests/](tests/): Example code for each module
|
|
367
|
+
- [templetes/](templetes/): Complete bridge modeling template projects
|
|
@@ -0,0 +1,336 @@
|
|
|
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. 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
|
|
99
|
+
|
|
100
|
+
If you don't need the convenience methods of Engine, you can also import individual managers directly:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
from pyosis.material import material_manager
|
|
104
|
+
from pyosis.node import node_manager
|
|
105
|
+
|
|
106
|
+
mat = material_manager.create_conc("C30", eCode="JTG3362_2018", eGrade="C30")
|
|
107
|
+
node = node_manager.create(0, 0, 0)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Core Architecture
|
|
111
|
+
|
|
112
|
+
### Manager System
|
|
113
|
+
|
|
114
|
+
pyosis adopts a Manager pattern to organize code. Each module corresponds to a Manager:
|
|
115
|
+
|
|
116
|
+
| Manager | Attribute | Description |
|
|
117
|
+
|---------|-----------|-------------|
|
|
118
|
+
| MaterialManager | `engine.material` | Materials (concrete, steel, prestressed, rebar, etc.) |
|
|
119
|
+
| SectionManager | `engine.section` | Sections (box girder, T-girder, hollow slab, steel box, etc.) |
|
|
120
|
+
| NodeManager | `engine.node` | Nodes |
|
|
121
|
+
| ElementManager | `engine.element` | Elements (beam, truss, spring, cable, shell) |
|
|
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 |
|
|
126
|
+
| LoadCaseManager | `engine.load` | Load cases |
|
|
127
|
+
| StageManager | `engine.stage` | Construction stages |
|
|
128
|
+
| TendonManager | `engine.tendon` | Tendons (properties + shapes) |
|
|
129
|
+
| LiveManager | `engine.live` | Live loads (grades + lanes + cases) |
|
|
130
|
+
| SettlementManager | `engine.settlement` | Settlement analysis |
|
|
131
|
+
| StabilityManager | `engine.stability` | Stability analysis |
|
|
132
|
+
| DynamicManager | `engine.dynamic` | Dynamic analysis |
|
|
133
|
+
| PostManager | `engine.post` | Post-processing (load combinations, design checks) |
|
|
134
|
+
| ResultManager | `engine.result` | Result export (load case / envelope / check results) |
|
|
135
|
+
| ControlManager | `engine.control` | Global control parameters |
|
|
136
|
+
| ProjectManager | `engine.project` | Project operations |
|
|
137
|
+
|
|
138
|
+
### Sub-Managers
|
|
139
|
+
|
|
140
|
+
Some managers contain sub-managers, accessed via attributes:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
# Element groups
|
|
144
|
+
grp = engine.element.group.create("Main Girder Elements")
|
|
145
|
+
grp.add([1, 2, 3])
|
|
146
|
+
|
|
147
|
+
# Boundary groups
|
|
148
|
+
bg = engine.boundary.group.create("Abutment Boundaries")
|
|
149
|
+
bg.add([1, 2])
|
|
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
|
+
|
|
160
|
+
# Tendons
|
|
161
|
+
prop = engine.tendon.prop.create_in(
|
|
162
|
+
"15-10", mat_no=1, e_code="GBT5224_2014",
|
|
163
|
+
diameter=15.2, n_num=10, d_pipe=0.09
|
|
164
|
+
)
|
|
165
|
+
shape = engine.tendon.shape.create_arc3d(
|
|
166
|
+
"N1", n_num=2, prop="15-10",
|
|
167
|
+
element_group="Main Girder Elements", curve_name="curve1"
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
# Live loads
|
|
171
|
+
grade = engine.live.grade.create("Highway-Class I")
|
|
172
|
+
lane = engine.live.lane.create("Lane 1")
|
|
173
|
+
case = engine.live.case.create("Live Load Case 1")
|
|
174
|
+
```
|
|
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
|
+
|
|
214
|
+
### Data Class Objects
|
|
215
|
+
|
|
216
|
+
Create and query operations return data class objects (dataclass) instead of raw dictionaries:
|
|
217
|
+
|
|
218
|
+
```python
|
|
219
|
+
elem = engine.element.get(1)
|
|
220
|
+
print(elem.no) # ID
|
|
221
|
+
print(elem.node_vec) # Node list
|
|
222
|
+
print(elem.mat) # Material ID
|
|
223
|
+
|
|
224
|
+
# Objects support operations (operations下沉 to object)
|
|
225
|
+
lc = engine.load.get("Self-weight")
|
|
226
|
+
lc.create_gravity()
|
|
227
|
+
lc.create_nforce(1, dFx=1000)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Explicit Numbering
|
|
231
|
+
|
|
232
|
+
Some `create_*` functions support explicit numbering via the `no` parameter. If not specified, the number is automatically assigned:
|
|
233
|
+
|
|
234
|
+
```python
|
|
235
|
+
# Auto-assigned number
|
|
236
|
+
sec = engine.section.create_circle("Section 1", d=0.5)
|
|
237
|
+
|
|
238
|
+
# Explicit number
|
|
239
|
+
sec = engine.section.create_circle("Section 1", d=0.5, no=100)
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Result Export
|
|
243
|
+
|
|
244
|
+
After solving, you can export various analysis results using `engine.result`. All export methods return pandas DataFrames:
|
|
245
|
+
|
|
246
|
+
```python
|
|
247
|
+
# Export load case results (element forces)
|
|
248
|
+
df = engine.result.loadcase("Self-weight", "LCEF")
|
|
249
|
+
|
|
250
|
+
# Export envelope results (element forces)
|
|
251
|
+
df = engine.result.env("Basic Combination Envelope", "EnvEF")
|
|
252
|
+
|
|
253
|
+
# Export design check results
|
|
254
|
+
df = engine.result.check(
|
|
255
|
+
"混凝土", "正截面抗弯验算", "Basic Combination"
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
# Batch export all check results from Check folder
|
|
259
|
+
results = engine.result.check_all()
|
|
260
|
+
for name, df in results.items():
|
|
261
|
+
print(f"{name}: {len(df)} rows")
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Supported result types:
|
|
265
|
+
- **Load case**: `LCEF` (element force), `LCED` (element displacement), `LCND` (node displacement), `LCBF` (boundary reaction), `LCTL` (tendon loss), `LCS` (element stress)
|
|
266
|
+
- **Envelope**: `EnvBF` (boundary reaction), `EnvEF` (element force), `EnvES` (element strain), `EnvS` (element stress), `EnvND` (node displacement)
|
|
267
|
+
|
|
268
|
+
Requires `pandas` to be installed: `pip install pandas`
|
|
269
|
+
|
|
270
|
+
## Complete Example
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
from pyosis.core.engine import OSISEngine
|
|
274
|
+
|
|
275
|
+
engine = OSISEngine()
|
|
276
|
+
engine.clear()
|
|
277
|
+
|
|
278
|
+
# Control parameters
|
|
279
|
+
engine.control.set_gravity_acceleration(9.8066)
|
|
280
|
+
engine.control.set_calc_tendon(True)
|
|
281
|
+
engine.control.set_calc_concurrent_force(True)
|
|
282
|
+
engine.control.set_calc_shrink(True)
|
|
283
|
+
engine.control.set_calc_creep(True)
|
|
284
|
+
engine.control.set_calc_shear(True)
|
|
285
|
+
engine.control.set_calc_relaxation(True)
|
|
286
|
+
engine.control.set_mod_loc_coor(False)
|
|
287
|
+
engine.control.set_inc_tendon(True)
|
|
288
|
+
engine.control.set_nonlinear(geom=False, link=False)
|
|
289
|
+
|
|
290
|
+
# Sections
|
|
291
|
+
engine.section.create_circle("Circle Section 1", d=0.219, tw=0.012, no=1)
|
|
292
|
+
engine.section.create_circle("Circle Section 2", d=0.180, tw=0.008, no=2)
|
|
293
|
+
|
|
294
|
+
# Materials
|
|
295
|
+
engine.material.create_steel(
|
|
296
|
+
"Steel 1", eCode="JTGD64_2015", eGrade="Q345", dDmp=0.05, no=1
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
# Nodes
|
|
300
|
+
engine.node.create(0, 5, 0, no=1)
|
|
301
|
+
engine.node.create(15, 5, 0, no=2)
|
|
302
|
+
engine.node.create(7.5, 0, 0, no=3)
|
|
303
|
+
engine.node.create(20, 0, 0, no=4)
|
|
304
|
+
|
|
305
|
+
# Elements
|
|
306
|
+
engine.element.create_beam3d(1, 3, nMat=1, nSec1=1, nSec2=1, no=1)
|
|
307
|
+
engine.element.create_beam3d(2, 3, nMat=1, nSec1=2, nSec2=2, no=2)
|
|
308
|
+
|
|
309
|
+
# Boundaries
|
|
310
|
+
engine.boundary.create_general(no=1)
|
|
311
|
+
engine.boundary.get(1).assign("a", [1, 2])
|
|
312
|
+
|
|
313
|
+
# Loads
|
|
314
|
+
lc = engine.load.create(
|
|
315
|
+
"Custom Load Case 1",
|
|
316
|
+
load_case_type="USER",
|
|
317
|
+
prompt="Two forces applied at nodes 3 and 4"
|
|
318
|
+
)
|
|
319
|
+
lc.create_nforce(3, dFx=0, dFy=-1000000, dFz=0)
|
|
320
|
+
lc.create_nforce(4, dFx=200000, dFy=0, dFz=0)
|
|
321
|
+
|
|
322
|
+
# Solve
|
|
323
|
+
engine.solve()
|
|
324
|
+
```
|
|
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
|
+
## More Resources
|
|
334
|
+
|
|
335
|
+
- [tests/](tests/): Example code for each module
|
|
336
|
+
- [templetes/](templetes/): Complete bridge modeling template projects
|