morphopt 4.0.9__tar.gz → 4.0.11__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.
Files changed (232) hide show
  1. {morphopt-4.0.9 → morphopt-4.0.11}/PKG-INFO +10 -8
  2. {morphopt-4.0.9 → morphopt-4.0.11}/README.md +7 -5
  3. {morphopt-4.0.9 → morphopt-4.0.11}/pyproject.toml +3 -3
  4. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/constants.py +30 -14
  5. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/controller.py +46 -37
  6. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/baseparam.py +0 -8
  7. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/__init__.py +1 -0
  8. morphopt-4.0.11/src/morphopt/optcore/modelparams/fea/joint.py +75 -0
  9. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/feaparams.py +2 -0
  10. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/geometry.py +0 -9
  11. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/params.py +1 -9
  12. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/objfunc.py +10 -62
  13. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/protocal.py +12 -0
  14. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/strategies.py +34 -57
  15. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/updaters.py +100 -66
  16. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/postprocess/__init__.py +4 -6
  17. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/postprocess/archive.py +106 -55
  18. morphopt-4.0.11/src/morphopt/postprocess/exports/__init__.py +34 -0
  19. morphopt-4.0.11/src/morphopt/postprocess/exports/animation.py +100 -0
  20. morphopt-4.0.11/src/morphopt/postprocess/exports/components.py +63 -0
  21. morphopt-4.0.11/src/morphopt/postprocess/exports/finite_element.py +168 -0
  22. morphopt-4.0.11/src/morphopt/postprocess/exports/tables.py +197 -0
  23. morphopt-4.0.11/src/morphopt/postprocess/snapshots.py +229 -0
  24. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/postprocess/visualization.py +138 -145
  25. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/barriers.py +22 -15
  26. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/boundary_part.py +14 -10
  27. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/objectivefuncs/surfacefairness.py +131 -71
  28. morphopt-4.0.11/src/morphopt/shapeopt/strategies.py +455 -0
  29. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/base_surface.py +36 -18
  30. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/brep_surface.py +394 -153
  31. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/bsp_surface.py +26 -59
  32. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/cpgeo_surface.py +36 -56
  33. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/mesh_surface.py +18 -53
  34. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/update_boundary_part.py +31 -103
  35. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/simpmaterial.py +86 -21
  36. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/update_simpmaterial.py +45 -142
  37. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/__init__.py +1 -1
  38. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/app.py +18 -2
  39. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/definitions.py +26 -23
  40. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/devices.py +7 -4
  41. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/editing.py +1 -1
  42. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/expressions.py +23 -3
  43. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/fields.py +12 -0
  44. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/finite_element.py +10 -5
  45. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/load_cases.py +1 -1
  46. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/part_sets.py +15 -4
  47. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/results.py +16 -25
  48. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/runs.py +14 -39
  49. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/validation.py +22 -11
  50. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/codegen/assets.py +41 -11
  51. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/codegen/custom_classes.py +12 -10
  52. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/codegen/generator.py +13 -14
  53. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/i18n.py +9 -0
  54. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/locales/en-US.json +83 -42
  55. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/locales/zh-CN.json +83 -42
  56. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/mainwindow.py +88 -29
  57. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/base_nodes.py +5 -0
  58. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/configuration.py +4 -6
  59. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/loaders.py +13 -14
  60. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/__init__.py +4 -0
  61. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/loads.py +46 -20
  62. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/registry.py +4 -0
  63. morphopt-4.0.11/src/morphopt/ui/model/strategies.py +60 -0
  64. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/observe_panel.py +56 -172
  65. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/presentation/history.py +4 -3
  66. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/presentation/labels.py +16 -1
  67. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/presentation/result_fields.py +3 -12
  68. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/refresh.py +6 -1
  69. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/palette.py +1 -0
  70. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/styles/base.qss +1 -0
  71. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/styles/controls.qss +2 -2
  72. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/styles/inputs.qss +1 -1
  73. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/themes/dark.py +1 -0
  74. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/themes/light.py +10 -9
  75. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/visualization/geometry.py +36 -6
  76. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/visualization/loads.py +27 -12
  77. morphopt-4.0.11/src/morphopt/ui/visualization/rendering.py +166 -0
  78. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/controller_editor.py +2 -2
  79. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/finite_element.py +1 -1
  80. morphopt-4.0.11/src/morphopt/ui/widgets/history_export.py +753 -0
  81. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/model_tree.py +5 -1
  82. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/observation_pages.py +122 -68
  83. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/solver_editor.py +1 -2
  84. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/source_view.py +21 -2
  85. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/updater_editor.py +13 -14
  86. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/viewer.py +4 -2
  87. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/viewport.py +7 -3
  88. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/workbench.py +1 -0
  89. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/worker.py +7 -3
  90. morphopt-4.0.11/src/morphopt/utils/paths.py +74 -0
  91. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt.egg-info/PKG-INFO +10 -8
  92. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt.egg-info/SOURCES.txt +7 -1
  93. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt.egg-info/requires.txt +2 -2
  94. morphopt-4.0.9/src/morphopt/postprocess/exports.py +0 -564
  95. morphopt-4.0.9/src/morphopt/shapeopt/strategies.py +0 -448
  96. morphopt-4.0.9/src/morphopt/ui/model/strategies.py +0 -83
  97. morphopt-4.0.9/src/morphopt/ui/visualization/rendering.py +0 -86
  98. morphopt-4.0.9/src/morphopt/ui/widgets/history_export.py +0 -332
  99. morphopt-4.0.9/src/morphopt/utils/paths.py +0 -22
  100. {morphopt-4.0.9 → morphopt-4.0.11}/setup.cfg +0 -0
  101. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/__init__.py +0 -0
  102. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/codesign/__init__.py +0 -0
  103. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/codesign/constraints.py +0 -0
  104. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/codesign/offset_boundary_part.py +0 -0
  105. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/codesign/update_offset_boundary_part.py +0 -0
  106. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/opt_runner.py +0 -0
  107. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/__init__.py +0 -0
  108. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/history.py +0 -0
  109. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/__init__.py +0 -0
  110. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/base_model_component.py +0 -0
  111. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/base_component.py +0 -0
  112. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/body_force.py +0 -0
  113. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/boundary_condition.py +0 -0
  114. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/contact.py +0 -0
  115. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/couple.py +0 -0
  116. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/point_load.py +0 -0
  117. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/pressure.py +0 -0
  118. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/reference_point.py +0 -0
  119. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/fea/spring.py +0 -0
  120. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/materials/__init__.py +0 -0
  121. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/materials/base_material.py +0 -0
  122. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/materials/homogeneous_material.py +0 -0
  123. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/materials/models.py +0 -0
  124. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/materialsparams.py +0 -0
  125. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/parts/__init__.py +0 -0
  126. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/parts/base_part.py +0 -0
  127. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/parts/box_part.py +0 -0
  128. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/parts/cad_part.py +0 -0
  129. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/parts/fixed_part.py +0 -0
  130. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/modelparams/parts/inp_part.py +0 -0
  131. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/optcore/solver.py +0 -0
  132. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/postprocess/_runtime.py +0 -0
  133. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/postprocess/fields.py +0 -0
  134. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/__init__.py +0 -0
  135. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/objectivefuncs/__init__.py +0 -0
  136. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/objectivefuncs/basefuncs.py +0 -0
  137. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/objectivefuncs/boundarys.py +0 -0
  138. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/objectivefuncs/distancesurface.py +0 -0
  139. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/objectivefuncs/shapederivative.py +0 -0
  140. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/objectivefuncs/volumemaximization.py +0 -0
  141. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/__init__.py +0 -0
  142. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/base_constraints.py +0 -0
  143. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/bsp_constraints.py +0 -0
  144. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/cpgeo_constraints.py +0 -0
  145. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/shapeopt/surfaces/nurbs_face.py +0 -0
  146. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/__init__.py +0 -0
  147. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/objectivefuncs/__init__.py +0 -0
  148. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/objectivefuncs/basefuncs.py +0 -0
  149. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/objectivefuncs/boundarys.py +0 -0
  150. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/objectivefuncs/densityfield.py +0 -0
  151. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/objectivefuncs/sensitivity.py +0 -0
  152. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/objectivefuncs/volfrac.py +0 -0
  153. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/simp/void_elements.py +0 -0
  154. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/__main__.py +0 -0
  155. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/__init__.py +0 -0
  156. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/cad.py +0 -0
  157. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/completion.py +0 -0
  158. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/edit_history.py +0 -0
  159. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/editor_routing.py +0 -0
  160. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/part_mesh.py +0 -0
  161. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/quickstart.py +0 -0
  162. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/updaters.py +0 -0
  163. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application/values.py +0 -0
  164. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/application_icon.py +0 -0
  165. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/assets/morphopt.svg +0 -0
  166. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/codegen/__init__.py +0 -0
  167. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/codegen/snippets.py +0 -0
  168. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/codegen/workspace.py +0 -0
  169. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/launcher.py +0 -0
  170. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/__init__.py +0 -0
  171. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/chamberlayout.py +0 -0
  172. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/fields.py +0 -0
  173. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/material_models.py +0 -0
  174. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/cad.py +0 -0
  175. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/custom_code.py +0 -0
  176. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/materials.py +0 -0
  177. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/objectives.py +0 -0
  178. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/parts.py +0 -0
  179. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/penalties.py +0 -0
  180. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/structural.py +0 -0
  181. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/surfaces.py +0 -0
  182. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/node_types/symmetry.py +0 -0
  183. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/model/problem.py +0 -0
  184. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/presentation/__init__.py +0 -0
  185. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/presentation/edit_history.py +0 -0
  186. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/presentation/navigation.py +0 -0
  187. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/processes.py +0 -0
  188. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/__init__.py +0 -0
  189. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/fonts.py +0 -0
  190. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/manager.py +0 -0
  191. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/styles/__init__.py +0 -0
  192. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/stylesheet.py +0 -0
  193. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/themes/__init__.py +0 -0
  194. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/theme/visualization.py +0 -0
  195. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/visualization/__init__.py +0 -0
  196. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/visualization/assets.py +0 -0
  197. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/visualization/scene.py +0 -0
  198. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/__init__.py +0 -0
  199. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/asset_browser.py +0 -0
  200. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/case_deletion.py +0 -0
  201. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/codeeditor.py +0 -0
  202. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/collection_controls.py +0 -0
  203. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/custom_classes.py +0 -0
  204. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/definition_actions.py +0 -0
  205. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/definition_manager.py +0 -0
  206. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/edit_history.py +0 -0
  207. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/editor.py +0 -0
  208. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/editor_pages.py +0 -0
  209. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/file_dialogs.py +0 -0
  210. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/font_settings.py +0 -0
  211. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/helper_editor.py +0 -0
  212. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/history_dialogs.py +0 -0
  213. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/labels.py +0 -0
  214. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/load_cases.py +0 -0
  215. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/objective_editor.py +0 -0
  216. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/param_form.py +0 -0
  217. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/part_set_list.py +0 -0
  218. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/preview_renderer.py +0 -0
  219. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/problems.py +0 -0
  220. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/quickstart.py +0 -0
  221. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/run_dialogs.py +0 -0
  222. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/sequence_input.py +0 -0
  223. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/template_insert_dialog.py +0 -0
  224. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/visualization_settings.py +0 -0
  225. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/ui/widgets/workspace_objective.py +0 -0
  226. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/utils/__init__.py +0 -0
  227. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/utils/gradient_check.py +0 -0
  228. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/utils/history_read.py +0 -0
  229. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt/utils/quadrature.py +0 -0
  230. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt.egg-info/dependency_links.txt +0 -0
  231. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt.egg-info/entry_points.txt +0 -0
  232. {morphopt-4.0.9 → morphopt-4.0.11}/src/morphopt.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: morphopt
3
- Version: 4.0.9
3
+ Version: 4.0.11
4
4
  Summary: A morphing optimization framework using PyTorch and torchfea.
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -18,11 +18,11 @@ Requires-Dist: tabulate>=0.9.0
18
18
  Requires-Dist: imageio>=2.37.3
19
19
  Requires-Dist: fonttools>=4.0
20
20
  Requires-Dist: bspmap>=1.0.3
21
- Requires-Dist: torchfea>=1.1.6
21
+ Requires-Dist: torchfea>=1.1.7
22
22
  Requires-Dist: trimesh>=4.11.5
23
23
  Requires-Dist: networkx>=3.6.1
24
24
  Requires-Dist: scipy>=1.17.1
25
- Requires-Dist: cpgeo>=1.0.13
25
+ Requires-Dist: cpgeo>=1.0.15
26
26
  Provides-Extra: test
27
27
  Requires-Dist: pytest>=8.0; extra == "test"
28
28
 
@@ -39,7 +39,7 @@ MorphOpt is a differentiable structural optimization framework that combines the
39
39
  - First-order and history-based quadratic FEA surrogates with L-BFGS subproblem solves and explicit step limits
40
40
  - Surface-integrated geometric penalties with fixed, sensitivity-based, or adaptive weights; native FEA sensitivities remain unscaled
41
41
  - Named load cases, ordered solve groups, and per-worker CPU/GPU assignment (one CPU worker by default)
42
- - UI definition, asset preview, saved-log browsing, per-surface/control-net views, and current-view geometry export and history GIF export
42
+ - UI definition, asset preview, saved-log browsing, per-surface/control-net views, and component-specific history export (STEP/STL for boundary surfaces), previewable GIF animations, and Abaqus INP files
43
43
  - Component customization through framework class inheritance
44
44
 
45
45
  ## Quick Start
@@ -81,7 +81,7 @@ Requirements: Python ≥ 3.12; a PyTorch **float64** build is recommended.
81
81
 
82
82
  The GUI opens directly into the full definition workbench with its standard sections present and no problem setup prefilled. Definitions can be created directly in the workbench or generated through **Quickstart**. Quickstart provides shape and topology optimization settings, geometry definitions, and weighted objective terms with associated load conditions. Workspace terms select their driving pressure channels and use boundary integration. Generated problems stay editable and can be saved or exported as runnable folders. Load cases use named interface cards with individually labelled scalar parameters. Workspace objectives automatically register their boundary Gauss-point cases.
83
83
 
84
- The [UI quick start](docs/UIguide.md) covers the complete example from model definition to optimization and result inspection. The [script quick start](docs/scriptguide.md) provides the equivalent runnable Python task.
84
+ The [UI quick start](docs/en-US/ui-quickstart.md) covers the complete example from model definition to optimization and result inspection. The [script quick start](docs/en-US/script-quickstart.md) provides the equivalent runnable Python task.
85
85
 
86
86
  ### Run the UI in a virtual environment
87
87
 
@@ -115,12 +115,14 @@ Shared UI defaults and tunable kernel parameters live in [`src/morphopt/constant
115
115
 
116
116
  ### Documentation
117
117
 
118
+ [English documentation](docs/en-US/README.md) · [简体中文文档](docs/zh-CN/README.md)
119
+
118
120
  | Workflow | Quick start | Module and interface reference |
119
121
  |---|---|---|
120
- | Python script | [Start an optimization](docs/scriptguide.md) | [Define and extend each module](docs/scriptreference.md) |
121
- | Graphical UI | [Create and run the example](docs/UIguide.md) | [Modules, parameters and interface definitions](docs/UIreference.md) |
122
+ | Python script | [Start an optimization](docs/en-US/script-quickstart.md) | [Define and extend each module](docs/en-US/script-reference.md) |
123
+ | Graphical UI | [Create and run the example](docs/en-US/ui-quickstart.md) | [Modules, parameters and interface definitions](docs/en-US/ui-reference.md) |
122
124
 
123
- The [documentation index](docs/README.md) includes the reading order and automatic section numbering commands. Theory and code architecture are documented separately under `docs/theory/` and `docs/codestructure/`.
125
+ The [documentation index](docs/en-US/README.md) includes the reading order and automatic section numbering commands. Theory and code architecture are documented separately under `docs/en-US/theory/` and `docs/en-US/codestructure/`.
124
126
 
125
127
  ## Directory Overview
126
128
 
@@ -11,7 +11,7 @@ MorphOpt is a differentiable structural optimization framework that combines the
11
11
  - First-order and history-based quadratic FEA surrogates with L-BFGS subproblem solves and explicit step limits
12
12
  - Surface-integrated geometric penalties with fixed, sensitivity-based, or adaptive weights; native FEA sensitivities remain unscaled
13
13
  - Named load cases, ordered solve groups, and per-worker CPU/GPU assignment (one CPU worker by default)
14
- - UI definition, asset preview, saved-log browsing, per-surface/control-net views, and current-view geometry export and history GIF export
14
+ - UI definition, asset preview, saved-log browsing, per-surface/control-net views, and component-specific history export (STEP/STL for boundary surfaces), previewable GIF animations, and Abaqus INP files
15
15
  - Component customization through framework class inheritance
16
16
 
17
17
  ## Quick Start
@@ -53,7 +53,7 @@ Requirements: Python ≥ 3.12; a PyTorch **float64** build is recommended.
53
53
 
54
54
  The GUI opens directly into the full definition workbench with its standard sections present and no problem setup prefilled. Definitions can be created directly in the workbench or generated through **Quickstart**. Quickstart provides shape and topology optimization settings, geometry definitions, and weighted objective terms with associated load conditions. Workspace terms select their driving pressure channels and use boundary integration. Generated problems stay editable and can be saved or exported as runnable folders. Load cases use named interface cards with individually labelled scalar parameters. Workspace objectives automatically register their boundary Gauss-point cases.
55
55
 
56
- The [UI quick start](docs/UIguide.md) covers the complete example from model definition to optimization and result inspection. The [script quick start](docs/scriptguide.md) provides the equivalent runnable Python task.
56
+ The [UI quick start](docs/en-US/ui-quickstart.md) covers the complete example from model definition to optimization and result inspection. The [script quick start](docs/en-US/script-quickstart.md) provides the equivalent runnable Python task.
57
57
 
58
58
  ### Run the UI in a virtual environment
59
59
 
@@ -87,12 +87,14 @@ Shared UI defaults and tunable kernel parameters live in [`src/morphopt/constant
87
87
 
88
88
  ### Documentation
89
89
 
90
+ [English documentation](docs/en-US/README.md) · [简体中文文档](docs/zh-CN/README.md)
91
+
90
92
  | Workflow | Quick start | Module and interface reference |
91
93
  |---|---|---|
92
- | Python script | [Start an optimization](docs/scriptguide.md) | [Define and extend each module](docs/scriptreference.md) |
93
- | Graphical UI | [Create and run the example](docs/UIguide.md) | [Modules, parameters and interface definitions](docs/UIreference.md) |
94
+ | Python script | [Start an optimization](docs/en-US/script-quickstart.md) | [Define and extend each module](docs/en-US/script-reference.md) |
95
+ | Graphical UI | [Create and run the example](docs/en-US/ui-quickstart.md) | [Modules, parameters and interface definitions](docs/en-US/ui-reference.md) |
94
96
 
95
- The [documentation index](docs/README.md) includes the reading order and automatic section numbering commands. Theory and code architecture are documented separately under `docs/theory/` and `docs/codestructure/`.
97
+ The [documentation index](docs/en-US/README.md) includes the reading order and automatic section numbering commands. Theory and code architecture are documented separately under `docs/en-US/theory/` and `docs/en-US/codestructure/`.
96
98
 
97
99
  ## Directory Overview
98
100
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "morphopt"
3
- version = "4.0.9"
3
+ version = "4.0.11"
4
4
  description = "A morphing optimization framework using PyTorch and torchfea."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -19,11 +19,11 @@ dependencies = [
19
19
  "imageio>=2.37.3",
20
20
  "fonttools>=4.0",
21
21
  "bspmap>=1.0.3",
22
- "torchfea>=1.1.6",
22
+ "torchfea>=1.1.7",
23
23
  "trimesh>=4.11.5",
24
24
  "networkx>=3.6.1",
25
25
  "scipy>=1.17.1",
26
- "cpgeo>=1.0.13",
26
+ "cpgeo>=1.0.15",
27
27
  ]
28
28
 
29
29
  [project.scripts]
@@ -21,10 +21,14 @@ class _Constants:
21
21
 
22
22
  class OBSERVER:
23
23
  OUTPUT_MAXIMUM_BLOCKS = 10000
24
+ PREVIEW_CACHE_BYTES = (
25
+ 5 * 1024**3
26
+ ) # Shared mesh-data budget for history previews.
24
27
  LOG_READ_MAXIMUM_BYTES = 1024 * 1024
25
28
  POLL_INTERVAL_MS = 1000
26
29
 
27
30
  class CAMERA:
31
+ FIT_VIEW_FRACTION = 0.96
28
32
  FRAME_INTERVAL_MS = 16
29
33
  MOVEMENT_SPEED_RATIO = 0.3
30
34
  FAST_MULTIPLIER = 4.0
@@ -422,9 +426,6 @@ class _Constants:
422
426
  class INIT_LOCATION:
423
427
  DEFAULT = (0.0, 0.0, 0.0)
424
428
 
425
-
426
-
427
-
428
429
  class PERTURBATION_L:
429
430
  DEFAULT = -1.0
430
431
 
@@ -452,7 +453,6 @@ class _Constants:
452
453
  class INIT_LOCATION:
453
454
  DEFAULT = (0.0, 0.0, 0.0)
454
455
 
455
-
456
456
  class PERTURBATION_L:
457
457
  DEFAULT = -1.0
458
458
 
@@ -468,7 +468,6 @@ class _Constants:
468
468
  class INIT_LOCATION:
469
469
  DEFAULT = (0.0, 0.0, 0.0)
470
470
 
471
-
472
471
  class MESH_SURFACE:
473
472
  class PATH_STL:
474
473
  DEFAULT = ""
@@ -1012,6 +1011,8 @@ class _Constants:
1012
1011
 
1013
1012
  class VISUALIZATION:
1014
1013
  WINDOW_SIZE = (1200, 1200)
1014
+ SNAPSHOT_LZMA_LEVEL = 1
1015
+ SNAPSHOT_BLOCK_BYTES = 256 * 1024
1015
1016
  CAMERA_AZIMUTH_DEGREES = 210
1016
1017
  CAMERA_ELEVATION_DEGREES = 20
1017
1018
  INSTANCE_COLORS = ("#2878b5", "#edb120", "#af52cd", "#f15854", "#779548")
@@ -1035,7 +1036,9 @@ class _Constants:
1035
1036
 
1036
1037
  class MESH:
1037
1038
  QUADRATIC_ELEMENT_TYPES = {
1038
- "C3D4": "C3D10", "C3D6": "C3D15", "C3D8": "C3D20",
1039
+ "C3D4": "C3D10",
1040
+ "C3D6": "C3D15",
1041
+ "C3D8": "C3D20",
1039
1042
  }
1040
1043
  SURFACE_ELEMENT_LINE_CHUNK_SIZE = 16
1041
1044
  SURFACE_NODE_LINE_CHUNK_SIZE = 16
@@ -1047,6 +1050,16 @@ class _Constants:
1047
1050
  DEFAULT_ELEMENT_ORDER = 1
1048
1051
 
1049
1052
  class FEA:
1053
+ SPHERICAL_JOINT_VALUES = (1.0, 0.0, 0.0, 0.0)
1054
+ SINGLE_DOF_JOINT_VALUES = (
1055
+ *SPHERICAL_JOINT_VALUES,
1056
+ 0.0,
1057
+ 0.0,
1058
+ 0.0,
1059
+ 0.0,
1060
+ 0.0,
1061
+ 1.0,
1062
+ )
1050
1063
  DEFAULT_TRANSLATION_DOFS = (0, 1, 2)
1051
1064
  CONTACT_PENALTY_THRESHOLD = 3.0
1052
1065
 
@@ -1062,13 +1075,13 @@ class _Constants:
1062
1075
 
1063
1076
  class SHAPE_CONSTRAINTS:
1064
1077
  class FAIRNESS:
1065
- CURVATURE_LIMIT = 3.0
1066
- METRIC_VARIATION_LIMIT = 0.1
1067
- NONORTHOGONALITY_LIMIT = 0.1
1078
+ CURVATURE_LIMIT = 1.0
1079
+ METRIC_VARIATION_LIMIT = 1.0
1080
+ NONORTHOGONALITY_LIMIT = 0.2
1068
1081
  ACTIVATION_RATIO = 0.8
1069
1082
  BSP_EXPONENT = 3
1070
1083
  CPGEO_EXPONENT = 3
1071
- REFERENCE_METRIC_RATIO = 0.2
1084
+ CPGEO_STRETCH_RATIO_LIMIT = 2.5
1072
1085
 
1073
1086
  BARRIER_THRESHOLD = 0.05
1074
1087
  BARRIER_RATIO = 0.0
@@ -1102,19 +1115,19 @@ class _Constants:
1102
1115
  class UPDATER_STRATEGIES:
1103
1116
  DEFAULT_CONSTRAINT_WEIGHT = 1.0
1104
1117
 
1105
- class ADAPTIVE_SHAPE_WEIGHTS:
1118
+ class ADAPTIVE_SHAPE_UPDATE:
1119
+ MAX_SOLVES = 3
1106
1120
  PROBE_FRACTION = 0.5
1107
1121
  SAFETY_FACTOR = 2.0
1108
1122
  BALANCE_RATIO = 0.25
1109
1123
  TIGHTENING_INCREMENT = 0.0002
1110
1124
  VIOLATION_TOLERANCE = 0.1
1111
1125
  VIOLATION_BAND_RATIO = 2.0
1112
- VIOLATION_WEIGHT_POWER = 2.0
1113
1126
  WEIGHT_CHANGE_LIMIT = 10.0
1114
- WEIGHT_UPDATE_FRACTION = 0.1
1115
1127
  INITIAL_TOLERANCE = 0.05
1116
1128
  FINAL_TOLERANCE = 0.0
1117
1129
  DISTANCE_TRANSITION_RATIO = 0.05
1130
+ RETRY_WEIGHT_INCREASE = 4.0
1118
1131
 
1119
1132
  class OPTIMIZER:
1120
1133
  LINE_SEARCH_C1 = 0.0001
@@ -1128,7 +1141,7 @@ class _Constants:
1128
1141
  LBFGS_MATERIAL_MEMORY_PAIRS = 20
1129
1142
 
1130
1143
  class SHAPE_UPDATE:
1131
- MAX_STEP_ITERATIONS = 100
1144
+ MAX_STEP_ITERATIONS = 50
1132
1145
  MAX_STEP_LENGTH = 0.5
1133
1146
  LOW_STEP_LENGTH_TOLERANCE = 1e-10
1134
1147
  LOW_STEP_LENGTH_ITERATION_LIMIT = 10
@@ -1171,6 +1184,9 @@ class _Constants:
1171
1184
  PROJECTION_PARAMETER_MAX = 1.0
1172
1185
 
1173
1186
  class SIMP:
1187
+ EXPORT_VOXEL_SIZE = 1.0
1188
+ EXPORT_DENSITY_THRESHOLD = 0.5
1189
+ EXPORT_SAMPLE_BATCH_SIZE = 8192
1174
1190
  DEFAULT_INITIAL_RATIO = 0.5
1175
1191
  DEFAULT_VOID_PENALTY_FACTOR = 0.01
1176
1192
  DEFAULT_MATERIAL_PENALTY = 8
@@ -3,6 +3,8 @@ from __future__ import annotations
3
3
  from typing import TYPE_CHECKING
4
4
 
5
5
  if TYPE_CHECKING:
6
+ from pyvista import MultiBlock
7
+
6
8
  from .. import ObjectiveFunction, Params, Solver, Updaters
7
9
  import datetime
8
10
  import gc
@@ -13,13 +15,14 @@ import os
13
15
  import shutil
14
16
  import time
15
17
  from multiprocessing import get_context
18
+ from pathlib import Path
16
19
 
17
20
  import torch
18
21
 
19
22
  import morphopt
20
23
 
21
24
  from ..constants import CONSTANT
22
- from ..utils.paths import sanitize_name
25
+ from ..utils.paths import sanitize_name, write_result_launcher
23
26
  from .history import History
24
27
 
25
28
  logger = logging.getLogger(__name__)
@@ -33,21 +36,18 @@ class Controller:
33
36
  task. The controller owns the outer iteration, result directory, persistence, and history
34
37
  collection; numerical responsibilities remain in the composed components.
35
38
  """
39
+
36
40
  class Params:
37
41
  """Declare the model-parameter implementation used by the task controller."""
38
- pass
39
42
 
40
43
  class Solver:
41
44
  """Declare the finite-element solver implementation used by the task controller."""
42
- pass
43
45
 
44
46
  class Updater:
45
47
  """Declare the updater collection used by the task controller."""
46
- pass
47
48
 
48
49
  class ObjectiveFunction:
49
50
  """Declare the physical objective and named metrics used by the task controller."""
50
- pass
51
51
 
52
52
  def __init__(
53
53
  self, path_result_folder: str, opt_label: str = "DefaultLabel"
@@ -104,7 +104,9 @@ class Controller:
104
104
  History: An instance of the History class from the History module to record the optimization history.
105
105
  """
106
106
 
107
- self.restart_per_iteration: int = CONSTANT.KERNEL.CONTROLLER.RESTART_PER_ITERATION
107
+ self.restart_per_iteration: int = (
108
+ CONSTANT.KERNEL.CONTROLLER.RESTART_PER_ITERATION
109
+ )
108
110
  """
109
111
  The frequency of restarting the optimization process.
110
112
  """
@@ -209,9 +211,10 @@ class Controller:
209
211
 
210
212
  main_filepath = __main__.__file__
211
213
  scripts_directory = self.path_result + "/scripts/"
212
- shutil.copy(
213
- main_filepath, scripts_directory + "MAIN_SCRIPT_FOR_RESTART.py"
214
- )
214
+ shutil.copy(main_filepath, scripts_directory + "MAIN_SCRIPT_FOR_RESTART.py")
215
+ definition = Path(main_filepath).with_suffix(".morph")
216
+ if definition.is_file():
217
+ shutil.copyfile(definition, Path(scripts_directory) / "MAIN_SCRIPT_FOR_RESTART.morph")
215
218
  asset_directory = os.path.join(
216
219
  os.path.dirname(os.path.abspath(main_filepath)), "morphopt_assets"
217
220
  )
@@ -224,6 +227,7 @@ class Controller:
224
227
  vendor_package("torchfea", target_dir=self.path_result + "/scripts/")
225
228
  vendor_package("cpgeo", target_dir=self.path_result + "/scripts/")
226
229
  vendor_package("morphopt", target_dir=self.path_result + "/scripts/")
230
+ write_result_launcher(Path(self.path_result))
227
231
 
228
232
  def initialize(self) -> None:
229
233
  """
@@ -247,7 +251,6 @@ class Controller:
247
251
  self.pools = get_context("spawn").Pool(processes=self.solver.num_process)
248
252
 
249
253
  def start_optimization(self, main_filepath: str = None) -> None:
250
-
251
254
  """Initialize a new task and run the outer optimization loop.
252
255
 
253
256
  Create the result directory and log layout, initialize the composed model and numerical
@@ -292,7 +295,6 @@ class Controller:
292
295
  def restart_optimization(
293
296
  self, path_result: str, target_iteration: int = None
294
297
  ) -> None:
295
-
296
298
  """Restore an archived task at a completed checkpoint and continue optimization.
297
299
 
298
300
  Args:
@@ -323,7 +325,7 @@ class Controller:
323
325
  # Explicitly release large objects to ensure they are collected
324
326
  self.clear_cache()
325
327
 
326
- _, t0, t1, t2, t3, t4 = self.step()
328
+ _, t0, t1, t2, t3, t4, design_snapshot = self.step()
327
329
 
328
330
  # Record the history of the optimization process
329
331
  self.record_history(t0, t1, t2, t3, t4)
@@ -332,7 +334,8 @@ class Controller:
332
334
  self.print_info(t0, t1, t2, t3, t4)
333
335
 
334
336
  # Save the current parameters and plot the figures
335
- self.save()
337
+ self.save(design_snapshot)
338
+ del design_snapshot # Release the meshes before building the next FE model.
336
339
 
337
340
  # if dataqueue is not None, send the data to the queue
338
341
  if self.dataqueue is not None:
@@ -356,13 +359,12 @@ class Controller:
356
359
  self.pools.join()
357
360
  return
358
361
 
359
- def step(self):
362
+ def step(self) -> tuple[torch.Tensor, float, float, float, float, float, MultiBlock]:
360
363
  """Execute one complete outer iteration: build, solve, differentiate, and update.
361
364
 
362
365
  Returns:
363
- tuple[torch.Tensor, float, float, float, float, float]: Physical objective and
364
- timestamps t0 through t4 delimiting model construction, FEA, sensitivity analysis,
365
- and design update.
366
+ The physical objective, timestamps t0 through t4, and the design meshes
367
+ used for this solve, captured before the design update.
366
368
  """
367
369
  t0 = time.time()
368
370
 
@@ -379,12 +381,21 @@ class Controller:
379
381
  self.updater.reinitialize(iteration=self.history.iteration)
380
382
  self.objfun.reinitialize(iteration=self.history.iteration)
381
383
 
384
+ if self.history.iteration == 0:
385
+ self.params.geometry.save(
386
+ foldpath=os.path.join(self.path_result, "log"), iteration=0
387
+ )
388
+
382
389
  # Perform the optimization step
383
390
  logger.info(f"Creating FEA model for iteration {self.history.iteration}...")
384
391
  self.objfun.fe = self.params.create_feamodel(
385
392
  path_result=self.path_result + "/cache/", pools=self.pools
386
393
  )
387
394
 
395
+ from ..postprocess.snapshots import capture_design
396
+
397
+ with torch.no_grad():
398
+ design_snapshot = capture_design(self.params)
388
399
  t1 = time.time()
389
400
 
390
401
  # Perform finite element analysis (FEA)
@@ -409,7 +420,7 @@ class Controller:
409
420
 
410
421
  t4 = time.time()
411
422
 
412
- return loss, t0, t1, t2, t3, t4
423
+ return loss, t0, t1, t2, t3, t4, design_snapshot
413
424
 
414
425
  def record_history(
415
426
  self, t0: float, t1: float, t2: float, t3: float, t4: float
@@ -457,26 +468,24 @@ class Controller:
457
468
  logger.info(f" Total Time: {t4 - t0:.2f} seconds")
458
469
  logger.info("-" * 50)
459
470
 
460
- def save(self) -> None:
461
- """
462
- Save the current state of the optimization process.
463
- """
464
- self.params.save(
465
- foldpath=self.path_result + "/log/", iteration=self.history.iteration
466
- )
467
- self.solver.save(
468
- foldpath=self.path_result + "/log/", iteration=self.history.iteration
469
- )
470
- self.updater.save(
471
- foldpath=self.path_result + "/log/", iteration=self.history.iteration
472
- )
473
- self.objfun.save(
474
- foldpath=self.path_result + "/log/", iteration=self.history.iteration
475
- )
471
+ def save(self, design_snapshot: MultiBlock) -> None:
472
+ """Archive the completed solve and its updated design parameters.
473
+
474
+ Args:
475
+ design_snapshot: Design meshes captured for the finite-element solve.
476
+ """
477
+ from ..postprocess.snapshots import save_snapshot
478
+
479
+ log_folder = self.path_result + "/log/"
480
+ iteration = self.history.iteration
481
+ self.params.save(foldpath=log_folder, iteration=iteration)
482
+ self.solver.save(foldpath=log_folder, iteration=iteration)
483
+ self.updater.save(foldpath=log_folder, iteration=iteration)
484
+ self.objfun.save(foldpath=log_folder, iteration=iteration)
485
+ with torch.no_grad():
486
+ save_snapshot(log_folder, iteration, design_snapshot, self.objfun)
476
487
  # Publish a completed iteration only after its model and results exist.
477
- self.history.save(
478
- foldpath=self.path_result + "/log/", iteration=self.history.iteration
479
- )
488
+ self.history.save(foldpath=log_folder, iteration=iteration)
480
489
 
481
490
  def clear_cache(self) -> None:
482
491
  """
@@ -200,14 +200,6 @@ class BaseParams(
200
200
  f"{list(self.interfaces)}."
201
201
  ) from None
202
202
 
203
- def export_data(self, foldpath: str):
204
- """
205
- Export the data of parameters to file(s).
206
-
207
- Args:
208
- foldpath (str): The path to export the data.
209
- """
210
-
211
203
  def save(self, foldpath: str, iteration: int) -> None:
212
204
  """Save the state of every registered interface.
213
205
 
@@ -2,6 +2,7 @@ from .base_component import BaseFEAComponent
2
2
  from .pressure import Pressure
3
3
  from .contact import Contact, SelfContact
4
4
  from .point_load import ConcentratedForce, ConcentratedMoment
5
+ from .joint import SingleDoFJoint, SphericalJoint
5
6
  from .spring import SpringToGround, SpringBetweenRPs, PenaltyDoF
6
7
  from .couple import Couple
7
8
  from .boundary_condition import BoundaryCondition, ReferencePointBoundaryCondition
@@ -0,0 +1,75 @@
1
+ """TorchFEA penalty joints connecting two six-DoF reference points."""
2
+
3
+ from torchfea import FEAController
4
+ from torchfea.model import loads
5
+
6
+ from ....constants import CONSTANT
7
+ from .base_component import BaseFEAComponent
8
+
9
+
10
+ class _ReferencePointJoint(BaseFEAComponent):
11
+ """Register the two endpoints and apply the common per-case joint parameters."""
12
+
13
+ default_values = CONSTANT.KERNEL.FEA.SPHERICAL_JOINT_VALUES
14
+
15
+ def __init__(self, rp_name1: str, rp_name2: str) -> None:
16
+ """Connect two distinct reference points.
17
+
18
+ Args:
19
+ rp_name1: Reference point carrying the joint's local frame.
20
+ rp_name2: Reference point whose relative motion is constrained.
21
+ """
22
+ super().__init__()
23
+ self.rp_name1 = rp_name1
24
+ self.rp_name2 = rp_name2
25
+ self._values = list(self.default_values)
26
+
27
+ @property
28
+ def num_values(self) -> int:
29
+ """Number of scalar joint parameters in a load case."""
30
+ return len(self.default_values)
31
+
32
+ def apply_fea_value(self, fe: FEAController, name: str) -> None:
33
+ """Apply the penalty stiffness and initial global connection point."""
34
+ joint = fe.assembly.get_load(name)
35
+ joint.k = self._values[0]
36
+ joint.connection_point = self._values[1:4]
37
+
38
+
39
+ class SphericalJoint(_ReferencePointJoint):
40
+ """Constrain relative translation at a point and allow all relative rotations.
41
+
42
+ Load-case values are [k, x, y, z], with positive penalty stiffness k.
43
+ """
44
+
45
+ def modify_fea(self, fe: FEAController, name: str) -> None:
46
+ """Register the spherical joint with the assembly before case selection."""
47
+ joint = loads.SphericalJoint(
48
+ self.rp_name1, self.rp_name2,
49
+ connection_point=self._values[1:4], k=self._values[0],
50
+ )
51
+ fe.assembly.add_load(joint, name)
52
+
53
+
54
+ class SingleDoFJoint(_ReferencePointJoint):
55
+ """Allow one relative motion in RP 1's frame and penalize the other five.
56
+
57
+ Load-case values are [k, x, y, z, tx, ty, tz, rx, ry, rz]. The final
58
+ six entries specify a nonzero free direction, initially in global axes.
59
+ """
60
+
61
+ default_values = CONSTANT.KERNEL.FEA.SINGLE_DOF_JOINT_VALUES
62
+
63
+ def modify_fea(self, fe: FEAController, name: str) -> None:
64
+ """Register the single-DoF joint with the assembly before case selection."""
65
+ joint = loads.SingleDoFJoint(
66
+ self.rp_name1, self.rp_name2,
67
+ connection_point=self._values[1:4], free_direction=self._values[4:],
68
+ k=self._values[0],
69
+ )
70
+ fe.assembly.add_load(joint, name)
71
+
72
+ def apply_fea_value(self, fe: FEAController, name: str) -> None:
73
+ """Apply the common joint parameters and the case's free direction."""
74
+ super().apply_fea_value(fe, name)
75
+ fe.assembly.get_load(name).free_direction = self._values[4:]
@@ -22,6 +22,8 @@ class FEAParams(BaseParams):
22
22
  PenaltyDoF,
23
23
  Pressure,
24
24
  ReferencePoint,
25
+ SingleDoFJoint,
26
+ SphericalJoint,
25
27
  SpringBetweenRPs,
26
28
  SpringToGround,
27
29
  )
@@ -80,12 +80,3 @@ class GeometryParams(BaseParams):
80
80
  for interface in self.interfaces.values():
81
81
  interface.add_to_assembly(assembly, path_result=path_result, pools=pools)
82
82
  return assembly
83
-
84
- def export_data(self, foldpath: str) -> None:
85
- """Export the geometry description of every interface.
86
-
87
- Args:
88
- foldpath (str): Root log directory containing this component's namespaced state files.
89
- """
90
- for interface in self.interfaces.values():
91
- interface.export_data(interface.workdir(foldpath))
@@ -202,17 +202,9 @@ class Params(
202
202
  iteration (int): Iteration index associated with the saved or current model state.
203
203
  """
204
204
  self.geometry.load(foldpath=foldpath, iteration=iteration)
205
+ self.feamodel.load(foldpath=foldpath, iteration=iteration)
205
206
  self.materials.load(foldpath=foldpath, iteration=iteration)
206
207
 
207
- def export_data(self, filepath: str) -> None:
208
- """
209
- Export the data of parameters to file(s).
210
-
211
- Args:
212
- filepath (str): The path to export the data.
213
- """
214
- self.geometry.export_data(foldpath=filepath)
215
-
216
208
  def plot(
217
209
  self, plotter: pv.Plotter | None = None, meshes: list[pv.DataSet] | None = None
218
210
  ) -> pv.Plotter: