osis-python 0.7.7__py3-none-any.whl → 0.8.0__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: osis-python
3
- Version: 0.7.7
3
+ Version: 0.8.0
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
@@ -55,7 +55,7 @@ pip install osis-python -i https://pypi.org/simple
55
55
 
56
56
  - OSIS >= 5.1 (short-form command names like `N`/`Ele`/`Sec` are accepted by both the converter and runtime)
57
57
  - Python >= 3.8
58
- - **Solver-only mode** additionally requires the solver distribution that ships `PySolver.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
58
+ - **Solver-only mode** additionally requires the solver distribution that ships `osisSdk.dll` (e.g. `D:\OSIS_Solver\Rbin64`).
59
59
 
60
60
  > OSIS 5.1 HTTP server bug workaround: the `/OSIS_Run` command-stream splitter does not strip `//` line comments, so a comment line and the command that follows it are merged into one bad command. The pyosis `.out` converter already strips comments before sending; if you ever build a raw `.out` payload yourself, pre-process the file or use `osis_run()` through the generated `main.py`.
61
61
 
@@ -149,7 +149,7 @@ By default, `OSISEngine()` connects to an already-running OSIS GUI process. If y
149
149
  from pyosis.core.solver import OSISSolver
150
150
  from pyosis.core.engine import OSISEngine
151
151
 
152
- # Load <install>/PySolver.dll and start the HTTP server (default port 18080)
152
+ # Load <install>/osisSdk.dll and start the HTTP server (default port 18080)
153
153
  solver = OSISSolver(osis_install_path=r"D:\OSIS_Solver\Rbin64")
154
154
  engine = OSISEngine.from_solver(solver)
155
155
 
@@ -162,7 +162,8 @@ engine.solve()
162
162
 
163
163
  Notes on solver-only mode:
164
164
 
165
- - `osis_install_path` must be the directory containing `PySolver.dll` (and its dependency DLLs).
165
+ - `osis_install_path` must be the directory containing `osisSdk.dll` (and its dependency DLLs).
166
+ - `osis_init` validates a license file (`osis.lic`, HMAC-signed) before anything runs. Search order: the `OSIS_LICENSE_FILE` environment variable, then `%ProgramData%\OSIS\osis.lic`, then `osis.lic` in the install directory. Contact the OSIS vendor to obtain one.
166
167
  - The solver needs a project to exist before model commands run: call `engine.project.create()` / `open()` first.
167
168
  - Crash minidumps are written to `<install>\Error\dmp\` (created on startup).
168
169
 
@@ -1,14 +1,14 @@
1
- osis_python-0.7.7.dist-info/licenses/LICENSE,sha256=T4mkSYliXdU9mYe-NfHkqg6GPhzoYaIQO_a630UzpS4,1088
2
- pyosis/__init__.py,sha256=PwZ7FI6uNm_Z4VbsfGg14SObscbjJi2WJhHY5J8odWs,440
1
+ osis_python-0.8.0.dist-info/licenses/LICENSE,sha256=T4mkSYliXdU9mYe-NfHkqg6GPhzoYaIQO_a630UzpS4,1088
2
+ pyosis/__init__.py,sha256=eTE740oKVuI2f5Gb1OOGMmuWnYFc6kTOyActxwS14U0,440
3
3
  pyosis/boundary/__init__.py,sha256=W5LfF-jugWa-YI8pnfELZaz0pXLa-D8TiGnBn12HGGQ,102
4
4
  pyosis/boundary/interface.py,sha256=obqQUVFuQK9I7S8IaBZ2VBYfyXgNVBS0PQa9LzRlaAc,8990
5
- pyosis/boundary/manager.py,sha256=AAGdkp0sLV85enT9TQT9iqvWzjJyLzjiw0rC-tajSrI,39576
5
+ pyosis/boundary/manager.py,sha256=DotTkqDWoZw8ES4h4R0eheYrvQxb2gXHekSKpWftIOs,40474
6
6
  pyosis/control/__init__.py,sha256=98UAXB9Wkf93pGUKIjoGBBrSCblVeAwc_MXeaAB-UIA,119
7
7
  pyosis/control/control.py,sha256=4bX92TDJnf1D5A3YY7ZZrU7iUeAxKCjQe9z_F_SEHBs,2816
8
8
  pyosis/control/io.py,sha256=buaut3-W8kwJIe3PgjtgOU0JCSgDfOEd2cS3mxYsfuc,591
9
9
  pyosis/control/manager.py,sha256=EZEOlsgsg2rmOPIVjNFIdgwgxo9c0ZpKfjAr4wmx73Q,11610
10
10
  pyosis/control/nonlinear.py,sha256=26W_2GhD_0cn3YQxJjgbPR1oEopJWyuFWGlgx0q023I,1604
11
- pyosis/core/__init__.py,sha256=ZQ2WNmC4r8JTduK33j5iendyLb0UW3l0Sjr2qdcAjQs,696
11
+ pyosis/core/__init__.py,sha256=T7gaTtLWz8sPHB0s2T_GfCbpaFTwCXxTfEmecVyLR9A,1048
12
12
  pyosis/core/all_func.py,sha256=VhvAeMJMCQJ1redjqdkm7meTw1PJNDoRdmXXh2LzkVo,521
13
13
  pyosis/core/apdl_sync.py,sha256=SMBUwTdBCdQMQAPnC7gV1RS1Lp2XAVeHjQKEvFnkf54,5559
14
14
  pyosis/core/basic_manager.py,sha256=z3Qh5LpHg4AOyTrGffC09mPnW-yUT-UuhKnFe4GLUOM,7204
@@ -16,10 +16,12 @@ pyosis/core/batch.py,sha256=jPA9U3ahGRZdY8y1wCSZyVpBPmGOtQtvM3vfDgqM2sM,6851
16
16
  pyosis/core/client.py,sha256=_9NxTf1D_3BFgt7A73v5C-Qk3KORku_Sq85RnNi3ZxQ,4849
17
17
  pyosis/core/command.py,sha256=bZ5nS1wvwhjwIsogWQh5-1dAcbsJoyB8MR85WUprZ0s,8863
18
18
  pyosis/core/engine.py,sha256=ZAclt7GSIlZ8-DWH1Q9Tr7Jb4Jwza88-pNW4OiMCDCc,16880
19
+ pyosis/core/enums.py,sha256=qY1-A9smleQk_9VxDmd0k9cwggT6zI5I24HQhd2yTJY,11331
19
20
  pyosis/core/exceptions.py,sha256=x0I0Emooejy8wF1ZBWGz7Yc1N70MitsnhhQv9txJQj8,1093
21
+ pyosis/core/normalize.py,sha256=DB0OS63G-TOhdpGvOKPqJ2xyyKGuURDe_hPV2B5I0XI,1326
20
22
  pyosis/core/references.py,sha256=JQ8260aqVB5PhhGrqMt7W7fmrsmE69dFdrE6EyyLADg,2755
21
- pyosis/core/sdk.py,sha256=LXNftRkaPOtIUu51u3UmhcBy8BtA28z4DEO08aAzjFA,2489
22
- pyosis/core/solver.py,sha256=M7RZpGsQ17mOHJ4aKoXa2LnDlCEUM83vjzcMeA6JTTY,6014
23
+ pyosis/core/sdk.py,sha256=GL_Z8I66B4lqzB9K9JibG5TClqoo6uBaBMyTTlB981Y,2485
24
+ pyosis/core/solver.py,sha256=RmW7uJJkV-K18ArkNIW4C-GYlE5sAXE4Vi5rhjyMcvY,7105
23
25
  pyosis/core/sync_apdl_cli.py,sha256=xlRDhtR4fOebLvyVZT9joUp6Q0H55gIt0YDy9Cb4HB4,874
24
26
  pyosis/display/__init__.py,sha256=POxWZ8I5Qanj4ETpHBZMhXNOMlsLMYRamXwP_JjSDUo,161
25
27
  pyosis/display/interface.py,sha256=-ekocpi2DEieGrE34R_BjEGW3p6yZkXxlaxteT06XzE,3907
@@ -31,35 +33,36 @@ pyosis/dynamic/modal.py,sha256=__as3Nl7Ks2ntgcZwAA9UhvsvTfBl-1zSUOTsnPVf-Y,640
31
33
  pyosis/dynamic/seismic.py,sha256=8DIh7xkUgl0UwweDq4WoYSNzMxpLnpDaM4W_7u3rg_A,6380
32
34
  pyosis/element/__init__.py,sha256=fZgmxJiNhCe3Ki8vNEdZOhyinxwvlF6Jcu-DgD-c6YM,92
33
35
  pyosis/element/interface.py,sha256=xLd2ljq0qW5uvqV0Lo2e6Ly7NShh_p2I5vQNdcA8P4Q,9872
34
- pyosis/element/manager.py,sha256=YzJEmcs5sx8R-nfucneujouQtwm3o6vUo0CUEw-xing,36615
36
+ pyosis/element/manager.py,sha256=4LKbljGxBaZL-PcnqXA1Ei04_evAYxnDQma3XP-6HUY,39550
35
37
  pyosis/general/__init__.py,sha256=dyvge-GgUpT3BeDwm_Lss1xqNlxAQdt63WJ7QcuZ_O4,24
36
38
  pyosis/general/interface.py,sha256=YRXQ-iXYVhiUBiUd7fpA0NOtL5VSueOHcobj625aQeU,5382
37
39
  pyosis/geometry/__init__.py,sha256=mlAXlxaohcEcm8-6anyDo1fevh_IzYz2OXBn0_DIrCY,99
38
40
  pyosis/geometry/interface.py,sha256=OHpsFEgjQok8FXpsOXXbCxfe9PPF6ac2rU6fii91jkY,4444
39
- pyosis/geometry/manager.py,sha256=8sR4GJ6UXSEPM2_4eM6AFlWTj8RGuwmwm0OIT1hPFiQ,13698
40
- pyosis/live/__init__.py,sha256=jl0pMkfAGRnukwuCbc6fOJoWo-ufMnFm4lyBV-xQQxc,112
41
+ pyosis/geometry/manager.py,sha256=tfLXZd4eBT8y7F0tEVOXQY57xKzShqQ2iLt0h_QOto0,13454
42
+ pyosis/live/__init__.py,sha256=Y36H7paj8nbFBeT6a8shKzMQnxnsfJIRzjUvivuc7HA,165
41
43
  pyosis/live/analysis.py,sha256=sI0jE65KS2EylpmBbySNcGsUHvvk9-6SZ0-37ZXsmbk,5486
42
44
  pyosis/live/grade.py,sha256=GjFxV_FImMK_ahfB0DNePGwdifUbiFK8r-cSXlnrVP8,3774
43
45
  pyosis/live/lane.py,sha256=i1-mnKQuo_XLimtcX2ZV4PBC_A0FBneWxJU198X1MMc,5487
44
- pyosis/live/manager.py,sha256=q0w9RVfuwLUqPYo4CS8kc9NchyF7mCiczcrWEzD31NQ,49319
46
+ pyosis/live/manager.py,sha256=JBVeQF6DJY0uLfc74qnzlnTqyo-63IBHHzfSqqfInPg,51195
47
+ pyosis/live/vehicle.py,sha256=-0UasXdnqdcgwnNIdqZYLbKAizTN3IhG5hLlH_NV8yE,4428
45
48
  pyosis/load/__init__.py,sha256=AdCBsdf4QPVzbKwbj2C24Fnl9sPmlB9h542LjLFcqHM,135
46
49
  pyosis/load/loadcase.py,sha256=5DOty5OBtxHPguw_gYUqL3FFbXRkCjA2IVpCdAzJSJU,2457
47
- pyosis/load/manager.py,sha256=0pE04fb5FpsU9Dypu73cqBxSt4d-vYJs9HQIf0REVyQ,82137
50
+ pyosis/load/manager.py,sha256=tfanb5D4EKGL-EaWnajg4etNjqvUZOUO4hufZhLvmKQ,82957
48
51
  pyosis/load/static.py,sha256=vvwx5WmXUL-M3GvlH9GA-oaTZQmvLaawR76dFNVrwgc,22773
49
52
  pyosis/load/tendon.py,sha256=2AJxvYJU8PEJ-rH-vbLUjd0CwmhIeSFEx9asuWpT_0s,11528
50
53
  pyosis/material/__init__.py,sha256=W0oDx9SY_zngAcrMCO_0sF773-OxCfL1B-w2IeWlZ_g,79
51
54
  pyosis/material/interface.py,sha256=SiHWjLPUDR1f3EMObGlYQUlKgpfoh1VuGJgVAQfariA,5729
52
- pyosis/material/manager.py,sha256=2ZmrviYsD8b09CvMUyvCXrsPr6cfNYIquy-ep_Xgcw4,16790
55
+ pyosis/material/manager.py,sha256=4LlZ6B7ZWrmscru8cThxsZ7eKgTHGxbKSqAG9WLf8KA,17161
53
56
  pyosis/node/__init__.py,sha256=6BKMR_HhFuvf-wr_U1H4njEj95pqgiHh6ApFl2JWMQ0,71
54
57
  pyosis/node/interface.py,sha256=T0lL1pHD069Qw3PTxufUF6cJl9fAKiclAL_ISgboaz8,1208
55
- pyosis/node/manager.py,sha256=qqY1hIbIfK0NeAoimsqks0GCl32GVucGeKkcXa7bvnk,9578
58
+ pyosis/node/manager.py,sha256=pyCGHbIzAPaSKEseDOTBKlQbhz781y5h0jSH6UJH5qM,9598
56
59
  pyosis/post/__init__.py,sha256=Zh8Jvy6715tCZxwlTfV86-8cyh0OqqK2vCTlG_VARYY,120
57
60
  pyosis/post/combine.py,sha256=0EajaRAJK3d_rkW7t9Cmxc4wHM87TOBYroWnnBK2ldM,4587
58
61
  pyosis/post/design_check.py,sha256=vJzpu63yBjU4QDUIxvLOhUvqPrZ56q301ADCgHdu0eA,11257
59
62
  pyosis/post/display.py,sha256=BdoHetcM69Ez4s0-Zx3MreIcadxJPv2U2cx0E0PJTVw,2006
60
63
  pyosis/post/manager.py,sha256=wj0nGIqdlRhu9zqWxZAAhNAt9FB6vX0-hVtIYcdC6zU,19927
61
64
  pyosis/project/__init__.py,sha256=hYfnubp0bbHJK2tBBH12XDs3CeeO0d7whzILDxl4044,78
62
- pyosis/project/interface.py,sha256=Iiku4SsBlBkH216Hrb2E3VrqzHnoLW6tlGwxfFDwbpU,1522
65
+ pyosis/project/interface.py,sha256=BRJDSavAN7qx8HLnBTkmpw-TH0H8R6ZhTlp2npmXARI,1689
63
66
  pyosis/project/manager.py,sha256=II6NxEig5KJYzuPu3_70KadQ0HYu2TfbW338hZ23dEk,4095
64
67
  pyosis/property/__init__.py,sha256=xGdJItBRic3rd-6i5vyjGfA3KY-e9-WuOquIEnjPP_4,191
65
68
  pyosis/property/component_thickness.py,sha256=fH9jpt2V6w2lSL2jDb1cuk5wylfhvnznxZXObafxe44,794
@@ -70,17 +73,17 @@ pyosis/property/manager.py,sha256=7wHj0PC38hC42i0S36JDAeU8TUrjIQF0cubRgNUNpAI,33
70
73
  pyosis/property/pu_curve.py,sha256=E3oUfe7ERYKX6q9v1U-HnNP1LRbWobNYB8dUC26s8aQ,1534
71
74
  pyosis/quick_building/__init__.py,sha256=QiWapgiZk6pkAdiznKI0bVIc16UcFOIALQuLhupLkqw,48
72
75
  pyosis/quick_building/interface.py,sha256=xdQrORabxmnlhi537pspFokQBaXSmnZMIxA_kxSo_cE,13951
73
- pyosis/result/__init__.py,sha256=jfMtPk8RK72gPj87vDpUYmfG30XGvBOBms_taCKcqNo,289
76
+ pyosis/result/__init__.py,sha256=8mvkAeT6A9Sfn8R3fZuyLGZZPPAwaTAC3ikwN6TU7uo,336
74
77
  pyosis/result/check.py,sha256=CuPjCx54AQlg9oTM71tMbW7pTDfolkYPbpb9iOc7bIM,4922
75
78
  pyosis/result/env.py,sha256=PjvBpaZOPEjm4TVfolpQEssoXXtMSnMZ7dUmt9w3Glo,1425
76
- pyosis/result/headless.py,sha256=bTwjML7CMdtc8LKz5TronLaEVtc3WdZld_UofhNWtXA,4750
79
+ pyosis/result/headless.py,sha256=8P15401c57FikagnS4wl1PJb5NT9M071pl9Vj7BJooI,6654
77
80
  pyosis/result/loadcase.py,sha256=Z5tGpesD-8o_l1iS6tLn6u8aty3QtDNsyKXsbvbkOV4,2351
78
- pyosis/result/manager.py,sha256=APCryMMXo4W1eDuet3xikGy53LBLB7ZfjJFdyV1PrEI,12272
81
+ pyosis/result/manager.py,sha256=pFbdrBVAwjhsgTgBK0FCO8k2IlDgF3kUhH4bwySpbP4,13227
79
82
  pyosis/result/result.py,sha256=wUyRaHSwyijLpodWIHPFQVEOn6LP8MfYp7xLhC-RiIo,1194
80
83
  pyosis/section/__init__.py,sha256=VjNbQWgWHtLO6la39oXgbQMnQPR0-b1DPIM52Cj--jg,179
81
84
  pyosis/section/common.py,sha256=yI61YQH8btfkoBGnXF7wp3kFhZVW06XABIJZnvkDk3E,26616
82
85
  pyosis/section/composite.py,sha256=CWNcPagXbL4D8uUouRk8ux7Xv41bE2dXM8JfWX77pBI,9353
83
- pyosis/section/manager.py,sha256=eWGAKmjVpZ7YGrWQfbdGuILOi7Xy-a7phJLOIPzfwpU,95053
86
+ pyosis/section/manager.py,sha256=UYhp6f1Ro6lJALVP_UsY6Y01i7AO3xV-B3fce74RAMo,93629
84
87
  pyosis/section/numeric.py,sha256=lDO1KvSTmzBE56wkfDw5xxDhWi-kM0szXPx6CIymIyQ,1479
85
88
  pyosis/section/param.py,sha256=E4ZyJqyPn1xhNchb82ar6K36a_ah8R_66-FruOMlbBM,4944
86
89
  pyosis/section/rebar.py,sha256=9ibcOoMd7HYfzSaO6dMpZFwp1ugmwayOmDqIoWUijNc,8337
@@ -94,7 +97,7 @@ pyosis/stability/buckling.py,sha256=mlEDo8aduCuxlaawRHt8nCEERbP2cCp_8BHSYeQmFGw,
94
97
  pyosis/stability/manager.py,sha256=pNi07ulfQOFoDCc6FsfjYILUKFtHWWUNfiIJsCutgh4,8853
95
98
  pyosis/stage/__init__.py,sha256=TrNcvwQKki2SSwFkVsVcDA6EXATXaXRUorxRocn4HX8,94
96
99
  pyosis/stage/define.py,sha256=kfUbC_52ap3q48EblvH_DiwYFD5CjuT6AkC1a_Z5QEc,4023
97
- pyosis/stage/manager.py,sha256=REA9V22Iyqoy7SemsdyWphlyl-8hQBWnBqdsQVlkhbQ,12239
100
+ pyosis/stage/manager.py,sha256=M6krQs07T2wrGDpJBZq0jtiGKD8WJ0ydUfhHkxOn0U8,12242
98
101
  pyosis/stage/overall.py,sha256=OS0qbx8SKAN425pPTMetFaX4V-tXEZeTwK3Id5_nLuw,2170
99
102
  pyosis/thickness/__init__.py,sha256=YGYmUPc9TvAlw4eFuEjxaG7HjvwLQJelU_Mx2M6RhW0,82
100
103
  pyosis/thickness/interface.py,sha256=o9fwAnPtincBvNB7KZ-Cw67V4mSvoMYgcuLqD_FMLs0,1311
@@ -107,7 +110,7 @@ pyosis/transfer/out_to_python.py,sha256=69UnwkmkQiAZvpB0RLZqXlj9I0hItWgvTZRY5dWN
107
110
  pyosis/transfer/parser.py,sha256=R_aBlYJTe53hD1sX5PBv86bhj88NQwANFRN4pGYudQ8,6774
108
111
  pyosis/transfer/routes.py,sha256=fBHDt53F5YxNpttPwW_jm6bjxcW7T1P8WAiEv7Xn90E,12748
109
112
  pyosis/transfer/split.py,sha256=hpBe9D9WbjbKsovx4hM3X5RjTrruWNkuFmZt2ed0fME,1284
110
- osis_python-0.7.7.dist-info/METADATA,sha256=Dv7Zrp-C0Iuqorf9dfsZLH1i1X8Jjpx6NHJP8TReYr0,20180
111
- osis_python-0.7.7.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
112
- osis_python-0.7.7.dist-info/top_level.txt,sha256=6VDNySkQKwipRXcN8ayKVci4vAXi4oPyWLqFhNVcIfM,7
113
- osis_python-0.7.7.dist-info/RECORD,,
113
+ osis_python-0.8.0.dist-info/METADATA,sha256=oyyg_e4lH3Ezfg6FFSpKiIwWOU7ii6RYwKH00akUb30,20441
114
+ osis_python-0.8.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
115
+ osis_python-0.8.0.dist-info/top_level.txt,sha256=6VDNySkQKwipRXcN8ayKVci4vAXi4oPyWLqFhNVcIfM,7
116
+ osis_python-0.8.0.dist-info/RECORD,,
pyosis/__init__.py CHANGED
@@ -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.7.7"
10
+ __version__ = "0.8.0"
11
11
 
12
12
  from .core.engine import OSISEngine
13
13
  from .core.batch import batch, flush, batch_state, BatchError
@@ -9,23 +9,26 @@
9
9
  支持的边界类型:
10
10
  - GENERAL(一般边界,type=1)
11
11
  - MSTSLV(主从约束,type=2)
12
- - RELEASE(释放梁端约束,type=4)
13
- - ELSTCSPT(弹性支承,type=5)
14
- - GENERALELSTCSPT(一般弹性支承,type=6)
12
+ - RELEASE(释放梁端约束,type=3)
13
+ - ELSTCSPT(节点弹性支承,type=4)
14
+ - GENERALELSTCSPT(一般弹性支承,type=5)
15
15
 
16
- 注:截面特性调整(SECF)为独立功能,不属于边界类型
16
+ 其余类型(SECF=7 / GLINK=8 / UNISPT=9 / UNILNK=10 / LELNK=11 /
17
+ SOILSPRING=12 / SURFSPT=13)暂无专用数据类,_from_dict 落到基类 Boundary,
18
+ type_name 仍可正确取名。真实取值以 PrepEnum::Boundary 为准(见 core/enums.py)。
17
19
  """
18
20
 
19
21
  from __future__ import annotations
20
22
 
21
23
  from dataclasses import dataclass, field
22
24
  from typing import Any, Literal
23
- from enum import IntEnum
24
25
 
25
26
  from ..core.client import osis_client
26
27
  from ..core import get_references, raise_if_occupied
27
28
  from ..core.basic_manager import BasicManager
28
29
  from ..core.batch import batch_state
30
+ from ..core.enums import BoundaryType, boundary_type_name, constraints_to_dict
31
+ from ..core.normalize import as_no, as_name
29
32
  from .interface import (
30
33
  osis_boundary_general,
31
34
  osis_boundary_elstcspt,
@@ -40,21 +43,6 @@ from .interface import (
40
43
  )
41
44
 
42
45
 
43
- # ──────────────────────────────────────────────
44
- # 枚举类型
45
- # ──────────────────────────────────────────────
46
-
47
- class BoundaryType(IntEnum):
48
- """边界类型枚举"""
49
- UNASSIGNED = 0
50
- GENERAL = 1 # 一般支撑
51
- MSTSLV = 2 # 主从约束
52
- RELEASE = 3 # 释放梁端约束
53
- ELSTCSPT = 4 # 节点弹性支承
54
- GENERALELSTCSPT = 5 # 一般弹性支承
55
- RIGID = 6 # 刚性连接
56
-
57
-
58
46
  # ──────────────────────────────────────────────
59
47
  # 数据类
60
48
  # ──────────────────────────────────────────────
@@ -72,13 +60,18 @@ class Boundary:
72
60
  entity_vec: list[int] = field(default_factory=list)
73
61
  is_occupied: bool = False
74
62
  is_selected: bool = False
75
- is_ploted: bool = False
63
+ is_plotted: bool = False
64
+
65
+ @property
66
+ def type_name(self) -> str:
67
+ """边界类型名(与 OSIS 命令流一致,如 "GENERAL" / "ELSTCSPT")"""
68
+ return boundary_type_name(self.boundary_type.value)
76
69
 
77
70
  @classmethod
78
71
  def _from_dict(cls, d: dict) -> Boundary:
79
72
  """从接口 dict 构造 Boundary 对象(内部使用)"""
80
73
  raw_type = int(d.get("type"))
81
-
74
+
82
75
  # 根据类型创建具体子类
83
76
  if raw_type == BoundaryType.GENERAL:
84
77
  return GeneralBoundary._from_dict(d)
@@ -93,13 +86,13 @@ class Boundary:
93
86
  else:
94
87
  # 未知类型返回基类
95
88
  return cls(
96
- no=d.get("no"),
97
- name=d.get("name"),
89
+ no=as_no(d.get("no")),
90
+ name=as_name(d.get("name")),
98
91
  boundary_type=BoundaryType(raw_type) if raw_type in [t.value for t in BoundaryType] else BoundaryType.GENERAL,
99
- entity_vec=list(d.get("entityVec")),
92
+ entity_vec=list(d.get("entityVec") or []),
100
93
  is_occupied=d.get("isOccupied"),
101
94
  is_selected=d.get("isSelected"),
102
- is_ploted=d.get("isPloted"),
95
+ is_plotted=d.get("isPlotted"),
103
96
  )
104
97
 
105
98
  def set_section_factor(
@@ -169,20 +162,28 @@ class GeneralBoundary(Boundary):
169
162
  def _from_dict(cls, d: dict) -> GeneralBoundary:
170
163
  """从接口 dict 构造 GeneralBoundary 对象"""
171
164
  return cls(
172
- no=d.get("no"),
173
- name=d.get("name"),
165
+ no=as_no(d.get("no")),
166
+ name=as_name(d.get("name")),
174
167
  boundary_type=BoundaryType.GENERAL,
175
- entity_vec=list(d.get("entityVec")),
168
+ entity_vec=list(d.get("entityVec") or []),
176
169
  is_occupied=d.get("isOccupied"),
177
170
  is_selected=d.get("isSelected"),
178
- is_ploted=d.get("isPloted"),
179
- constraints=list(d.get("constraints")),
171
+ is_plotted=d.get("isPlotted"),
172
+ constraints=list(d.get("constraints") or []),
180
173
  coor_no=d.get("coorNO"),
181
174
  )
182
175
 
183
176
  def __repr__(self) -> str:
184
177
  return f"GeneralBoundary(no={self.no}, constraints={self.constraints})"
185
178
 
179
+ @property
180
+ def constraints_dict(self) -> dict[str, bool]:
181
+ """约束状态字典 {DX, DY, DZ, RX, RY, RZ, RW},True = 约束。
182
+
183
+ C++ 侧透传的是固定顺序的 7 位整数列表,这里转成可读字典。
184
+ """
185
+ return constraints_to_dict(self.constraints)
186
+
186
187
  @property
187
188
  def ux(self) -> int:
188
189
  return self.constraints[0] if len(self.constraints) > 0 else 0
@@ -227,17 +228,22 @@ class MstSlvBoundary(Boundary):
227
228
  def _from_dict(cls, d: dict) -> MstSlvBoundary:
228
229
  """从接口 dict 构造 MstSlvBoundary 对象"""
229
230
  return cls(
230
- no=d.get("no"),
231
- name=d.get("name"),
231
+ no=as_no(d.get("no")),
232
+ name=as_name(d.get("name")),
232
233
  boundary_type=BoundaryType.MSTSLV,
233
- entity_vec=list(d.get("entityVec")),
234
+ entity_vec=list(d.get("entityVec") or []),
234
235
  is_occupied=d.get("isOccupied"),
235
236
  is_selected=d.get("isSelected"),
236
- is_ploted=d.get("isPloted"),
237
- constraints=list(d.get("constraints")),
237
+ is_plotted=d.get("isPlotted"),
238
+ constraints=list(d.get("constraints") or []),
238
239
  master_no=d.get("masterNO"),
239
240
  )
240
241
 
242
+ @property
243
+ def constraints_dict(self) -> dict[str, bool]:
244
+ """约束状态字典 {DX, DY, DZ, RX, RY, RZ}(主从约束无 RW)"""
245
+ return constraints_to_dict(self.constraints)
246
+
241
247
  def __repr__(self) -> str:
242
248
  return f"MstSlvBoundary(no={self.no}, master_no={self.master_no})"
243
249
 
@@ -245,7 +251,7 @@ class MstSlvBoundary(Boundary):
245
251
  @dataclass(frozen=True)
246
252
  class ReleaseBoundary(Boundary):
247
253
  """释放梁端约束
248
-
254
+
249
255
  I端(7) + J端(7) = 14个约束状态/值
250
256
  state: 0 = 释放,1 = 约束
251
257
  value: 0-1 表示释放后残余约束能力的百分比
@@ -259,19 +265,29 @@ class ReleaseBoundary(Boundary):
259
265
  def _from_dict(cls, d: dict) -> ReleaseBoundary:
260
266
  """从接口 dict 构造 ReleaseBoundary 对象"""
261
267
  return cls(
262
- no=d.get("no"),
263
- name=d.get("name"),
268
+ no=as_no(d.get("no")),
269
+ name=as_name(d.get("name")),
264
270
  boundary_type=BoundaryType.RELEASE,
265
- entity_vec=list(d.get("entityVec")),
271
+ entity_vec=list(d.get("entityVec") or []),
266
272
  is_occupied=d.get("isOccupied"),
267
273
  is_selected=d.get("isSelected"),
268
- is_ploted=d.get("isPloted"),
269
- i_state=list(d.get("endIState")),
270
- i_values=list(d.get("endI")),
271
- j_state=list(d.get("endJState")),
272
- j_values=list(d.get("endJ")),
274
+ is_plotted=d.get("isPlotted"),
275
+ i_state=list(d.get("endIState") or []),
276
+ i_values=list(d.get("endI") or []),
277
+ j_state=list(d.get("endJState") or []),
278
+ j_values=list(d.get("endJ") or []),
273
279
  )
274
280
 
281
+ @property
282
+ def i_state_dict(self) -> dict[str, bool]:
283
+ """I 端约束状态字典 {DX, DY, DZ, RX, RY, RZ, RW}"""
284
+ return constraints_to_dict(self.i_state)
285
+
286
+ @property
287
+ def j_state_dict(self) -> dict[str, bool]:
288
+ """J 端约束状态字典 {DX, DY, DZ, RX, RY, RZ, RW}"""
289
+ return constraints_to_dict(self.j_state)
290
+
275
291
  def __repr__(self) -> str:
276
292
  return f"ReleaseBoundary(no={self.no})"
277
293
 
@@ -293,17 +309,17 @@ class ElstcSptBoundary(Boundary):
293
309
  def _from_dict(cls, d: dict) -> ElstcSptBoundary:
294
310
  """从接口 dict 构造 ElstcSptBoundary 对象"""
295
311
  return cls(
296
- no=d.get("no"),
297
- name=d.get("name"),
312
+ no=as_no(d.get("no")),
313
+ name=as_name(d.get("name")),
298
314
  boundary_type=BoundaryType.ELSTCSPT,
299
- entity_vec=list(d.get("entityVec")),
315
+ entity_vec=list(d.get("entityVec") or []),
300
316
  is_occupied=d.get("isOccupied"),
301
317
  is_selected=d.get("isSelected"),
302
- is_ploted=d.get("isPloted"),
318
+ is_plotted=d.get("isPlotted"),
303
319
  # constraints=list(d.get("constraints")),
304
320
  coor_no=d.get("coorNO"),
305
- k_values=list(d.get("k")),
306
- elastic_k=list(d.get("elasticK")),
321
+ k_values=list(d.get("k") or []),
322
+ elastic_k=list(d.get("elasticK") or []),
307
323
  )
308
324
 
309
325
  def __repr__(self) -> str:
@@ -329,13 +345,13 @@ class GeneralElstcSptBoundary(Boundary):
329
345
  def _from_dict(cls, d: dict) -> GeneralElstcSptBoundary:
330
346
  """从接口 dict 构造 GeneralElstcSptBoundary 对象"""
331
347
  return cls(
332
- no=d.get("no"),
333
- name=d.get("name"),
348
+ no=as_no(d.get("no")),
349
+ name=as_name(d.get("name")),
334
350
  boundary_type=BoundaryType.GENERALELSTCSPT,
335
- entity_vec=list(d.get("entityVec")),
351
+ entity_vec=list(d.get("entityVec") or []),
336
352
  is_occupied=d.get("isOccupied"),
337
353
  is_selected=d.get("isSelected"),
338
- is_ploted=d.get("isPloted"),
354
+ is_plotted=d.get("isPlotted"),
339
355
  coor_no=d.get("coorNO"),
340
356
  flag_m=d.get("flagM"),
341
357
  flag_c=d.get("flagC"),
pyosis/core/__init__.py CHANGED
@@ -15,3 +15,12 @@ from .basic_manager import BasicManager, LazyRef
15
15
  from .exceptions import DependencyError
16
16
  from .references import get_references, raise_if_occupied
17
17
  from .sdk import health, sdk_version, list_commands, instance_info
18
+ from .enums import (
19
+ OsisEnum,
20
+ ElementType, BoundaryType, MaterialType, MaterialCode,
21
+ SectionType, LoadCaseType, SplineType, TensionType,
22
+ element_type_name, boundary_type_name, material_type_name,
23
+ material_code_name, section_type_name, loadcase_type_name,
24
+ DOF_NAMES, constraints_to_dict,
25
+ )
26
+ from .normalize import as_no, as_name