osis-python 0.6.2__tar.gz → 0.6.4__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.6.2/src/osis_python.egg-info → osis_python-0.6.4}/PKG-INFO +25 -25
- {osis_python-0.6.2 → osis_python-0.6.4}/README.md +24 -24
- {osis_python-0.6.2 → osis_python-0.6.4/src/osis_python.egg-info}/PKG-INFO +25 -25
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/__init__.py +1 -1
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/boundary/manager.py +8 -8
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/display/interface.py +26 -1
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/display/manager.py +48 -7
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/element/manager.py +51 -51
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/property/component_thickness.py +4 -1
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/property/manager.py +4 -1
- {osis_python-0.6.2 → osis_python-0.6.4}/LICENSE +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/pyproject.toml +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/setup.cfg +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/osis_python.egg-info/SOURCES.txt +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/osis_python.egg-info/dependency_links.txt +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/osis_python.egg-info/requires.txt +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/osis_python.egg-info/top_level.txt +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/boundary/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/boundary/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/control/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/control/control.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/control/io.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/control/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/control/nonlinear.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/all_func.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/apdl_sync.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/basic_manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/build.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/client.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/command.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/engine.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/exceptions.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/references.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/solver.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/core/sync_apdl_cli.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/display/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/dynamic/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/dynamic/load_to_mass.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/dynamic/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/dynamic/modal.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/dynamic/seismic.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/element/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/element/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/general/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/general/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/geometry/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/geometry/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/geometry/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/live/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/live/analysis.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/live/grade.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/live/lane.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/live/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/load/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/load/loadcase.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/load/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/load/static.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/load/tendon.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/material/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/material/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/material/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/node/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/node/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/node/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/post/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/post/combine.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/post/design_check.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/post/display.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/post/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/project/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/project/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/project/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/property/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/property/coordinate.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/property/creep_shrink.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/property/damping.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/property/pu_curve.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/quick_building/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/quick_building/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/result/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/result/check.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/result/env.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/result/loadcase.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/result/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/result/result.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/common.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/composite.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/numeric.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/param.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/rebar.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/rib.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/section/steel.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/settlement/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/settlement/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/settlement/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/stability/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/stability/buckling.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/stability/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/stage/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/stage/define.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/stage/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/stage/overall.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/thickness/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/thickness/interface.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/thickness/manager.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/transfer/__init__.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/transfer/generator.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/transfer/matrix.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/transfer/out_to_python.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/transfer/parser.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/transfer/routes.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/src/pyosis/transfer/split.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/tests/test_delete_occupied.py +0 -0
- {osis_python-0.6.2 → osis_python-0.6.4}/tests/test_project_manager.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
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
|
|
@@ -88,7 +88,7 @@ n2 = engine.node.create(no=2, x=15, y=0, z=0)
|
|
|
88
88
|
|
|
89
89
|
# Create elements
|
|
90
90
|
elem = engine.element.create_beam3d(
|
|
91
|
-
no=1, node1=n1.no, node2=n2.no,
|
|
91
|
+
no=1, node1=n1.no, node2=n2.no, mat=mat.no, sec1=sec.no, sec2=sec.no
|
|
92
92
|
)
|
|
93
93
|
|
|
94
94
|
# Create boundaries
|
|
@@ -136,7 +136,7 @@ from pyosis.material import material_manager
|
|
|
136
136
|
from pyosis.node import node_manager
|
|
137
137
|
|
|
138
138
|
mat = material_manager.create_conc(no=1, name="C30", code="JTG3362_2018", grade="C30")
|
|
139
|
-
node = node_manager.create(0, 0, 0)
|
|
139
|
+
node = node_manager.create(no=None, x=0, y=0, z=0)
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
### 4. Using OSISSolver — Start the Solver Directly (Solver-Only Mode)
|
|
@@ -208,8 +208,8 @@ engine.boundary.group.create("AbutmentBoundaries", "a", "1to2")
|
|
|
208
208
|
|
|
209
209
|
# Various boundary types
|
|
210
210
|
engine.boundary.create_general(no=1, x=1, y=1, z=1, rx=1, ry=1, rz=1, rw=1) # General support
|
|
211
|
-
engine.boundary.create_master_slave(no=1, node=1, dx=1, dy=1, dz=1, rx=0, ry=1, rz=1, coincident=
|
|
212
|
-
engine.boundary.create_rigid(no=1,
|
|
211
|
+
engine.boundary.create_master_slave(no=1, node=1, dx=1, dy=1, dz=1, rx=0, ry=1, rz=1, coincident=1) # Master-slave
|
|
212
|
+
engine.boundary.create_rigid(no=1, node_i=1) # Rigid link
|
|
213
213
|
engine.boundary.create_elstcspt(no=1, coor="", x=0, dx=1e9, y=0, dy=1e9, z=0, dz=1e9) # Elastic support
|
|
214
214
|
|
|
215
215
|
# Tendons
|
|
@@ -260,12 +260,12 @@ engine.prop.creep_shrink.create(no=1, name="Creep1", avg_humidity=70.0,
|
|
|
260
260
|
# Damping (Rayleigh 自定义系数)
|
|
261
261
|
engine.prop.damping.create_rayleigh_custom(name="Damping1", alpha=0.05, beta=0.005)
|
|
262
262
|
|
|
263
|
-
# P-U curve (no, name, curve_type, num, values)
|
|
264
|
-
# curve_type: 1
|
|
265
|
-
engine.prop.pu_curve.create(
|
|
263
|
+
# P-U curve (no, name, curve_type, num, *values)
|
|
264
|
+
# curve_type: 0 = force, 1 = moment
|
|
265
|
+
engine.prop.pu_curve.create(1, "PU1", 1, 3, 0, 0.01, 1000, 0.02, 1500)
|
|
266
266
|
|
|
267
267
|
# Element thickness assignment (thickness, op, *elems)
|
|
268
|
-
engine.prop.assign_component_thickness(
|
|
268
|
+
engine.prop.assign_component_thickness(0.3, "a", 1)
|
|
269
269
|
|
|
270
270
|
# Shell thickness (no, in_plane, out_plane)
|
|
271
271
|
engine.thickness.create(no=1, in_plane=0.3, out_plane=0.3)
|
|
@@ -277,13 +277,13 @@ The `GeometryManager` supports querying geometric entities:
|
|
|
277
277
|
|
|
278
278
|
```python
|
|
279
279
|
# Get all splines
|
|
280
|
-
splines = engine.geometry.all(
|
|
280
|
+
splines = engine.geometry.all()
|
|
281
281
|
|
|
282
282
|
# Get a specific spline
|
|
283
|
-
spline = engine.geometry.get("
|
|
283
|
+
spline = engine.geometry.get("curve1")
|
|
284
284
|
|
|
285
|
-
# Filter by type
|
|
286
|
-
arcs = engine.geometry.
|
|
285
|
+
# Filter by type (General / Natural / Arc3D / Arc2D)
|
|
286
|
+
arcs = [s for s in engine.geometry.all() if s.spline_type.name == "Arc3D"]
|
|
287
287
|
```
|
|
288
288
|
|
|
289
289
|
### Data Class Objects
|
|
@@ -299,7 +299,7 @@ print(elem.mat) # Material ID
|
|
|
299
299
|
# Objects support operations (operations下沉 to object)
|
|
300
300
|
lc = engine.load.get("Self-weight")
|
|
301
301
|
lc.create_gravity()
|
|
302
|
-
lc.create_nforce(1,
|
|
302
|
+
lc.create_nforce(1, fx=1000)
|
|
303
303
|
```
|
|
304
304
|
|
|
305
305
|
### Explicit Numbering
|
|
@@ -363,23 +363,23 @@ engine.control.set_inc_tendon(True)
|
|
|
363
363
|
engine.control.set_nonlinear(geom=False, link=False)
|
|
364
364
|
|
|
365
365
|
# Sections
|
|
366
|
-
engine.section.create_circle("CircleSection1", d=0.219, tw=0.012
|
|
367
|
-
engine.section.create_circle("CircleSection2", d=0.180, tw=0.008
|
|
366
|
+
engine.section.create_circle(no=1, name="CircleSection1", d=0.219, tw=0.012)
|
|
367
|
+
engine.section.create_circle(no=2, name="CircleSection2", d=0.180, tw=0.008)
|
|
368
368
|
|
|
369
369
|
# Materials
|
|
370
370
|
engine.material.create_steel(
|
|
371
|
-
"Steel1", code="JTGD64_2015", grade="Q345", dmp=0.05
|
|
371
|
+
no=1, name="Steel1", code="JTGD64_2015", grade="Q345", dmp=0.05
|
|
372
372
|
)
|
|
373
373
|
|
|
374
374
|
# Nodes
|
|
375
|
-
engine.node.create(0, 5, 0
|
|
376
|
-
engine.node.create(15, 5, 0
|
|
377
|
-
engine.node.create(7.5, 0, 0
|
|
378
|
-
engine.node.create(
|
|
375
|
+
engine.node.create(no=1, x=0, y=5, z=0)
|
|
376
|
+
engine.node.create(no=2, x=15, y=5, z=0)
|
|
377
|
+
engine.node.create(no=3, x=7.5, y=0, z=0)
|
|
378
|
+
engine.node.create(no=4, x=20, y=0, z=0)
|
|
379
379
|
|
|
380
380
|
# Elements
|
|
381
|
-
engine.element.create_beam3d(1,
|
|
382
|
-
engine.element.create_beam3d(2,
|
|
381
|
+
engine.element.create_beam3d(no=1, node1=1, node2=3, mat=1, sec1=1, sec2=1)
|
|
382
|
+
engine.element.create_beam3d(no=2, node1=2, node2=3, mat=1, sec1=2, sec2=2)
|
|
383
383
|
|
|
384
384
|
# Boundaries
|
|
385
385
|
engine.boundary.create_general(no=1)
|
|
@@ -391,8 +391,8 @@ lc = engine.load.create(
|
|
|
391
391
|
load_case_type="USER",
|
|
392
392
|
prompt="Two forces applied at nodes 3 and 4"
|
|
393
393
|
)
|
|
394
|
-
lc.create_nforce(3,
|
|
395
|
-
lc.create_nforce(4,
|
|
394
|
+
lc.create_nforce(3, fx=0, fy=-1000000, fz=0)
|
|
395
|
+
lc.create_nforce(4, fx=200000, fy=0, fz=0)
|
|
396
396
|
|
|
397
397
|
# Solve
|
|
398
398
|
engine.solve()
|
|
@@ -57,7 +57,7 @@ n2 = engine.node.create(no=2, x=15, y=0, z=0)
|
|
|
57
57
|
|
|
58
58
|
# Create elements
|
|
59
59
|
elem = engine.element.create_beam3d(
|
|
60
|
-
no=1, node1=n1.no, node2=n2.no,
|
|
60
|
+
no=1, node1=n1.no, node2=n2.no, mat=mat.no, sec1=sec.no, sec2=sec.no
|
|
61
61
|
)
|
|
62
62
|
|
|
63
63
|
# Create boundaries
|
|
@@ -105,7 +105,7 @@ from pyosis.material import material_manager
|
|
|
105
105
|
from pyosis.node import node_manager
|
|
106
106
|
|
|
107
107
|
mat = material_manager.create_conc(no=1, name="C30", code="JTG3362_2018", grade="C30")
|
|
108
|
-
node = node_manager.create(0, 0, 0)
|
|
108
|
+
node = node_manager.create(no=None, x=0, y=0, z=0)
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
### 4. Using OSISSolver — Start the Solver Directly (Solver-Only Mode)
|
|
@@ -177,8 +177,8 @@ engine.boundary.group.create("AbutmentBoundaries", "a", "1to2")
|
|
|
177
177
|
|
|
178
178
|
# Various boundary types
|
|
179
179
|
engine.boundary.create_general(no=1, x=1, y=1, z=1, rx=1, ry=1, rz=1, rw=1) # General support
|
|
180
|
-
engine.boundary.create_master_slave(no=1, node=1, dx=1, dy=1, dz=1, rx=0, ry=1, rz=1, coincident=
|
|
181
|
-
engine.boundary.create_rigid(no=1,
|
|
180
|
+
engine.boundary.create_master_slave(no=1, node=1, dx=1, dy=1, dz=1, rx=0, ry=1, rz=1, coincident=1) # Master-slave
|
|
181
|
+
engine.boundary.create_rigid(no=1, node_i=1) # Rigid link
|
|
182
182
|
engine.boundary.create_elstcspt(no=1, coor="", x=0, dx=1e9, y=0, dy=1e9, z=0, dz=1e9) # Elastic support
|
|
183
183
|
|
|
184
184
|
# Tendons
|
|
@@ -229,12 +229,12 @@ engine.prop.creep_shrink.create(no=1, name="Creep1", avg_humidity=70.0,
|
|
|
229
229
|
# Damping (Rayleigh 自定义系数)
|
|
230
230
|
engine.prop.damping.create_rayleigh_custom(name="Damping1", alpha=0.05, beta=0.005)
|
|
231
231
|
|
|
232
|
-
# P-U curve (no, name, curve_type, num, values)
|
|
233
|
-
# curve_type: 1
|
|
234
|
-
engine.prop.pu_curve.create(
|
|
232
|
+
# P-U curve (no, name, curve_type, num, *values)
|
|
233
|
+
# curve_type: 0 = force, 1 = moment
|
|
234
|
+
engine.prop.pu_curve.create(1, "PU1", 1, 3, 0, 0.01, 1000, 0.02, 1500)
|
|
235
235
|
|
|
236
236
|
# Element thickness assignment (thickness, op, *elems)
|
|
237
|
-
engine.prop.assign_component_thickness(
|
|
237
|
+
engine.prop.assign_component_thickness(0.3, "a", 1)
|
|
238
238
|
|
|
239
239
|
# Shell thickness (no, in_plane, out_plane)
|
|
240
240
|
engine.thickness.create(no=1, in_plane=0.3, out_plane=0.3)
|
|
@@ -246,13 +246,13 @@ The `GeometryManager` supports querying geometric entities:
|
|
|
246
246
|
|
|
247
247
|
```python
|
|
248
248
|
# Get all splines
|
|
249
|
-
splines = engine.geometry.all(
|
|
249
|
+
splines = engine.geometry.all()
|
|
250
250
|
|
|
251
251
|
# Get a specific spline
|
|
252
|
-
spline = engine.geometry.get("
|
|
252
|
+
spline = engine.geometry.get("curve1")
|
|
253
253
|
|
|
254
|
-
# Filter by type
|
|
255
|
-
arcs = engine.geometry.
|
|
254
|
+
# Filter by type (General / Natural / Arc3D / Arc2D)
|
|
255
|
+
arcs = [s for s in engine.geometry.all() if s.spline_type.name == "Arc3D"]
|
|
256
256
|
```
|
|
257
257
|
|
|
258
258
|
### Data Class Objects
|
|
@@ -268,7 +268,7 @@ print(elem.mat) # Material ID
|
|
|
268
268
|
# Objects support operations (operations下沉 to object)
|
|
269
269
|
lc = engine.load.get("Self-weight")
|
|
270
270
|
lc.create_gravity()
|
|
271
|
-
lc.create_nforce(1,
|
|
271
|
+
lc.create_nforce(1, fx=1000)
|
|
272
272
|
```
|
|
273
273
|
|
|
274
274
|
### Explicit Numbering
|
|
@@ -332,23 +332,23 @@ engine.control.set_inc_tendon(True)
|
|
|
332
332
|
engine.control.set_nonlinear(geom=False, link=False)
|
|
333
333
|
|
|
334
334
|
# Sections
|
|
335
|
-
engine.section.create_circle("CircleSection1", d=0.219, tw=0.012
|
|
336
|
-
engine.section.create_circle("CircleSection2", d=0.180, tw=0.008
|
|
335
|
+
engine.section.create_circle(no=1, name="CircleSection1", d=0.219, tw=0.012)
|
|
336
|
+
engine.section.create_circle(no=2, name="CircleSection2", d=0.180, tw=0.008)
|
|
337
337
|
|
|
338
338
|
# Materials
|
|
339
339
|
engine.material.create_steel(
|
|
340
|
-
"Steel1", code="JTGD64_2015", grade="Q345", dmp=0.05
|
|
340
|
+
no=1, name="Steel1", code="JTGD64_2015", grade="Q345", dmp=0.05
|
|
341
341
|
)
|
|
342
342
|
|
|
343
343
|
# Nodes
|
|
344
|
-
engine.node.create(0, 5, 0
|
|
345
|
-
engine.node.create(15, 5, 0
|
|
346
|
-
engine.node.create(7.5, 0, 0
|
|
347
|
-
engine.node.create(
|
|
344
|
+
engine.node.create(no=1, x=0, y=5, z=0)
|
|
345
|
+
engine.node.create(no=2, x=15, y=5, z=0)
|
|
346
|
+
engine.node.create(no=3, x=7.5, y=0, z=0)
|
|
347
|
+
engine.node.create(no=4, x=20, y=0, z=0)
|
|
348
348
|
|
|
349
349
|
# Elements
|
|
350
|
-
engine.element.create_beam3d(1,
|
|
351
|
-
engine.element.create_beam3d(2,
|
|
350
|
+
engine.element.create_beam3d(no=1, node1=1, node2=3, mat=1, sec1=1, sec2=1)
|
|
351
|
+
engine.element.create_beam3d(no=2, node1=2, node2=3, mat=1, sec1=2, sec2=2)
|
|
352
352
|
|
|
353
353
|
# Boundaries
|
|
354
354
|
engine.boundary.create_general(no=1)
|
|
@@ -360,8 +360,8 @@ lc = engine.load.create(
|
|
|
360
360
|
load_case_type="USER",
|
|
361
361
|
prompt="Two forces applied at nodes 3 and 4"
|
|
362
362
|
)
|
|
363
|
-
lc.create_nforce(3,
|
|
364
|
-
lc.create_nforce(4,
|
|
363
|
+
lc.create_nforce(3, fx=0, fy=-1000000, fz=0)
|
|
364
|
+
lc.create_nforce(4, fx=200000, fy=0, fz=0)
|
|
365
365
|
|
|
366
366
|
# Solve
|
|
367
367
|
engine.solve()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: osis-python
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
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
|
|
@@ -88,7 +88,7 @@ n2 = engine.node.create(no=2, x=15, y=0, z=0)
|
|
|
88
88
|
|
|
89
89
|
# Create elements
|
|
90
90
|
elem = engine.element.create_beam3d(
|
|
91
|
-
no=1, node1=n1.no, node2=n2.no,
|
|
91
|
+
no=1, node1=n1.no, node2=n2.no, mat=mat.no, sec1=sec.no, sec2=sec.no
|
|
92
92
|
)
|
|
93
93
|
|
|
94
94
|
# Create boundaries
|
|
@@ -136,7 +136,7 @@ from pyosis.material import material_manager
|
|
|
136
136
|
from pyosis.node import node_manager
|
|
137
137
|
|
|
138
138
|
mat = material_manager.create_conc(no=1, name="C30", code="JTG3362_2018", grade="C30")
|
|
139
|
-
node = node_manager.create(0, 0, 0)
|
|
139
|
+
node = node_manager.create(no=None, x=0, y=0, z=0)
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
### 4. Using OSISSolver — Start the Solver Directly (Solver-Only Mode)
|
|
@@ -208,8 +208,8 @@ engine.boundary.group.create("AbutmentBoundaries", "a", "1to2")
|
|
|
208
208
|
|
|
209
209
|
# Various boundary types
|
|
210
210
|
engine.boundary.create_general(no=1, x=1, y=1, z=1, rx=1, ry=1, rz=1, rw=1) # General support
|
|
211
|
-
engine.boundary.create_master_slave(no=1, node=1, dx=1, dy=1, dz=1, rx=0, ry=1, rz=1, coincident=
|
|
212
|
-
engine.boundary.create_rigid(no=1,
|
|
211
|
+
engine.boundary.create_master_slave(no=1, node=1, dx=1, dy=1, dz=1, rx=0, ry=1, rz=1, coincident=1) # Master-slave
|
|
212
|
+
engine.boundary.create_rigid(no=1, node_i=1) # Rigid link
|
|
213
213
|
engine.boundary.create_elstcspt(no=1, coor="", x=0, dx=1e9, y=0, dy=1e9, z=0, dz=1e9) # Elastic support
|
|
214
214
|
|
|
215
215
|
# Tendons
|
|
@@ -260,12 +260,12 @@ engine.prop.creep_shrink.create(no=1, name="Creep1", avg_humidity=70.0,
|
|
|
260
260
|
# Damping (Rayleigh 自定义系数)
|
|
261
261
|
engine.prop.damping.create_rayleigh_custom(name="Damping1", alpha=0.05, beta=0.005)
|
|
262
262
|
|
|
263
|
-
# P-U curve (no, name, curve_type, num, values)
|
|
264
|
-
# curve_type: 1
|
|
265
|
-
engine.prop.pu_curve.create(
|
|
263
|
+
# P-U curve (no, name, curve_type, num, *values)
|
|
264
|
+
# curve_type: 0 = force, 1 = moment
|
|
265
|
+
engine.prop.pu_curve.create(1, "PU1", 1, 3, 0, 0.01, 1000, 0.02, 1500)
|
|
266
266
|
|
|
267
267
|
# Element thickness assignment (thickness, op, *elems)
|
|
268
|
-
engine.prop.assign_component_thickness(
|
|
268
|
+
engine.prop.assign_component_thickness(0.3, "a", 1)
|
|
269
269
|
|
|
270
270
|
# Shell thickness (no, in_plane, out_plane)
|
|
271
271
|
engine.thickness.create(no=1, in_plane=0.3, out_plane=0.3)
|
|
@@ -277,13 +277,13 @@ The `GeometryManager` supports querying geometric entities:
|
|
|
277
277
|
|
|
278
278
|
```python
|
|
279
279
|
# Get all splines
|
|
280
|
-
splines = engine.geometry.all(
|
|
280
|
+
splines = engine.geometry.all()
|
|
281
281
|
|
|
282
282
|
# Get a specific spline
|
|
283
|
-
spline = engine.geometry.get("
|
|
283
|
+
spline = engine.geometry.get("curve1")
|
|
284
284
|
|
|
285
|
-
# Filter by type
|
|
286
|
-
arcs = engine.geometry.
|
|
285
|
+
# Filter by type (General / Natural / Arc3D / Arc2D)
|
|
286
|
+
arcs = [s for s in engine.geometry.all() if s.spline_type.name == "Arc3D"]
|
|
287
287
|
```
|
|
288
288
|
|
|
289
289
|
### Data Class Objects
|
|
@@ -299,7 +299,7 @@ print(elem.mat) # Material ID
|
|
|
299
299
|
# Objects support operations (operations下沉 to object)
|
|
300
300
|
lc = engine.load.get("Self-weight")
|
|
301
301
|
lc.create_gravity()
|
|
302
|
-
lc.create_nforce(1,
|
|
302
|
+
lc.create_nforce(1, fx=1000)
|
|
303
303
|
```
|
|
304
304
|
|
|
305
305
|
### Explicit Numbering
|
|
@@ -363,23 +363,23 @@ engine.control.set_inc_tendon(True)
|
|
|
363
363
|
engine.control.set_nonlinear(geom=False, link=False)
|
|
364
364
|
|
|
365
365
|
# Sections
|
|
366
|
-
engine.section.create_circle("CircleSection1", d=0.219, tw=0.012
|
|
367
|
-
engine.section.create_circle("CircleSection2", d=0.180, tw=0.008
|
|
366
|
+
engine.section.create_circle(no=1, name="CircleSection1", d=0.219, tw=0.012)
|
|
367
|
+
engine.section.create_circle(no=2, name="CircleSection2", d=0.180, tw=0.008)
|
|
368
368
|
|
|
369
369
|
# Materials
|
|
370
370
|
engine.material.create_steel(
|
|
371
|
-
"Steel1", code="JTGD64_2015", grade="Q345", dmp=0.05
|
|
371
|
+
no=1, name="Steel1", code="JTGD64_2015", grade="Q345", dmp=0.05
|
|
372
372
|
)
|
|
373
373
|
|
|
374
374
|
# Nodes
|
|
375
|
-
engine.node.create(0, 5, 0
|
|
376
|
-
engine.node.create(15, 5, 0
|
|
377
|
-
engine.node.create(7.5, 0, 0
|
|
378
|
-
engine.node.create(
|
|
375
|
+
engine.node.create(no=1, x=0, y=5, z=0)
|
|
376
|
+
engine.node.create(no=2, x=15, y=5, z=0)
|
|
377
|
+
engine.node.create(no=3, x=7.5, y=0, z=0)
|
|
378
|
+
engine.node.create(no=4, x=20, y=0, z=0)
|
|
379
379
|
|
|
380
380
|
# Elements
|
|
381
|
-
engine.element.create_beam3d(1,
|
|
382
|
-
engine.element.create_beam3d(2,
|
|
381
|
+
engine.element.create_beam3d(no=1, node1=1, node2=3, mat=1, sec1=1, sec2=1)
|
|
382
|
+
engine.element.create_beam3d(no=2, node1=2, node2=3, mat=1, sec1=2, sec2=2)
|
|
383
383
|
|
|
384
384
|
# Boundaries
|
|
385
385
|
engine.boundary.create_general(no=1)
|
|
@@ -391,8 +391,8 @@ lc = engine.load.create(
|
|
|
391
391
|
load_case_type="USER",
|
|
392
392
|
prompt="Two forces applied at nodes 3 and 4"
|
|
393
393
|
)
|
|
394
|
-
lc.create_nforce(3,
|
|
395
|
-
lc.create_nforce(4,
|
|
394
|
+
lc.create_nforce(3, fx=0, fy=-1000000, fz=0)
|
|
395
|
+
lc.create_nforce(4, fx=200000, fy=0, fz=0)
|
|
396
396
|
|
|
397
397
|
# Solve
|
|
398
398
|
engine.solve()
|
|
@@ -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.6.
|
|
10
|
+
__version__ = "0.6.4"
|
|
11
11
|
__author__ = "CCCC Highway Consultant Co. Ltd." # 中交公路规划设计院 - 工程技术研究中心 - lzh - wjh - myf
|
|
12
12
|
|
|
13
13
|
from .core.engine import OSISEngine
|
|
@@ -688,9 +688,9 @@ class BoundaryManager:
|
|
|
688
688
|
RuntimeError: 创建失败
|
|
689
689
|
|
|
690
690
|
Examples:
|
|
691
|
-
>>> boundary_manager.create(None, "GENERAL",
|
|
692
|
-
>>> boundary_manager.create(1, "MSTSLV",
|
|
693
|
-
>>> boundary_manager.create(2, "RIGID",
|
|
691
|
+
>>> boundary_manager.create(None, "GENERAL", x=1, y=1, z=1)
|
|
692
|
+
>>> boundary_manager.create(1, "MSTSLV", node=10)
|
|
693
|
+
>>> boundary_manager.create(2, "RIGID", node_i=5)
|
|
694
694
|
"""
|
|
695
695
|
_creator = {
|
|
696
696
|
"GENERAL": self.create_general,
|
|
@@ -973,26 +973,26 @@ class BoundaryManager:
|
|
|
973
973
|
def create_rigid(
|
|
974
974
|
self,
|
|
975
975
|
no: int | None,
|
|
976
|
-
|
|
976
|
+
node_i: int,
|
|
977
977
|
) -> Boundary:
|
|
978
978
|
'''创建刚性连接
|
|
979
979
|
|
|
980
|
-
将主节点
|
|
980
|
+
将主节点 node_i 与通过 assign 分配的从节点绑定为刚性区域,
|
|
981
981
|
刚性区域内所有节点的 6 个自由度保持完全一致。
|
|
982
982
|
|
|
983
983
|
Args:
|
|
984
984
|
no: 边界编号,None 时自动分配
|
|
985
|
-
|
|
985
|
+
node_i: 节点1编号(刚性区域的主节点)
|
|
986
986
|
|
|
987
987
|
Returns:
|
|
988
988
|
Boundary 对象
|
|
989
989
|
|
|
990
990
|
Notes:
|
|
991
|
-
用于形成刚性区域的从节点号
|
|
991
|
+
用于形成刚性区域的从节点号 node_j, node_k, ..., node_l 由 assign 方法定义。
|
|
992
992
|
'''
|
|
993
993
|
if no is None:
|
|
994
994
|
no = self._next_no()
|
|
995
|
-
ok, err = osis_boundary_rigid(no, "RIGID",
|
|
995
|
+
ok, err = osis_boundary_rigid(no, "RIGID", node_i)
|
|
996
996
|
if not ok:
|
|
997
997
|
raise RuntimeError(f"创建刚性连接 {no} 失败: {err}")
|
|
998
998
|
return self.get(no) # type: ignore[return-value]
|
|
@@ -60,6 +60,7 @@ def osis_disp_ctrl(
|
|
|
60
60
|
def osis_control(
|
|
61
61
|
eAction: str,
|
|
62
62
|
eArg: str | None = None,
|
|
63
|
+
*dValues,
|
|
63
64
|
):
|
|
64
65
|
"""视图 / 界面控制命令。
|
|
65
66
|
|
|
@@ -70,7 +71,9 @@ def osis_control(
|
|
|
70
71
|
* ``view`` = 切换视图方向(配合 eArg)
|
|
71
72
|
* 其他如 ``quickCreateModel`` 等
|
|
72
73
|
eArg (str | None): 子命令参数
|
|
73
|
-
* 当 eAction 为 ``view`` 时: ``standard`` / ``top`` / ``right`` /
|
|
74
|
+
* 当 eAction 为 ``view`` 时: ``standard`` / ``top`` / ``right`` /
|
|
75
|
+
``front`` / ``zoom`` / ``move``
|
|
76
|
+
dValues: 附加参数
|
|
74
77
|
|
|
75
78
|
Returns:
|
|
76
79
|
tuple (bool, str): 是否成功,失败原因
|
|
@@ -80,6 +83,7 @@ def osis_control(
|
|
|
80
83
|
>>> osis_control("view", "top")
|
|
81
84
|
>>> osis_control("view", "right")
|
|
82
85
|
>>> osis_control("view", "front")
|
|
86
|
+
>>> osis_control("view", "zoom", 0.8)
|
|
83
87
|
"""
|
|
84
88
|
pass
|
|
85
89
|
|
|
@@ -101,3 +105,24 @@ def osis_plsm(bFlag: Literal[0, 1] = 1):
|
|
|
101
105
|
>>> osis_plsm(0)
|
|
102
106
|
"""
|
|
103
107
|
pass
|
|
108
|
+
|
|
109
|
+
@REGISTRY.register("jpeg")
|
|
110
|
+
def osis_jpeg(path: str = "image"):
|
|
111
|
+
"""截图工具。
|
|
112
|
+
|
|
113
|
+
格式: ``jpeg,path``
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
path (str): 图片保存路径/文件名。文件扩展名固定为 ``.jpg``。
|
|
117
|
+
当仅传入文件名(不含目录分隔符)时,图片默认保存到
|
|
118
|
+
``<project_dir>/image/{path}.jpg``;
|
|
119
|
+
传入完整路径(如 ``D:\\reports\\fig1``)则保存到对应位置。
|
|
120
|
+
|
|
121
|
+
Returns:
|
|
122
|
+
tuple (bool, str): 是否成功,失败原因
|
|
123
|
+
|
|
124
|
+
Examples:
|
|
125
|
+
>>> osis_jpeg("IMG_盖梁裂缝宽度计算结果图")
|
|
126
|
+
>>> osis_jpeg(r"D:\\reports\\fig1")
|
|
127
|
+
"""
|
|
128
|
+
pass
|
|
@@ -15,7 +15,7 @@ from __future__ import annotations
|
|
|
15
15
|
|
|
16
16
|
from typing import Literal, Sequence, Union
|
|
17
17
|
|
|
18
|
-
from .interface import osis_control, osis_disp_ctrl, osis_plsm
|
|
18
|
+
from .interface import osis_control, osis_disp_ctrl, osis_plsm, osis_jpeg
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class DisplayManager:
|
|
@@ -55,28 +55,45 @@ class DisplayManager:
|
|
|
55
55
|
if not ok:
|
|
56
56
|
raise RuntimeError(f"显示控制失败: {err}")
|
|
57
57
|
|
|
58
|
-
def control(self, action: str, arg: str | None = None) -> None:
|
|
58
|
+
def control(self, action: str, arg: str | None = None, *values) -> None:
|
|
59
59
|
"""视图 / 界面控制(对应 ``/control,...``)。
|
|
60
60
|
|
|
61
61
|
Args:
|
|
62
62
|
action: 子命令,如 ``view``、``quickCreateModel``
|
|
63
|
-
arg: 子命令参数;``view`` 时为 ``standard`` / ``top`` / ``right`` /
|
|
63
|
+
arg: 子命令参数;``view`` 时为 ``standard`` / ``top`` / ``right`` /
|
|
64
|
+
``front`` / ``zoom`` / ``move``
|
|
65
|
+
*values: 附加参数。``view`` 子命令下:
|
|
66
|
+
* ``zoom``: 缩放系数(值越小模型越小)
|
|
67
|
+
* ``move``: (x, y) 像素偏移
|
|
64
68
|
|
|
65
69
|
Raises:
|
|
66
70
|
RuntimeError: 操作失败时抛出异常
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
>>> display_manager.control("view", "top")
|
|
74
|
+
>>> display_manager.control("view", "zoom", 0.8)
|
|
75
|
+
>>> display_manager.control("view", "move", 30, 10)
|
|
67
76
|
"""
|
|
68
|
-
ok, err = osis_control(action, arg)
|
|
77
|
+
ok, err = osis_control(action, arg, *values)
|
|
69
78
|
if not ok:
|
|
70
79
|
raise RuntimeError(f"界面控制失败: {err}")
|
|
71
80
|
|
|
72
81
|
def set_view(
|
|
73
82
|
self,
|
|
74
|
-
view: Literal["standard", "top", "right", "front"] = "standard",
|
|
83
|
+
view: Literal["standard", "top", "right", "front", "zoom", "move"] = "standard",
|
|
84
|
+
*values,
|
|
75
85
|
) -> None:
|
|
76
86
|
"""切换视图方向。
|
|
77
87
|
|
|
78
88
|
Args:
|
|
79
|
-
view:
|
|
89
|
+
view: 视图
|
|
90
|
+
* ``standard``: 标准视图
|
|
91
|
+
* ``top``: 俯视
|
|
92
|
+
* ``right``: 右视
|
|
93
|
+
* ``front``: 前视
|
|
94
|
+
* ``zoom``: 缩放(附加系数:值越小模型越小)
|
|
95
|
+
* ``move``: 平移(附加参数:x, y)
|
|
96
|
+
*values: ``zoom`` 时为缩放系数,``move`` 时为 x, y 像素偏移
|
|
80
97
|
|
|
81
98
|
Raises:
|
|
82
99
|
RuntimeError: 操作失败时抛出异常
|
|
@@ -84,8 +101,10 @@ class DisplayManager:
|
|
|
84
101
|
Examples:
|
|
85
102
|
>>> display_manager.set_view("top")
|
|
86
103
|
>>> display_manager.set_view("front")
|
|
104
|
+
>>> display_manager.set_view("zoom", 0.8)
|
|
105
|
+
>>> display_manager.set_view("move", 30, 10)
|
|
87
106
|
"""
|
|
88
|
-
self.control("view", view)
|
|
107
|
+
self.control("view", view, *values)
|
|
89
108
|
|
|
90
109
|
def set_plsm(self, enabled: Literal[0, 1] = 1) -> None:
|
|
91
110
|
"""显示开关(Plsm)。
|
|
@@ -104,6 +123,28 @@ class DisplayManager:
|
|
|
104
123
|
if not ok:
|
|
105
124
|
raise RuntimeError(f"设置 Plsm 失败: {err}")
|
|
106
125
|
|
|
126
|
+
def capture(self, path: str) -> None:
|
|
127
|
+
"""截图工具(对应 ``jpeg,...``)。
|
|
128
|
+
|
|
129
|
+
把当前画面截图保存到 ``path``。文件扩展名固定为 ``.jpg``。
|
|
130
|
+
若仅传入文件名(不含目录分隔符),图片默认保存到
|
|
131
|
+
``<project_dir>/image/{path}.jpg``;传入完整路径则保存到对应位置。
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
path: 图片保存路径或文件名
|
|
135
|
+
|
|
136
|
+
Raises:
|
|
137
|
+
RuntimeError: 截图失败时抛出异常
|
|
138
|
+
|
|
139
|
+
Examples:
|
|
140
|
+
>>> display_manager.capture("D:\\reports\\fig1.jpg")
|
|
141
|
+
>>> display_manager.capture("crack.jpg") # 保存到 <project_dir>/image/crack.jpg
|
|
142
|
+
>>> display_manager.capture("crack") # 保存到 <project_dir>/image/crack.jpg
|
|
143
|
+
"""
|
|
144
|
+
ok, err = osis_jpeg(path)
|
|
145
|
+
if not ok:
|
|
146
|
+
raise RuntimeError(f"截图失败: {err}")
|
|
147
|
+
|
|
107
148
|
def __repr__(self) -> str:
|
|
108
149
|
return "DisplayManager()"
|
|
109
150
|
|
|
@@ -553,7 +553,7 @@ class ElementManager:
|
|
|
553
553
|
|
|
554
554
|
用法:
|
|
555
555
|
>>> from pyosis.element import element_manager
|
|
556
|
-
>>> elem = element_manager.create_beam3d(1, 2,
|
|
556
|
+
>>> elem = element_manager.create_beam3d(1, 2, mat=1, sec1=1, sec2=1)
|
|
557
557
|
>>> elem.no
|
|
558
558
|
>>> elem.element_type
|
|
559
559
|
>>> all_elems = element_manager.all()
|
|
@@ -616,7 +616,7 @@ class ElementManager:
|
|
|
616
616
|
RuntimeError: 创建失败
|
|
617
617
|
|
|
618
618
|
Examples:
|
|
619
|
-
>>> element_manager.create(None, "BEAM3D", 1, 2,
|
|
619
|
+
>>> element_manager.create(None, "BEAM3D", 1, 2, mat=1, sec1=1, sec2=1)
|
|
620
620
|
>>> element_manager.create(10, "TRUSS", 1, 2, 1, 1, 1)
|
|
621
621
|
"""
|
|
622
622
|
_creator = {
|
|
@@ -638,15 +638,15 @@ class ElementManager:
|
|
|
638
638
|
no: int | None,
|
|
639
639
|
node1: int,
|
|
640
640
|
node2: int,
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
641
|
+
mat: int,
|
|
642
|
+
sec1: int,
|
|
643
|
+
sec2: int,
|
|
644
|
+
y_trans: Literal[1, 2, 3, 4] = 1,
|
|
645
|
+
z_trans: Literal[1, 2, 3, 4] = 1,
|
|
646
|
+
strain: float = 0.0,
|
|
647
|
+
flag: bool = 0,
|
|
648
|
+
theta: float = 0,
|
|
649
|
+
warping: bool = 0,
|
|
650
650
|
) -> Element:
|
|
651
651
|
'''创建梁柱单元
|
|
652
652
|
|
|
@@ -657,19 +657,19 @@ class ElementManager:
|
|
|
657
657
|
no: 单元编号,None 时自动分配
|
|
658
658
|
node1: 节点1编号
|
|
659
659
|
node2: 节点2编号
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
660
|
+
mat: 材料编号
|
|
661
|
+
sec1: I 端截面1编号
|
|
662
|
+
sec2: J 端截面2编号
|
|
663
|
+
y_trans: y 轴截面变化次方,可选值:1, 2, 3, 4
|
|
664
|
+
z_trans: z 轴截面变化次方,可选值:1, 2, 3, 4
|
|
665
|
+
strain: 应变值,默认为 0.0
|
|
666
|
+
flag: 轴向转角定义方式:
|
|
667
667
|
* 0: 使用 beta 角定义
|
|
668
668
|
* 1: 使用关键点定义
|
|
669
|
-
|
|
670
|
-
*
|
|
671
|
-
*
|
|
672
|
-
|
|
669
|
+
theta: 轴向转角参数:
|
|
670
|
+
* flag=0 时: 轴向转角(beta 角)
|
|
671
|
+
* flag=1 时: 关键点
|
|
672
|
+
warping: 翘曲效应标志:
|
|
673
673
|
* 1: 考虑翘曲
|
|
674
674
|
* 0: 不考虑翘曲
|
|
675
675
|
|
|
@@ -677,13 +677,13 @@ class ElementManager:
|
|
|
677
677
|
Element 对象
|
|
678
678
|
|
|
679
679
|
Examples:
|
|
680
|
-
>>> element_manager.create_beam3d(None, 1, 2,
|
|
680
|
+
>>> element_manager.create_beam3d(None, 1, 2, mat=1, sec1=1, sec2=1)
|
|
681
681
|
'''
|
|
682
682
|
if no is None:
|
|
683
683
|
no = self._next_no()
|
|
684
684
|
ok, err = osis_element_beam3d(
|
|
685
|
-
no, "BEAM3D", node1, node2,
|
|
686
|
-
|
|
685
|
+
no, "BEAM3D", node1, node2, mat, sec1, sec2,
|
|
686
|
+
y_trans, z_trans, strain, flag, theta, warping
|
|
687
687
|
)
|
|
688
688
|
if not ok:
|
|
689
689
|
raise RuntimeError(f"创建梁单元 {no} 失败: {err}")
|
|
@@ -694,10 +694,10 @@ class ElementManager:
|
|
|
694
694
|
no: int | None,
|
|
695
695
|
node1: int,
|
|
696
696
|
node2: int,
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
697
|
+
mat: int,
|
|
698
|
+
sec1: int,
|
|
699
|
+
sec2: int,
|
|
700
|
+
strain: float = 0.0,
|
|
701
701
|
) -> Element:
|
|
702
702
|
'''创建桁架单元
|
|
703
703
|
|
|
@@ -707,20 +707,20 @@ class ElementManager:
|
|
|
707
707
|
no: 单元编号,None 时自动分配
|
|
708
708
|
node1: 节点1编号
|
|
709
709
|
node2: 节点2编号
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
710
|
+
mat: 材料编号
|
|
711
|
+
sec1: I 端截面1编号
|
|
712
|
+
sec2: J 端截面2编号
|
|
713
|
+
strain: 应变值,默认为 0.0
|
|
714
714
|
|
|
715
715
|
Returns:
|
|
716
716
|
Element 对象
|
|
717
717
|
|
|
718
718
|
Examples:
|
|
719
|
-
>>> element_manager.create_truss(None, 1, 2,
|
|
719
|
+
>>> element_manager.create_truss(None, 1, 2, mat=1, sec1=1, sec2=1)
|
|
720
720
|
'''
|
|
721
721
|
if no is None:
|
|
722
722
|
no = self._next_no()
|
|
723
|
-
ok, err = osis_element_truss(no, "TRUSS", node1, node2,
|
|
723
|
+
ok, err = osis_element_truss(no, "TRUSS", node1, node2, mat, sec1, sec2, strain)
|
|
724
724
|
if not ok:
|
|
725
725
|
raise RuntimeError(f"创建桁架单元 {no} 失败: {err}")
|
|
726
726
|
return self.get(no) # type: ignore[return-value]
|
|
@@ -730,7 +730,7 @@ class ElementManager:
|
|
|
730
730
|
no: int | None,
|
|
731
731
|
node1: int,
|
|
732
732
|
node2: int,
|
|
733
|
-
|
|
733
|
+
is_linear: int = 1,
|
|
734
734
|
dx: float = 10,
|
|
735
735
|
dy: float = 10,
|
|
736
736
|
dz: float = 10,
|
|
@@ -747,39 +747,39 @@ class ElementManager:
|
|
|
747
747
|
no: 单元编号,None 时自动分配
|
|
748
748
|
node1: 节点1编号
|
|
749
749
|
node2: 节点2编号
|
|
750
|
-
|
|
750
|
+
is_linear: 弹簧类型标志:
|
|
751
751
|
* 1: 线性弹簧
|
|
752
752
|
* 0: 非线性弹簧
|
|
753
753
|
dx: x 方向自由度参数:
|
|
754
|
-
* 线性弹簧 (
|
|
755
|
-
* 非线性弹簧 (
|
|
754
|
+
* 线性弹簧 (is_linear=1): 局部坐标系下 dx 方向的刚度值
|
|
755
|
+
* 非线性弹簧 (is_linear=0): 局部坐标系下 dx 方向的力-位移曲线编号(PUCurve 定义)
|
|
756
756
|
dy: y 方向自由度参数:
|
|
757
|
-
* 线性弹簧 (
|
|
758
|
-
* 非线性弹簧 (
|
|
757
|
+
* 线性弹簧 (is_linear=1): 局部坐标系下 dy 方向的刚度值
|
|
758
|
+
* 非线性弹簧 (is_linear=0): 局部坐标系下 dy 方向的力-位移曲线编号(PUCurve 定义)
|
|
759
759
|
dz: z 方向自由度参数:
|
|
760
|
-
* 线性弹簧 (
|
|
761
|
-
* 非线性弹簧 (
|
|
760
|
+
* 线性弹簧 (is_linear=1): 局部坐标系下 dz 方向的刚度值
|
|
761
|
+
* 非线性弹簧 (is_linear=0): 局部坐标系下 dz 方向的力-位移曲线编号(PUCurve 定义)
|
|
762
762
|
rx: 绕 x 轴旋转自由度参数:
|
|
763
|
-
* 线性弹簧 (
|
|
764
|
-
* 非线性弹簧 (
|
|
763
|
+
* 线性弹簧 (is_linear=1): 局部坐标系下 rx 方向的刚度值
|
|
764
|
+
* 非线性弹簧 (is_linear=0): 局部坐标系下 rx 方向的力-位移曲线编号(PUCurve 定义)
|
|
765
765
|
ry: 绕 y 轴旋转自由度参数:
|
|
766
|
-
* 线性弹簧 (
|
|
767
|
-
* 非线性弹簧 (
|
|
766
|
+
* 线性弹簧 (is_linear=1): 局部坐标系下 ry 方向的刚度值
|
|
767
|
+
* 非线性弹簧 (is_linear=0): 局部坐标系下 ry 方向的力-位移曲线编号(PUCurve 定义)
|
|
768
768
|
rz: 绕 z 轴旋转自由度参数:
|
|
769
|
-
* 线性弹簧 (
|
|
770
|
-
* 非线性弹簧 (
|
|
769
|
+
* 线性弹簧 (is_linear=1): 局部坐标系下 rz 方向的刚度值
|
|
770
|
+
* 非线性弹簧 (is_linear=0): 局部坐标系下 rz 方向的力-位移曲线编号(PUCurve 定义)
|
|
771
771
|
beta: 轴向转角(beta 角),默认为 0.0
|
|
772
772
|
|
|
773
773
|
Returns:
|
|
774
774
|
Element 对象
|
|
775
775
|
|
|
776
776
|
Examples:
|
|
777
|
-
>>> element_manager.create_spring(None, 1, 2,
|
|
777
|
+
>>> element_manager.create_spring(None, 1, 2, is_linear=1)
|
|
778
778
|
'''
|
|
779
779
|
if no is None:
|
|
780
780
|
no = self._next_no()
|
|
781
781
|
ok, err = osis_element_spring(
|
|
782
|
-
no, "SPRING", node1, node2,
|
|
782
|
+
no, "SPRING", node1, node2, is_linear, dx, dy, dz, rx, ry, rz, beta
|
|
783
783
|
)
|
|
784
784
|
if not ok:
|
|
785
785
|
raise RuntimeError(f"创建弹簧单元 {no} 失败: {err}")
|
|
@@ -9,7 +9,10 @@ def osis_assign_component_thickness(dThickness: float, strOp: Literal['a', 's',
|
|
|
9
9
|
|
|
10
10
|
Args:
|
|
11
11
|
dThickness (float): 构件理论厚度
|
|
12
|
-
strOp (str):
|
|
12
|
+
strOp (str): 操作
|
|
13
|
+
* a = 添加,再次调用会覆盖旧参数
|
|
14
|
+
* s = 替换
|
|
15
|
+
* r = 移除
|
|
13
16
|
*strElem (str): 待分配单元的编号。注:定义、修改、删除 elem支持的格式:*to*
|
|
14
17
|
|
|
15
18
|
Returns:
|
|
@@ -890,11 +890,14 @@ class PropertyManager:
|
|
|
890
890
|
Args:
|
|
891
891
|
thickness (float): 构件理论厚度
|
|
892
892
|
op (str): 操作
|
|
893
|
-
* a =
|
|
893
|
+
* a = 添加,再次调用会覆盖旧参数
|
|
894
894
|
* s = 替换
|
|
895
895
|
* r = 移除
|
|
896
896
|
*elems (str|int): 待分配单元的编号。定义、修改、删除 elem 支持的格式:*to*
|
|
897
897
|
|
|
898
|
+
Examples:
|
|
899
|
+
>>> assign_component_thickness(0.2, s, 1, 2, 3) # 将 1 2 3号单元的厚度修改为 0.2
|
|
900
|
+
|
|
898
901
|
Raises:
|
|
899
902
|
RuntimeError: 分配失败时抛出
|
|
900
903
|
'''
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|