qtmodel 1.1.11__tar.gz → 1.1.13__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.

Potentially problematic release.


This version of qtmodel might be problematic. Click here for more details.

Files changed (42) hide show
  1. {qtmodel-1.1.11 → qtmodel-1.1.13}/PKG-INFO +67 -11
  2. {qtmodel-1.1.11 → qtmodel-1.1.13}/README.md +65 -9
  3. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/core/data_helper.py +1 -1
  4. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/core/result_db.py +102 -0
  5. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/__init__.py +1 -0
  6. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_construction_stage.py +7 -7
  7. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_live_load.py +0 -1
  8. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_project.py +4 -0
  9. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_section.py +1 -1
  10. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_temperature_load.py +14 -42
  11. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_tendon.py +7 -7
  12. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_model_section.py +33 -2
  13. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_result_data.py +47 -1
  14. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel.egg-info/PKG-INFO +67 -11
  15. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel.egg-info/SOURCES.txt +3 -1
  16. {qtmodel-1.1.11 → qtmodel-1.1.13}/setup.py +1 -1
  17. qtmodel-1.1.13/test/test.py +7 -0
  18. qtmodel-1.1.13/test/test_model.py +1698 -0
  19. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/__init__.py +0 -0
  20. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/core/__init__.py +0 -0
  21. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/core/model_db.py +0 -0
  22. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/core/qt_server.py +0 -0
  23. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_analysis_setting.py +0 -0
  24. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_assistant.py +0 -0
  25. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_boundary.py +0 -0
  26. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_dynamic_load.py +0 -0
  27. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_load.py +0 -0
  28. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_property.py +0 -0
  29. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_sink_load.py +0 -0
  30. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_static_load.py +0 -0
  31. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/mdb/mdb_structure.py +0 -0
  32. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/__init__.py +0 -0
  33. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_model_boundary.py +0 -0
  34. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_model_load.py +0 -0
  35. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_model_material.py +0 -0
  36. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_model_stage.py +0 -0
  37. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_model_structure.py +0 -0
  38. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_result_plot.py +0 -0
  39. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel/odb/odb_view.py +0 -0
  40. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel.egg-info/dependency_links.txt +0 -0
  41. {qtmodel-1.1.11 → qtmodel-1.1.13}/qtmodel.egg-info/top_level.txt +0 -0
  42. {qtmodel-1.1.11 → qtmodel-1.1.13}/setup.cfg +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qtmodel
3
- Version: 1.1.11
4
- Summary: python modeling for qt 2025-10-13
3
+ Version: 1.1.13
4
+ Summary: python modeling for qt 2025-11-03
5
5
  Home-page: https://github.com/Inface0443/pyqt
6
6
  Author: dqy-zhj
7
7
  Author-email: 1105417715@qq.com
@@ -17,9 +17,9 @@ Dynamic: description-content-type
17
17
  Dynamic: home-page
18
18
  Dynamic: summary
19
19
 
20
- > 最新版本 V1.1.11 - 2025-10-13
20
+ > 最新版本 V1.1.13 - 2025-11-03
21
21
  > pip install --upgrade qtmodel -i https://pypi.org/simple
22
- - 新增更新结构组接口
22
+ - 增加钢束预应力结果读取
23
23
  # 建模操作
24
24
  ## 节点操作
25
25
  ### add_nodes
@@ -596,7 +596,7 @@ mdb.remove_thickness(name="板厚1")
596
596
  > _布置具体部位(箱型钢梁) 1-上左 2-上中 3-上右 4-左腹板 5-右腹板 6-下左 7-下中 8-下右
597
597
  > loop_segments:线圈坐标集合 list[dict] dict示例:{"main":[(x1,y1),(x2,y2)...],"sub1":[(x1,y1),(x2,y2)...],"sub2":[(x1,y1),(x2,y2)...]}
598
598
  > sec_lines:线宽集合[(x1,y1,x2,y3,thick),]
599
- > secondary_loop_segments:辅材线圈坐标集合 list[dict] (同loop_segments)
599
+ > secondary_loop_segments:辅材线圈坐标集合 list[dict] (同loop_segments),建议以左下角为组合截面原点建立截面
600
600
  > sec_property:截面特性(参考UI界面共计29个参数),可选参数,指定截面特性时不进行截面计算
601
601
  > bias_type:偏心类型 默认中心
602
602
  > center_type:中心类型 默认质心
@@ -1271,7 +1271,7 @@ control_points=[(0,-1,0),(10,-1,0)],point_insert=(1,1,1),track_group="轨迹线
1271
1271
  #Returns: 无
1272
1272
  ```
1273
1273
  ### update_element_component_type
1274
- todo 赋予单元构件类型
1274
+ 赋予单元构件类型
1275
1275
  > 参数:
1276
1276
  > ids: 钢束构件所在单元编号集合且支持XtoYbyN形式字符串
1277
1277
  > component_type:0-钢结构构件 1-钢筋混凝土构件 2-预应力混凝土构件
@@ -1282,7 +1282,7 @@ mdb.update_element_component_type(ids=[1,2,3,4],component_type=2)
1282
1282
  #Returns: 无
1283
1283
  ```
1284
1284
  ### update_tendon_group
1285
- todo 更新钢束组名
1285
+ 更新钢束组名
1286
1286
  > 参数:
1287
1287
  > name:原钢束组名
1288
1288
  > new_name:新钢束组名
@@ -1293,7 +1293,7 @@ mdb.update_tendon_group("钢束组1","钢束组2")
1293
1293
  #Returns: 无
1294
1294
  ```
1295
1295
  ### remove_tendon
1296
- todo 按照名称或编号删除钢束,默认时删除所有钢束
1296
+ 按照名称或编号删除钢束,默认时删除所有钢束
1297
1297
  > 参数:
1298
1298
  > name:钢束名称
1299
1299
  > index:钢束编号
@@ -1306,7 +1306,7 @@ mdb.remove_tendon()
1306
1306
  #Returns: 无
1307
1307
  ```
1308
1308
  ### remove_tendon_property
1309
- todo 按照名称或编号删除钢束组,默认时删除所有钢束组
1309
+ 按照名称或编号删除钢束组,默认时删除所有钢束组
1310
1310
  > 参数:
1311
1311
  > name:钢束组名称
1312
1312
  > index:钢束组编号
@@ -1319,7 +1319,7 @@ mdb.remove_tendon_property()
1319
1319
  #Returns: 无
1320
1320
  ```
1321
1321
  ### remove_pre_stress
1322
- todo 删除预应力
1322
+ 删除预应力
1323
1323
  > 参数:
1324
1324
  > tendon_name:钢束组,默认则删除所有预应力荷载
1325
1325
  ```Python
@@ -1330,7 +1330,7 @@ mdb.remove_pre_stress()
1330
1330
  #Returns: 无
1331
1331
  ```
1332
1332
  ### remove_tendon_group
1333
- todo 按照钢束组名称或钢束组编号删除钢束组,两参数均为默认时删除所有钢束组
1333
+ 按照钢束组名称或钢束组编号删除钢束组,两参数均为默认时删除所有钢束组
1334
1334
  > 参数:
1335
1335
  > name:钢束组名称,默认自动识别 (可选参数)
1336
1336
  ```Python
@@ -3101,6 +3101,7 @@ odb.get_all_section_data()
3101
3101
  获取截面详细信息,截面特性详见UI自定义特性截面
3102
3102
  > 参数:
3103
3103
  > sec_id: 目标截面编号
3104
+ > position: 目标截面为变截面时0-首端 1-末端
3104
3105
  ```Python
3105
3106
  # 示例代码
3106
3107
  from qtmodel import *
@@ -3126,6 +3127,31 @@ from qtmodel import *
3126
3127
  odb.get_section_ids()
3127
3128
  #Returns: list[int]
3128
3129
  ```
3130
+ ### get_section_property_by_loops
3131
+ 通过多组线圈获取截面特性
3132
+ > 参数:
3133
+ ```Python
3134
+ # 示例代码
3135
+ from qtmodel import *
3136
+ dict_item1 = {"main": [[9.25, 0.0], [18.4, 0.0], [18.5, 0.0], [18.5, 2.5], [9.25, 2.5], [0.0, 2.5], [0.0, 0.0], [0.1, 0.0]],
3137
+ "sub1": [[6.35, 0.5], [2.55, 0.5], [2.55, 1.0], [2.55, 2.0], [6.35, 2.0]],
3138
+ "sub2": [[9.25, 0.5], [11.55, 0.5], [11.55, 2.0], [9.25, 2.0], [6.95, 2.0], [6.95, 0.5]],
3139
+ "sub3": [[12.15, 0.5], [15.95, 0.5], [15.95, 1.0], [15.95, 2.0], [12.15, 2.0]]}
3140
+ odb.get_section_property_by_loops([dict_item1])
3141
+ #Returns: dict
3142
+ ```
3143
+ ### get_section_property_by_lines
3144
+ 通过线宽数据获取截面特性
3145
+ > 参数:
3146
+ ```Python
3147
+ # 示例代码
3148
+ from qtmodel import *
3149
+ sec_lines = [[0.0, 2.284, 5.51093, 2.284, 0.016], [0.152479, 2.284, 0.200597, 2.04341, 0.008],
3150
+ [0.200597, 2.04341, 0.201664, 2.0389, 0.008], [0.201664, 2.0389, 0.203149, 2.03451, 0.008],
3151
+ [0.203149, 2.03451, 0.205006, 2.03026, 0.008]]
3152
+ odb.get_section_property_by_lines(sec_lines)
3153
+ #Returns: dict
3154
+ ```
3129
3155
  ## 获取模型边界信息
3130
3156
  ### get_boundary_group_names
3131
3157
  获取自边界组名称
@@ -3553,6 +3579,36 @@ from qtmodel import *
3553
3579
  odb.get_buckling_modal_results(mode=1)
3554
3580
  #Returns: 返回json字符串,list[dict]包含该模态下屈曲模态向量列表
3555
3581
  ```
3582
+ ### get_tendon_loss_results
3583
+ 获取预应力钢束损失
3584
+ > 参数:
3585
+ > name: 钢束名称
3586
+ > stage_id: 阶段编号,默认 1
3587
+ ```Python
3588
+ # 示例代码
3589
+ from qtmodel import *
3590
+ odb.get_tendon_loss_results(name="T1", stage_id=2)
3591
+ #Returns:
3592
+ ```
3593
+ ### get_tendon_position_result
3594
+ 获取预应力钢束坐标
3595
+ > 参数:
3596
+ > name: 钢束名称
3597
+ ```Python
3598
+ # 示例代码
3599
+ from qtmodel import *
3600
+ odb.get_tendon_position_result(name="T1")
3601
+ #Returns:
3602
+ ```
3603
+ ### get_tendon_length_result
3604
+ 获取预应力伸长量
3605
+ > 参数:
3606
+ ```Python
3607
+ # 示例代码
3608
+ from qtmodel import *
3609
+ odb.get_tendon_length_result()
3610
+ #Returns:
3611
+ ```
3556
3612
  ## 绘制模型结果
3557
3613
  ### plot_reaction_result
3558
3614
  保存结果图片到指定文件甲
@@ -1,6 +1,6 @@
1
- > 最新版本 V1.1.11 - 2025-10-13
1
+ > 最新版本 V1.1.13 - 2025-11-03
2
2
  > pip install --upgrade qtmodel -i https://pypi.org/simple
3
- - 新增更新结构组接口
3
+ - 增加钢束预应力结果读取
4
4
  # 建模操作
5
5
  ## 节点操作
6
6
  ### add_nodes
@@ -577,7 +577,7 @@ mdb.remove_thickness(name="板厚1")
577
577
  > _布置具体部位(箱型钢梁) 1-上左 2-上中 3-上右 4-左腹板 5-右腹板 6-下左 7-下中 8-下右
578
578
  > loop_segments:线圈坐标集合 list[dict] dict示例:{"main":[(x1,y1),(x2,y2)...],"sub1":[(x1,y1),(x2,y2)...],"sub2":[(x1,y1),(x2,y2)...]}
579
579
  > sec_lines:线宽集合[(x1,y1,x2,y3,thick),]
580
- > secondary_loop_segments:辅材线圈坐标集合 list[dict] (同loop_segments)
580
+ > secondary_loop_segments:辅材线圈坐标集合 list[dict] (同loop_segments),建议以左下角为组合截面原点建立截面
581
581
  > sec_property:截面特性(参考UI界面共计29个参数),可选参数,指定截面特性时不进行截面计算
582
582
  > bias_type:偏心类型 默认中心
583
583
  > center_type:中心类型 默认质心
@@ -1252,7 +1252,7 @@ control_points=[(0,-1,0),(10,-1,0)],point_insert=(1,1,1),track_group="轨迹线
1252
1252
  #Returns: 无
1253
1253
  ```
1254
1254
  ### update_element_component_type
1255
- todo 赋予单元构件类型
1255
+ 赋予单元构件类型
1256
1256
  > 参数:
1257
1257
  > ids: 钢束构件所在单元编号集合且支持XtoYbyN形式字符串
1258
1258
  > component_type:0-钢结构构件 1-钢筋混凝土构件 2-预应力混凝土构件
@@ -1263,7 +1263,7 @@ mdb.update_element_component_type(ids=[1,2,3,4],component_type=2)
1263
1263
  #Returns: 无
1264
1264
  ```
1265
1265
  ### update_tendon_group
1266
- todo 更新钢束组名
1266
+ 更新钢束组名
1267
1267
  > 参数:
1268
1268
  > name:原钢束组名
1269
1269
  > new_name:新钢束组名
@@ -1274,7 +1274,7 @@ mdb.update_tendon_group("钢束组1","钢束组2")
1274
1274
  #Returns: 无
1275
1275
  ```
1276
1276
  ### remove_tendon
1277
- todo 按照名称或编号删除钢束,默认时删除所有钢束
1277
+ 按照名称或编号删除钢束,默认时删除所有钢束
1278
1278
  > 参数:
1279
1279
  > name:钢束名称
1280
1280
  > index:钢束编号
@@ -1287,7 +1287,7 @@ mdb.remove_tendon()
1287
1287
  #Returns: 无
1288
1288
  ```
1289
1289
  ### remove_tendon_property
1290
- todo 按照名称或编号删除钢束组,默认时删除所有钢束组
1290
+ 按照名称或编号删除钢束组,默认时删除所有钢束组
1291
1291
  > 参数:
1292
1292
  > name:钢束组名称
1293
1293
  > index:钢束组编号
@@ -1300,7 +1300,7 @@ mdb.remove_tendon_property()
1300
1300
  #Returns: 无
1301
1301
  ```
1302
1302
  ### remove_pre_stress
1303
- todo 删除预应力
1303
+ 删除预应力
1304
1304
  > 参数:
1305
1305
  > tendon_name:钢束组,默认则删除所有预应力荷载
1306
1306
  ```Python
@@ -1311,7 +1311,7 @@ mdb.remove_pre_stress()
1311
1311
  #Returns: 无
1312
1312
  ```
1313
1313
  ### remove_tendon_group
1314
- todo 按照钢束组名称或钢束组编号删除钢束组,两参数均为默认时删除所有钢束组
1314
+ 按照钢束组名称或钢束组编号删除钢束组,两参数均为默认时删除所有钢束组
1315
1315
  > 参数:
1316
1316
  > name:钢束组名称,默认自动识别 (可选参数)
1317
1317
  ```Python
@@ -3082,6 +3082,7 @@ odb.get_all_section_data()
3082
3082
  获取截面详细信息,截面特性详见UI自定义特性截面
3083
3083
  > 参数:
3084
3084
  > sec_id: 目标截面编号
3085
+ > position: 目标截面为变截面时0-首端 1-末端
3085
3086
  ```Python
3086
3087
  # 示例代码
3087
3088
  from qtmodel import *
@@ -3107,6 +3108,31 @@ from qtmodel import *
3107
3108
  odb.get_section_ids()
3108
3109
  #Returns: list[int]
3109
3110
  ```
3111
+ ### get_section_property_by_loops
3112
+ 通过多组线圈获取截面特性
3113
+ > 参数:
3114
+ ```Python
3115
+ # 示例代码
3116
+ from qtmodel import *
3117
+ dict_item1 = {"main": [[9.25, 0.0], [18.4, 0.0], [18.5, 0.0], [18.5, 2.5], [9.25, 2.5], [0.0, 2.5], [0.0, 0.0], [0.1, 0.0]],
3118
+ "sub1": [[6.35, 0.5], [2.55, 0.5], [2.55, 1.0], [2.55, 2.0], [6.35, 2.0]],
3119
+ "sub2": [[9.25, 0.5], [11.55, 0.5], [11.55, 2.0], [9.25, 2.0], [6.95, 2.0], [6.95, 0.5]],
3120
+ "sub3": [[12.15, 0.5], [15.95, 0.5], [15.95, 1.0], [15.95, 2.0], [12.15, 2.0]]}
3121
+ odb.get_section_property_by_loops([dict_item1])
3122
+ #Returns: dict
3123
+ ```
3124
+ ### get_section_property_by_lines
3125
+ 通过线宽数据获取截面特性
3126
+ > 参数:
3127
+ ```Python
3128
+ # 示例代码
3129
+ from qtmodel import *
3130
+ sec_lines = [[0.0, 2.284, 5.51093, 2.284, 0.016], [0.152479, 2.284, 0.200597, 2.04341, 0.008],
3131
+ [0.200597, 2.04341, 0.201664, 2.0389, 0.008], [0.201664, 2.0389, 0.203149, 2.03451, 0.008],
3132
+ [0.203149, 2.03451, 0.205006, 2.03026, 0.008]]
3133
+ odb.get_section_property_by_lines(sec_lines)
3134
+ #Returns: dict
3135
+ ```
3110
3136
  ## 获取模型边界信息
3111
3137
  ### get_boundary_group_names
3112
3138
  获取自边界组名称
@@ -3534,6 +3560,36 @@ from qtmodel import *
3534
3560
  odb.get_buckling_modal_results(mode=1)
3535
3561
  #Returns: 返回json字符串,list[dict]包含该模态下屈曲模态向量列表
3536
3562
  ```
3563
+ ### get_tendon_loss_results
3564
+ 获取预应力钢束损失
3565
+ > 参数:
3566
+ > name: 钢束名称
3567
+ > stage_id: 阶段编号,默认 1
3568
+ ```Python
3569
+ # 示例代码
3570
+ from qtmodel import *
3571
+ odb.get_tendon_loss_results(name="T1", stage_id=2)
3572
+ #Returns:
3573
+ ```
3574
+ ### get_tendon_position_result
3575
+ 获取预应力钢束坐标
3576
+ > 参数:
3577
+ > name: 钢束名称
3578
+ ```Python
3579
+ # 示例代码
3580
+ from qtmodel import *
3581
+ odb.get_tendon_position_result(name="T1")
3582
+ #Returns:
3583
+ ```
3584
+ ### get_tendon_length_result
3585
+ 获取预应力伸长量
3586
+ > 参数:
3587
+ ```Python
3588
+ # 示例代码
3589
+ from qtmodel import *
3590
+ odb.get_tendon_length_result()
3591
+ #Returns:
3592
+ ```
3537
3593
  ## 绘制模型结果
3538
3594
  ### plot_reaction_result
3539
3595
  保存结果图片到指定文件甲
@@ -133,7 +133,7 @@ class QtDataHelper:
133
133
  s = QtDataHelper.str_steel_beam(sec_info, rib_info, rib_place)
134
134
  elif sec_type == "特性截面":
135
135
  s = ",".join(f"{x:g}" for x in sec_info) + "\r\n"
136
- elif sec_type == "自定义组合梁":
136
+ elif sec_type.startswith("自定义组合"):
137
137
  s = QtDataHelper.str_custom_compound_beam(mat_combine, loop_segments, secondary_loop_segments)
138
138
  elif sec_type.endswith("组合梁") or sec_type in ("钢管砼", "钢箱砼", "哑铃型钢管混凝土", "哑铃型钢管混凝土竖向"):
139
139
  s = QtDataHelper.str_compound_section(sec_info, mat_combine)
@@ -1,4 +1,6 @@
1
+ import json
1
2
  import math
3
+ from typing import Union
2
4
 
3
5
 
4
6
  class NodeDisplacement:
@@ -653,3 +655,103 @@ class ElasticBucklingResult:
653
655
 
654
656
  def __repr__(self):
655
657
  return self.__str__()
658
+
659
+
660
+ class TendonLossResult:
661
+ """
662
+ 预应力钢筋损失(简化)
663
+ 对应 C# PreStressBarLoss:
664
+ - BarId → bar_id
665
+ - BeamId → beam_id
666
+ - BeamEndMark → position
667
+ - EffectiveStress → effective_s
668
+ - InstantaneousLoss → instance_s
669
+ - ExceptInstantaneous → except_s
670
+ - Effective/Instantaneous Ratio → ratio
671
+ """
672
+
673
+ def __init__(
674
+ self,
675
+ tendon_name: str,
676
+ beam_id: int,
677
+ position: Union[str, int],
678
+ eff_s: float,
679
+ inst_s: float,
680
+ except_s: float
681
+ ):
682
+ self.tendon_name = tendon_name
683
+ self.beam_id = beam_id
684
+ self.position = position # 例如: 'I'/'J' 或 1/2
685
+ self.effective_s = float(eff_s) # 考虑所有损失后的应力
686
+ self.instance_s = float(inst_s) # 排除瞬时损失后的应力(你的 C# 字段名语义如此)
687
+ self.except_s = float(except_s) # 弹性变形/收缩徐变/松弛 的合计损失(排除瞬时)
688
+
689
+ # 对应 C# 的 EffectiveToInstantaneousLossRatio
690
+ self.ratio = (self.effective_s / self.instance_s) if abs(self.instance_s) > 0.0 else 0.0
691
+
692
+ def to_dict(self):
693
+ return {
694
+ "tendon_name": self.tendon_name,
695
+ "beam_id": self.beam_id,
696
+ "position": self.position,
697
+ "effective_s": self.effective_s,
698
+ "instance_s": self.instance_s,
699
+ "except_s": self.except_s,
700
+ "ratio": self.ratio,
701
+ }
702
+
703
+ def __str__(self):
704
+ # 保持可读输出,同时兼容中文
705
+ return json.dumps(self.to_dict(), ensure_ascii=False)
706
+
707
+ def __repr__(self):
708
+ # 与 __str__ 一致,便于调试打印
709
+ return self.__str__()
710
+
711
+
712
+ class TendonLengthResult:
713
+ """
714
+ 预应力伸长量结果
715
+ """
716
+ def __init__(
717
+ self,
718
+ tendon_name: str,
719
+ start_stage: int,
720
+ stress_length: float,
721
+ un_stress_length: float,
722
+ effect_stress_i: float,
723
+ effect_stress_j: float,
724
+ elongation_i: float,
725
+ elongation_j: float,
726
+ elongation: float
727
+ ):
728
+ self.tendon_name = tendon_name
729
+ self.start_stage = start_stage
730
+ self.stress_length = stress_length
731
+ self.un_stress_length = un_stress_length
732
+ self.effect_stress_i = effect_stress_i
733
+ self.effect_stress_j = effect_stress_j
734
+ self.elongation_i = elongation_i
735
+ self.elongation_j = elongation_j
736
+ self.elongation = elongation
737
+
738
+ def to_dict(self):
739
+ return {
740
+ "tendon_name": self.tendon_name,
741
+ "start_stage": self.start_stage,
742
+ "stress_length": self.stress_length,
743
+ "un_stress_length": self.un_stress_length,
744
+ "effect_stress_i": self.effect_stress_i,
745
+ "effect_stress_j": self.effect_stress_j,
746
+ "elongation_i": self.elongation_i,
747
+ "elongation_j": self.elongation_j,
748
+ "elongation": self.elongation,
749
+ }
750
+
751
+ def __str__(self):
752
+ # 保持可读输出,同时兼容中文
753
+ return json.dumps(self.to_dict(), ensure_ascii=False)
754
+
755
+ def __repr__(self):
756
+ # 与 __str__ 一致,便于调试打印
757
+ return self.__str__()
@@ -14,6 +14,7 @@ from .mdb_temperature_load import MdbTemperatureLoad
14
14
  from .mdb_tendon import MdbTendon
15
15
  from .mdb_load import MdbLoad
16
16
 
17
+ # version 1.1.11
17
18
 
18
19
  class Mdb(MdbProject, MdbStructure,MdbProperty, MdbSection,
19
20
  MdbBoundary, MdbDynamicLoad,MdbConstructionStage,
@@ -48,19 +48,19 @@ class MdbConstructionStage:
48
48
  """
49
49
  s = "*STAGE\r\n"
50
50
  s += f"ID={index},{name},{duration},{tendon_cancel_loss:g},{constraint_cancel_type}\r\n"
51
- if active_structures is not None:
51
+ if active_structures is not None and len(active_structures) > 0:
52
52
  s += f"AELEM={','.join(','.join(str(x) if not isinstance(x, (int, float)) else f'{x:g}' for x in row) for row in active_structures)}\r\n"
53
- if delete_structures is not None:
53
+ if delete_structures is not None and len(delete_structures) > 0:
54
54
  s += f"DELEM={','.join(map(str, delete_structures))}\r\n"
55
- if active_boundaries is not None:
55
+ if active_boundaries is not None and len(active_boundaries) > 0:
56
56
  s += f"ABNDR={','.join(','.join(map(str, row)) for row in active_boundaries)}\r\n"
57
- if delete_boundaries is not None:
57
+ if delete_boundaries is not None and len(delete_boundaries) > 0:
58
58
  s += f"DBNDR={','.join(map(str, delete_boundaries))}\r\n"
59
- if active_loads is not None:
59
+ if active_loads is not None and len(active_loads) > 0:
60
60
  s += f"ALOAD={','.join(','.join(map(str, row)) for row in active_loads)}\r\n"
61
- if delete_loads is not None:
61
+ if delete_loads is not None and len(delete_loads) > 0:
62
62
  s += f"DLOAD={','.join(','.join(map(str, row)) for row in delete_loads)}\r\n"
63
- if temp_loads is not None:
63
+ if temp_loads is not None and len(temp_loads) > 0:
64
64
  s += f"TEPLOAD={','.join(map(str, temp_loads))}\r\n"
65
65
  QtServer.send_command(s, "QDAT")
66
66
 
@@ -201,7 +201,6 @@ class MdbLiveLoad:
201
201
  else:
202
202
  s += f"YES,{special_code}\r\n"
203
203
  s += "\r\n".join((f"{veh_name},{coeff:g}," + ",".join(lanes)) for veh_name, coeff, lanes in sub_case)
204
- # print(s)
205
204
  QtServer.send_command(s, "QDAT")
206
205
  except Exception as ex:
207
206
  raise Exception(ex)
@@ -1,4 +1,6 @@
1
1
  import json
2
+ import time
3
+
2
4
  from qtmodel.core.qt_server import QtServer
3
5
  from typing import List
4
6
 
@@ -95,6 +97,8 @@ class MdbProject:
95
97
  Returns: 无
96
98
  """
97
99
  QtServer.send_command(header="DO-SOLVE")
100
+ # 设置缓冲时间
101
+ time.sleep(3)
98
102
 
99
103
  @staticmethod
100
104
  def initial():
@@ -59,7 +59,7 @@ class MdbSection:
59
59
  _布置具体部位(箱型钢梁) 1-上左 2-上中 3-上右 4-左腹板 5-右腹板 6-下左 7-下中 8-下右
60
60
  loop_segments:线圈坐标集合 list[dict] dict示例:{"main":[(x1,y1),(x2,y2)...],"sub1":[(x1,y1),(x2,y2)...],"sub2":[(x1,y1),(x2,y2)...]}
61
61
  sec_lines:线宽集合[(x1,y1,x2,y3,thick),]
62
- secondary_loop_segments:辅材线圈坐标集合 list[dict] (同loop_segments)
62
+ secondary_loop_segments:辅材线圈坐标集合 list[dict] (同loop_segments),建议以左下角为组合截面原点建立截面
63
63
  sec_property:截面特性(参考UI界面共计29个参数),可选参数,指定截面特性时不进行截面计算
64
64
  bias_type:偏心类型 默认中心
65
65
  center_type:中心类型 默认质心
@@ -24,12 +24,8 @@ class MdbTemperatureLoad:
24
24
  mdb.add_custom_temperature(case_name="荷载工况1",element_id=1,orientation=1,temperature_data=[(1,1,20),(1,2,10)])
25
25
  Returns: 无
26
26
  """
27
- if element_id is None:
28
- id_str = ""
29
- elif isinstance(element_id, list): # 列表转化为XtoYbyN
30
- id_str = QtDataHelper.parse_int_list_to_str(element_id)
31
- else:
32
- id_str = str(element_id)
27
+ element_id = QtDataHelper.parse_ids_to_array(element_id)
28
+ id_str = QtDataHelper.parse_int_list_to_str(element_id)
33
29
  s = "*USER-TEMP\r\n" + f"{id_str},{case_name},{group_name},{orientation},"
34
30
  s += ",".join(f"({','.join(f'{x:g}' for x in data)})" for data in temperature_data) + "\r\n"
35
31
  # print(s)
@@ -49,12 +45,8 @@ class MdbTemperatureLoad:
49
45
  mdb.add_element_temperature(element_id=1,case_name="自重",temperature=1,group_name="默认荷载组")
50
46
  Returns: 无
51
47
  """
52
- if element_id is None:
53
- id_str = ""
54
- elif isinstance(element_id, list): # 列表转化为XtoYbyN
55
- id_str = QtDataHelper.parse_int_list_to_str(element_id)
56
- else:
57
- id_str = str(element_id)
48
+ element_id = QtDataHelper.parse_ids_to_array(element_id)
49
+ id_str = QtDataHelper.parse_int_list_to_str(element_id)
58
50
  s = "*ELE-TEMP\r\n" + f"{id_str},{case_name},{group_name},{temperature:g}\r\n"
59
51
  # print(s)
60
52
  QtServer.send_command(s, "QDAT")
@@ -93,12 +85,8 @@ class MdbTemperatureLoad:
93
85
  Returns: 无
94
86
  """
95
87
  s = ""
96
- if element_id is None:
97
- id_str = ""
98
- elif isinstance(element_id, list): # 列表转化为XtoYbyN
99
- id_str = QtDataHelper.parse_int_list_to_str(element_id)
100
- else:
101
- id_str = str(element_id)
88
+ element_id = QtDataHelper.parse_ids_to_array(element_id)
89
+ id_str = QtDataHelper.parse_int_list_to_str(element_id)
102
90
  if element_type == 1: # 1-梁单元
103
91
  s = "*BEAMGRD-TEMP\r\n" + f"{id_str},{case_name},{group_name},{section_oriental},{temperature:g}" + "\r\n"
104
92
  elif element_type == 2: # 2-板单元
@@ -127,12 +115,8 @@ class MdbTemperatureLoad:
127
115
  mdb.add_beam_section_temperature(element_id=1,case_name="工况1",code_index=1,sec_type=1,t1=-4.2,t2=-1)
128
116
  Returns: 无
129
117
  """
130
- if element_id is None:
131
- id_str = ""
132
- elif isinstance(element_id, list): # 列表转化为XtoYbyN
133
- id_str = QtDataHelper.parse_int_list_to_str(element_id)
134
- else:
135
- id_str = str(element_id)
118
+ element_id = QtDataHelper.parse_ids_to_array(element_id)
119
+ id_str = QtDataHelper.parse_int_list_to_str(element_id)
136
120
  s = "*SEC-TEMP\r\n" + f"{id_str},{case_name},{group_name},{code_index},{sec_type},{t1:g},{t2:g},{t3:g},{t4:g},{thick:g}" + "\r\n"
137
121
  # print(s)
138
122
  QtServer.send_command(s, "QDAT")
@@ -152,12 +136,8 @@ class MdbTemperatureLoad:
152
136
  mdb.add_index_temperature(element_id=1,case_name="工况1",temperature=20,index=2)
153
137
  Returns: 无
154
138
  """
155
- if element_id is None:
156
- id_str = ""
157
- elif isinstance(element_id, list): # 列表转化为XtoYbyN
158
- id_str = QtDataHelper.parse_int_list_to_str(element_id)
159
- else:
160
- id_str = str(element_id)
139
+ element_id = QtDataHelper.parse_ids_to_array(element_id)
140
+ id_str = QtDataHelper.parse_int_list_to_str(element_id)
161
141
  tem_dir = 1 # 目前仅支持截面高度方向温度加载
162
142
  s = "*INDEX-TEMP\r\n" + f"{id_str},{case_name},{group_name},{tem_dir},{temperature:g},{index:g}" + "\r\n"
163
143
  # print(s)
@@ -177,12 +157,8 @@ class MdbTemperatureLoad:
177
157
  mdb.add_top_plate_temperature(element_id=1,case_name="工况1",temperature=40,group_name="默认荷载组")
178
158
  Returns: 无
179
159
  """
180
- if element_id is None:
181
- id_str = ""
182
- elif isinstance(element_id, list): # 列表转化为XtoYbyN
183
- id_str = QtDataHelper.parse_int_list_to_str(element_id)
184
- else:
185
- id_str = str(element_id)
160
+ element_id = QtDataHelper.parse_ids_to_array(element_id)
161
+ id_str = QtDataHelper.parse_int_list_to_str(element_id)
186
162
  s = "*TOPPLATE-TEMP\r\n" + f"{id_str},{case_name},{group_name},{temperature:g}" + "\r\n"
187
163
  # print(s)
188
164
  QtServer.send_command(s, "QDAT")
@@ -333,12 +309,8 @@ class MdbTemperatureLoad:
333
309
  """
334
310
  if parameters is None:
335
311
  raise Exception("操作错误,制造误差名称信息不能为空")
336
- if element_id is None:
337
- id_str = ""
338
- elif isinstance(element_id, list): # 列表转化为XtoYbyN
339
- id_str = QtDataHelper.parse_int_list_to_str(element_id)
340
- else:
341
- id_str = str(element_id)
312
+ element_id = QtDataHelper.parse_ids_to_array(element_id)
313
+ id_str = QtDataHelper.parse_int_list_to_str(element_id)
342
314
  s = "*DEVLOAD\r\n" + f"{id_str},{case_name},{group_name},"
343
315
  if isinstance(parameters, str):
344
316
  s += f"{parameters}\r\n"
@@ -299,7 +299,7 @@ class MdbTendon:
299
299
  @staticmethod
300
300
  def update_element_component_type(ids=None, component_type: int = 2):
301
301
  """
302
- todo 赋予单元构件类型
302
+ 赋予单元构件类型
303
303
  Args:
304
304
  ids: 钢束构件所在单元编号集合且支持XtoYbyN形式字符串
305
305
  component_type:0-钢结构构件 1-钢筋混凝土构件 2-预应力混凝土构件
@@ -308,7 +308,7 @@ class MdbTendon:
308
308
  Returns: 无
309
309
  """
310
310
  payload = {
311
- "ids": ids,
311
+ "ids": QtDataHelper.parse_ids_to_array(ids),
312
312
  "component_type": component_type,
313
313
  }
314
314
  return QtServer.send_dict("UPDATE-ELEMENT-COMPONENT-TYPE", payload)
@@ -316,7 +316,7 @@ class MdbTendon:
316
316
  @staticmethod
317
317
  def update_tendon_group(name: str, new_name: str = ""):
318
318
  """
319
- todo 更新钢束组名
319
+ 更新钢束组名
320
320
  Args:
321
321
  name:原钢束组名
322
322
  new_name:新钢束组名
@@ -333,7 +333,7 @@ class MdbTendon:
333
333
  @staticmethod
334
334
  def remove_tendon(name: str = "", index: int = -1):
335
335
  """
336
- todo 按照名称或编号删除钢束,默认时删除所有钢束
336
+ 按照名称或编号删除钢束,默认时删除所有钢束
337
337
  Args:
338
338
  name:钢束名称
339
339
  index:钢束编号
@@ -352,7 +352,7 @@ class MdbTendon:
352
352
  @staticmethod
353
353
  def remove_tendon_property(name: str = "", index: int = -1):
354
354
  """
355
- todo 按照名称或编号删除钢束组,默认时删除所有钢束组
355
+ 按照名称或编号删除钢束组,默认时删除所有钢束组
356
356
  Args:
357
357
  name:钢束组名称
358
358
  index:钢束组编号
@@ -371,7 +371,7 @@ class MdbTendon:
371
371
  @staticmethod
372
372
  def remove_pre_stress(tendon_name: str = ""):
373
373
  """
374
- todo 删除预应力
374
+ 删除预应力
375
375
  Args:
376
376
  tendon_name:钢束组,默认则删除所有预应力荷载
377
377
  Example:
@@ -385,7 +385,7 @@ class MdbTendon:
385
385
  @staticmethod
386
386
  def remove_tendon_group(name: str = ""):
387
387
  """
388
- todo 按照钢束组名称或钢束组编号删除钢束组,两参数均为默认时删除所有钢束组
388
+ 按照钢束组名称或钢束组编号删除钢束组,两参数均为默认时删除所有钢束组
389
389
  Args:
390
390
  name:钢束组名称,默认自动识别 (可选参数)
391
391
  Example: