morphopt 4.0.8__tar.gz → 4.0.9__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 (240) hide show
  1. {morphopt-4.0.8 → morphopt-4.0.9}/PKG-INFO +3 -3
  2. {morphopt-4.0.8 → morphopt-4.0.9}/pyproject.toml +3 -3
  3. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/__init__.py +20 -18
  4. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/constraints.py +144 -24
  5. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/offset_boundary_part.py +81 -6
  6. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/constants.py +39 -15
  7. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/opt_runner.py +63 -6
  8. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/__init__.py +4 -3
  9. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/controller.py +107 -63
  10. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/history.py +44 -4
  11. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/baseparam.py +97 -22
  12. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/base_component.py +12 -5
  13. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/body_force.py +17 -2
  14. morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/boundary_condition.py +100 -0
  15. morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/contact.py +139 -0
  16. morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/couple.py +44 -0
  17. morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/point_load.py +140 -0
  18. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/pressure.py +25 -10
  19. morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/reference_point.py +37 -0
  20. morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/spring.py +305 -0
  21. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/feaparams.py +25 -11
  22. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/geometry.py +26 -3
  23. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/base_material.py +51 -7
  24. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/homogeneous_material.py +5 -1
  25. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/models.py +10 -1
  26. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materialsparams.py +10 -0
  27. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/params.py +70 -31
  28. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/base_part.py +115 -12
  29. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/box_part.py +31 -0
  30. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/cad_part.py +204 -23
  31. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/fixed_part.py +60 -6
  32. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/inp_part.py +26 -6
  33. morphopt-4.0.9/src/morphopt/optcore/objfunc.py +350 -0
  34. morphopt-4.0.9/src/morphopt/optcore/protocal.py +234 -0
  35. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/solver.py +101 -77
  36. morphopt-4.0.9/src/morphopt/optcore/strategies.py +144 -0
  37. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/updaters.py +430 -105
  38. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/_runtime.py +25 -3
  39. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/archive.py +154 -11
  40. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/exports.py +134 -10
  41. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/fields.py +174 -6
  42. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/visualization.py +82 -12
  43. morphopt-4.0.9/src/morphopt/shapeopt/barriers.py +75 -0
  44. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/boundary_part.py +223 -35
  45. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/basefuncs.py +33 -12
  46. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/boundarys.py +35 -4
  47. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/distancesurface.py +25 -7
  48. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/shapederivative.py +77 -7
  49. morphopt-4.0.9/src/morphopt/shapeopt/objectivefuncs/surfacefairness.py +320 -0
  50. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/volumemaximization.py +23 -0
  51. morphopt-4.0.9/src/morphopt/shapeopt/strategies.py +448 -0
  52. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/base_constraints.py +73 -31
  53. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/base_surface.py +324 -80
  54. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/brep_surface.py +357 -34
  55. morphopt-4.0.9/src/morphopt/shapeopt/surfaces/bsp_constraints.py +349 -0
  56. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/bsp_surface.py +216 -48
  57. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/cpgeo_constraints.py +79 -27
  58. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/cpgeo_surface.py +122 -37
  59. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/mesh_surface.py +53 -5
  60. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/nurbs_face.py +181 -24
  61. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/update_boundary_part.py +72 -27
  62. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/objectivefuncs/basefuncs.py +15 -48
  63. morphopt-4.0.9/src/morphopt/simp/objectivefuncs/boundarys.py +104 -0
  64. morphopt-4.0.9/src/morphopt/simp/objectivefuncs/densityfield.py +53 -0
  65. morphopt-4.0.9/src/morphopt/simp/objectivefuncs/sensitivity.py +133 -0
  66. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/objectivefuncs/volfrac.py +29 -0
  67. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/simpmaterial.py +210 -32
  68. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/update_simpmaterial.py +79 -30
  69. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/void_elements.py +127 -2
  70. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/__init__.py +6 -3
  71. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/app.py +10 -2
  72. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/cad.py +73 -8
  73. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/completion.py +58 -9
  74. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/definitions.py +168 -16
  75. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/devices.py +5 -1
  76. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/edit_history.py +140 -1
  77. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/editing.py +345 -23
  78. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/editor_routing.py +20 -2
  79. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/expressions.py +19 -0
  80. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/fields.py +90 -11
  81. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/finite_element.py +76 -5
  82. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/load_cases.py +109 -5
  83. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/part_mesh.py +12 -2
  84. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/part_sets.py +117 -2
  85. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/quickstart.py +99 -3
  86. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/results.py +73 -3
  87. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/runs.py +111 -4
  88. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/updaters.py +136 -2
  89. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/validation.py +155 -5
  90. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/values.py +33 -6
  91. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application_icon.py +15 -3
  92. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/assets.py +15 -1
  93. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/custom_classes.py +93 -4
  94. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/generator.py +280 -47
  95. {morphopt-4.0.8/src/morphopt/ui/schemes → morphopt-4.0.9/src/morphopt/ui/codegen}/snippets.py +21 -5
  96. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/workspace.py +35 -5
  97. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/i18n.py +66 -5
  98. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/launcher.py +91 -17
  99. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/locales/en-US.json +43 -24
  100. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/locales/zh-CN.json +43 -24
  101. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/mainwindow.py +113 -12
  102. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/base_nodes.py +344 -26
  103. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/chamberlayout.py +13 -0
  104. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/configuration.py +97 -16
  105. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/fields.py +14 -0
  106. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/loaders.py +91 -8
  107. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/__init__.py +8 -0
  108. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/custom_code.py +69 -0
  109. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/loads.py +36 -3
  110. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/parts.py +94 -0
  111. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/structural.py +320 -10
  112. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/surfaces.py +2 -0
  113. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/symmetry.py +63 -0
  114. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/problem.py +597 -90
  115. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/registry.py +47 -1
  116. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/strategies.py +27 -4
  117. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/observe_panel.py +107 -12
  118. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/edit_history.py +9 -1
  119. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/history.py +28 -0
  120. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/labels.py +195 -9
  121. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/navigation.py +118 -7
  122. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/result_fields.py +25 -3
  123. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/processes.py +11 -2
  124. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/refresh.py +42 -1
  125. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/__init__.py +7 -1
  126. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/fonts.py +116 -7
  127. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/manager.py +63 -9
  128. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/palette.py +16 -0
  129. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/base.qss +1 -1
  130. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/stylesheet.py +9 -1
  131. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/themes/dark.py +24 -0
  132. morphopt-4.0.9/src/morphopt/ui/theme/themes/light.py +117 -0
  133. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/visualization.py +16 -0
  134. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/assets.py +9 -1
  135. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/geometry.py +473 -17
  136. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/loads.py +205 -1
  137. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/rendering.py +28 -3
  138. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/scene.py +63 -2
  139. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/asset_browser.py +65 -2
  140. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/case_deletion.py +9 -1
  141. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/codeeditor.py +90 -7
  142. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/collection_controls.py +52 -1
  143. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/controller_editor.py +29 -1
  144. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/custom_classes.py +57 -0
  145. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/definition_actions.py +248 -4
  146. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/definition_manager.py +27 -5
  147. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/edit_history.py +55 -1
  148. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/editor.py +86 -4
  149. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/editor_pages.py +34 -1
  150. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/file_dialogs.py +72 -6
  151. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/finite_element.py +57 -11
  152. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/font_settings.py +6 -0
  153. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/helper_editor.py +31 -0
  154. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/history_dialogs.py +7 -0
  155. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/history_export.py +34 -0
  156. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/labels.py +53 -0
  157. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/load_cases.py +17 -0
  158. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/model_tree.py +108 -15
  159. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/objective_editor.py +53 -3
  160. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/observation_pages.py +58 -2
  161. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/param_form.py +40 -3
  162. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/part_set_list.py +16 -0
  163. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/preview_renderer.py +88 -22
  164. morphopt-4.0.9/src/morphopt/ui/widgets/problems.py +119 -0
  165. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/quickstart.py +157 -44
  166. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/run_dialogs.py +11 -0
  167. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/sequence_input.py +19 -0
  168. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/solver_editor.py +19 -0
  169. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/source_view.py +12 -0
  170. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/template_insert_dialog.py +36 -3
  171. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/updater_editor.py +131 -27
  172. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/viewer.py +74 -15
  173. morphopt-4.0.9/src/morphopt/ui/widgets/viewport.py +562 -0
  174. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/visualization_settings.py +11 -0
  175. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/workspace_objective.py +12 -0
  176. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/workbench.py +110 -22
  177. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/worker.py +9 -1
  178. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/gradient_check.py +48 -0
  179. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/history_read.py +5 -4
  180. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/paths.py +8 -1
  181. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/quadrature.py +17 -7
  182. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/PKG-INFO +3 -3
  183. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/SOURCES.txt +2 -3
  184. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/requires.txt +2 -2
  185. morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/boundary_condition.py +0 -76
  186. morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/contact.py +0 -117
  187. morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/couple.py +0 -35
  188. morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/point_load.py +0 -79
  189. morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/reference_point.py +0 -29
  190. morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/spring.py +0 -156
  191. morphopt-4.0.8/src/morphopt/optcore/objfunc.py +0 -232
  192. morphopt-4.0.8/src/morphopt/optcore/protocal.py +0 -130
  193. morphopt-4.0.8/src/morphopt/optcore/strategies.py +0 -87
  194. morphopt-4.0.8/src/morphopt/shapeopt/barriers.py +0 -38
  195. morphopt-4.0.8/src/morphopt/shapeopt/objectivefuncs/surfacefairness.py +0 -164
  196. morphopt-4.0.8/src/morphopt/shapeopt/strategies.py +0 -360
  197. morphopt-4.0.8/src/morphopt/shapeopt/surfaces/bsp_constraints.py +0 -89
  198. morphopt-4.0.8/src/morphopt/simp/objectivefuncs/boundarys.py +0 -76
  199. morphopt-4.0.8/src/morphopt/simp/objectivefuncs/densityfield.py +0 -29
  200. morphopt-4.0.8/src/morphopt/simp/objectivefuncs/sensitivity.py +0 -72
  201. morphopt-4.0.8/src/morphopt/ui/schemes/__init__.py +0 -26
  202. morphopt-4.0.8/src/morphopt/ui/schemes/base.py +0 -407
  203. morphopt-4.0.8/src/morphopt/ui/theme/themes/light.py +0 -130
  204. morphopt-4.0.8/src/morphopt/ui/widgets/viewport.py +0 -159
  205. {morphopt-4.0.8 → morphopt-4.0.9}/README.md +0 -0
  206. {morphopt-4.0.8 → morphopt-4.0.9}/setup.cfg +0 -0
  207. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/__init__.py +0 -0
  208. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/update_offset_boundary_part.py +0 -0
  209. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/__init__.py +0 -0
  210. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/base_model_component.py +0 -0
  211. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/__init__.py +0 -0
  212. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/__init__.py +0 -0
  213. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/__init__.py +0 -0
  214. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/__init__.py +0 -0
  215. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/__init__.py +0 -0
  216. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/__init__.py +0 -0
  217. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/__init__.py +0 -0
  218. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/__init__.py +0 -0
  219. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/objectivefuncs/__init__.py +0 -0
  220. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/__main__.py +0 -0
  221. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/__init__.py +0 -0
  222. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/assets/morphopt.svg +0 -0
  223. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/__init__.py +0 -0
  224. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/__init__.py +0 -0
  225. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/material_models.py +0 -0
  226. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/cad.py +0 -0
  227. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/materials.py +0 -0
  228. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/objectives.py +0 -0
  229. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/penalties.py +0 -0
  230. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/__init__.py +0 -0
  231. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/__init__.py +0 -0
  232. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/controls.qss +0 -0
  233. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/inputs.qss +0 -0
  234. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/themes/__init__.py +0 -0
  235. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/__init__.py +0 -0
  236. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/__init__.py +0 -0
  237. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/__init__.py +0 -0
  238. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/dependency_links.txt +0 -0
  239. {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/entry_points.txt +0 -0
  240. {morphopt-4.0.8 → morphopt-4.0.9}/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.8
3
+ Version: 4.0.9
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.5
21
+ Requires-Dist: torchfea>=1.1.6
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.12
25
+ Requires-Dist: cpgeo>=1.0.13
26
26
  Provides-Extra: test
27
27
  Requires-Dist: pytest>=8.0; extra == "test"
28
28
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "morphopt"
3
- version = "4.0.8"
3
+ version = "4.0.9"
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.5",
22
+ "torchfea>=1.1.6",
23
23
  "trimesh>=4.11.5",
24
24
  "networkx>=3.6.1",
25
25
  "scipy>=1.17.1",
26
- "cpgeo>=1.0.12",
26
+ "cpgeo>=1.0.13",
27
27
  ]
28
28
 
29
29
  [project.scripts]
@@ -15,22 +15,22 @@ import logging as __logging
15
15
 
16
16
 
17
17
  def enable_logging(level=__logging.INFO, log_file=None, file_log_level=__logging.DEBUG):
18
- """
19
- Enable logging for the FEA package.
20
-
21
- Parameters
22
- ----------
23
- level : int
24
- the logging level (e.g., logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, logging.CRITICAL)
25
- log_file : str, optional
26
- the path to a log file where logs will be written. If None, logs will only be printed to the console.
27
- file_log_level : int
28
- the logging level for the log file. Default is logging.INFO.
29
-
30
- Examples
31
- --------
32
- >>> import torchfea
33
- >>> torchfea.enable_logging(level=logging.DEBUG, log_file='fem.log')
18
+ """Configure console and optional file handlers for the MorphOpt package logger.
19
+
20
+ Existing handlers on this logger are replaced so repeated setup does not duplicate messages.
21
+
22
+ Args:
23
+ level: Console logging threshold; defaults to logging.INFO.
24
+ log_file: Optional UTF-8 log file path. Its parent directory must already exist.
25
+ file_log_level: File logging threshold; defaults to logging.DEBUG.
26
+
27
+ Returns:
28
+ logging.Logger: Configured package logger with the requested handlers.
29
+
30
+ Examples:
31
+ >>> import logging
32
+ >>> import morphopt
33
+ >>> logger = morphopt.enable_logging(level=logging.INFO)
34
34
  """
35
35
  logger = __logging.getLogger(__name__)
36
36
  logger.setLevel(min(level, file_log_level))
@@ -69,6 +69,7 @@ def enable_logging(level=__logging.INFO, log_file=None, file_log_level=__logging
69
69
  from . import codesign, shapeopt, simp
70
70
  from .codesign import OffsetBoundaryPart, UpdaterOffsetBoundaryPart
71
71
  from .opt_runner import debug_optimization, start_optimization
72
+ from .optcore import strategies
72
73
  from .optcore.controller import Controller
73
74
  from .optcore.history import History
74
75
  from .optcore.modelparams import (
@@ -76,8 +77,8 @@ from .optcore.modelparams import (
76
77
  BasePart,
77
78
  BoxPart,
78
79
  CADPart,
79
- FixedPart,
80
80
  FEAParams,
81
+ FixedPart,
81
82
  GeometryParams,
82
83
  INPPart,
83
84
  MaterialsParams,
@@ -86,13 +87,13 @@ from .optcore.modelparams import (
86
87
  from .optcore.modelparams.materials import HomogeneousMaterial
87
88
  from .optcore.objfunc import ObjectiveFunction
88
89
  from .optcore.protocal import (
90
+ ProtocalHistory,
89
91
  ProtocalInitializable,
90
92
  ProtocalSavable,
91
93
  ProtocalUpdatable,
92
94
  ProtocalVisualizable,
93
95
  )
94
96
  from .optcore.solver import Solver
95
- from .optcore import strategies
96
97
  from .optcore.updaters import Updaters
97
98
  from .shapeopt import (
98
99
  BaseSurfaceConstraints,
@@ -133,6 +134,7 @@ __all__ = [
133
134
  "ObjectiveFunction",
134
135
  "OffsetBoundaryPart",
135
136
  "Params",
137
+ "ProtocalHistory",
136
138
  "ProtocalInitializable",
137
139
  "ProtocalSavable",
138
140
  "ProtocalUpdatable",
@@ -27,21 +27,26 @@ class InwardCurvatureRadius(BaseConstraints):
27
27
  hard_violation_beta: float = CONSTANT.KERNEL.CODESIGN.HARD_VIOLATION_BETA,
28
28
  normal_sign: float = 1.0,
29
29
  ) -> None:
30
- """
31
- Initialize the inward curvature radius constraint.
30
+ """Initialize the inward curvature radius constraint.
32
31
 
33
32
  Args:
34
- surface_start (int, optional): The starting index of surfaces to apply the constraint. Defaults to 1.
35
- surface_ids (list[int] | None, optional): The specific surface indices to apply the constraint. If None, applies to all surfaces starting from surface_start. Defaults to None.
36
- margin (float, optional): The absolute margin added to thickness for curvature limit. Defaults to 0.4.
37
- margin_ratio (float, optional): The ratio of thickness to determine margin if margin is None. Defaults to 0.45.
38
- barrier_thre_ratio (float, optional): The ratio of curvature limit to determine the barrier threshold. Defaults to 0.1.
39
- barrier_ratio (float, optional): The ratio to scale the barrier penalty. Defaults to 0.0.
40
- p (int, optional): The power for the barrier function. Defaults to 8.
41
- penalty_scale (float, optional): Global multiplier for this constraint penalty. Defaults to 1e3.
42
- hard_violation_beta (float, optional): Exponential amplification factor for large violations. Defaults to 8.0.
43
- normal_sign (float, optional): The sign to determine inward direction. Use 1.0 if normals point outward, -1.0 if normals point inward. Defaults to 1.0.
44
-
33
+ surface_start (int): The starting index of surfaces to apply the constraint. Defaults to
34
+ 1.
35
+ surface_ids (list[int] | None): The specific surface indices to apply the constraint. If
36
+ None, applies to all surfaces starting from surface_start. Defaults to None.
37
+ margin (float): The absolute margin added to thickness for curvature limit. Defaults to
38
+ 0.4.
39
+ margin_ratio (float): The ratio of thickness to determine margin if margin is None.
40
+ Defaults to 0.45.
41
+ barrier_thre_ratio (float): The ratio of curvature limit to determine the barrier
42
+ threshold. Defaults to 0.1.
43
+ barrier_ratio (float): The ratio to scale the barrier penalty. Defaults to 0.0.
44
+ p (int): The power for the barrier function. Defaults to 8.
45
+ penalty_scale (float): Global multiplier for this constraint penalty. Defaults to 1e3.
46
+ hard_violation_beta (float): Exponential amplification factor for large violations.
47
+ Defaults to 8.0.
48
+ normal_sign (float): The sign to determine inward direction. Use 1.0 if normals point
49
+ outward, -1.0 if normals point inward. Defaults to 1.0.
45
50
  """
46
51
 
47
52
  super().__init__()
@@ -76,6 +81,19 @@ class InwardCurvatureRadius(BaseConstraints):
76
81
  rdu2: torch.Tensor,
77
82
  eps: float = CONSTANT.KERNEL.CODESIGN.GEOMETRY_TOLERANCE,
78
83
  ) -> tuple[torch.Tensor, torch.Tensor]:
84
+ """Compute oriented principal curvatures from the first and second fundamental forms.
85
+
86
+ Args:
87
+ rdu (torch.Tensor): Current first surface derivatives; each block has shape (num_points,
88
+ 3, 2).
89
+ rdu2 (torch.Tensor): Current second surface derivatives; each block has shape
90
+ (num_points, 3, 2, 2).
91
+ eps (float): Positive numerical regularization or finite-difference increment.
92
+
93
+ Returns:
94
+ tuple[torch.Tensor, torch.Tensor]: Principal curvature arrays k1 and k2, each with shape
95
+ (num_points,), using the cross(dv, du) normal.
96
+ """
79
97
  normal0 = torch.cross(rdu[:, :, 1], rdu[:, :, 0], dim=1)
80
98
  normal = normal0 / (normal0.norm(dim=1, keepdim=True) + eps)
81
99
 
@@ -99,8 +117,15 @@ class InwardCurvatureRadius(BaseConstraints):
99
117
  """Take the Part this constraint is evaluated for.
100
118
 
101
119
  The geometry updater hands over the Part it evaluates; only a
102
- :class:`~morphopt.codesign.OffsetBoundaryPart` carries a
103
- shell, so anything else is rejected here.
120
+ :class:`~morphopt.codesign.OffsetBoundaryPart` carries a shell, so anything else is rejected
121
+ here.
122
+
123
+ Args:
124
+ r0: Initial cylinder radius, or reference sample positions for a surface objective.
125
+ rdu0: Reference first derivatives with one surface block of shape (num_points, 3, 2).
126
+ part_interface: Kernel Part interface selected as the geometry target.
127
+ *args: Additional positional arguments accepted by the shared interface.
128
+ **kwargs: Additional keyword arguments accepted by the shared interface.
104
129
  """
105
130
  super().initialize(r0=r0, rdu0=rdu0, *args, **kwargs)
106
131
  if not isinstance(part_interface, OffsetBoundaryPart):
@@ -111,6 +136,14 @@ class InwardCurvatureRadius(BaseConstraints):
111
136
  self.shell_thickness = float(part_interface.shell_thickness)
112
137
 
113
138
  def _selected_surface_ids(self, n_surface: int) -> list[int]:
139
+ """Resolve the configured surface selection within the available boundary range.
140
+
141
+ Args:
142
+ n_surface (int): Number of boundary surfaces represented by the geometry configuration.
143
+
144
+ Returns:
145
+ list[int]: Valid zero-based surface indices in their configured order.
146
+ """
114
147
  if self.surface_ids is None:
115
148
  return [i for i in range(max(self.surface_start, 0), n_surface)]
116
149
  return [i for i in self.surface_ids if 0 <= i < n_surface]
@@ -123,6 +156,21 @@ class InwardCurvatureRadius(BaseConstraints):
123
156
  *args,
124
157
  **kwargs,
125
158
  ) -> torch.Tensor:
159
+ """Evaluate InwardCurvatureRadius for the supplied inputs.
160
+
161
+ Args:
162
+ r (list[torch.Tensor]): Current Cartesian surface samples; each surface block has shape
163
+ (num_points, 3).
164
+ rdu (list[torch.Tensor]): Current first surface derivatives; each block has shape
165
+ (num_points, 3, 2).
166
+ rdu2 (list[torch.Tensor]): Current second surface derivatives; each block has shape
167
+ (num_points, 3, 2, 2).
168
+ *args: Additional positional arguments accepted by the shared interface.
169
+ **kwargs: Additional keyword arguments accepted by the shared interface.
170
+
171
+ Returns:
172
+ torch.Tensor: One-element integrated penalty for excessive inward principal curvature.
173
+ """
126
174
  loss = torch.zeros(1, device=r[0].device, dtype=r[0].dtype)
127
175
 
128
176
  for i in self._selected_surface_ids(len(r)):
@@ -189,14 +237,29 @@ class OffsetSurfaceMinThickness(BaseConstraints):
189
237
  normal_min: float = CONSTANT.KERNEL.CODESIGN.NORMAL_TRANSITION_MIN,
190
238
  normal_max: float = CONSTANT.KERNEL.CODESIGN.NORMAL_TRANSITION_MAX,
191
239
  ) -> None:
192
- """
193
- Initialize the minimum thickness constraint for the offset surface.
240
+ """Initialize the minimum thickness constraint for the offset surface.
194
241
 
195
242
  Args:
196
- surface_start (int, optional): The starting index of surfaces to apply the constraint. Defaults to 1.
197
- surface_ids (list[int] | None, optional): The specific surface indices to apply the constraint. If None, applies to all surfaces starting from surface_start. Defaults to None.
198
- min_distance (float | None, optional): The required minimum distance.
199
- Defaults to twice the shell thickness.
243
+ surface_start (int): The starting index of surfaces to apply the constraint. Defaults to
244
+ 1.
245
+ surface_ids (list[int] | None): The specific surface indices to apply the constraint. If
246
+ None, applies to all surfaces starting from surface_start. Defaults to None.
247
+ min_distance (float | None): The required minimum distance. Defaults to twice the shell
248
+ thickness.
249
+ search_ratio (float): Distance-search radius relative to the configured geometric
250
+ spacing.
251
+ barrier_thre_ratio (float): Barrier activation threshold relative to the configured
252
+ geometric limit.
253
+ barrier_ratio (float): Activation threshold as a fraction of the barrier limit.
254
+ p (int): Polynomial penalty exponent.
255
+ penalty_scale (float): Scalar multiplying the constructed constraint contribution.
256
+ hard_violation_beta (float): Barrier-growth coefficient for strongly violated distance
257
+ constraints.
258
+ normal_sign (float): Orientation sign applied to the surface-normal comparison.
259
+ normal_opposition_thre (float): Normal-opposition threshold used to filter candidate
260
+ surface pairs.
261
+ normal_min (float): Lower bound on the normal-alignment criterion.
262
+ normal_max (float): Upper bound on the normal-alignment criterion.
200
263
  """
201
264
  super().__init__()
202
265
 
@@ -236,12 +299,28 @@ class OffsetSurfaceMinThickness(BaseConstraints):
236
299
  """Stores the neighbor mindist used by OffsetSurfaceMinThickness."""
237
300
 
238
301
  def _selected_surface_ids(self, n_surface: int) -> list[int]:
302
+ """Resolve the configured surface selection within the available boundary range.
303
+
304
+ Args:
305
+ n_surface (int): Number of boundary surfaces represented by the geometry configuration.
306
+
307
+ Returns:
308
+ list[int]: Valid zero-based surface indices in their configured order.
309
+ """
239
310
  if self.surface_ids is None:
240
311
  return [i for i in range(max(self.surface_start, 0), n_surface)]
241
312
  return [i for i in self.surface_ids if 0 <= i < n_surface]
242
313
 
243
314
  @staticmethod
244
315
  def _surface_normals(rdu_sf: torch.Tensor) -> torch.Tensor:
316
+ """Compute regularized unit normals using the surface parameter orientation.
317
+
318
+ Args:
319
+ rdu_sf (torch.Tensor): Surface first derivatives used to construct the offset geometry.
320
+
321
+ Returns:
322
+ torch.Tensor: Cartesian normals with shape (num_points, 3), oriented by cross(dv, du).
323
+ """
245
324
  normal0 = torch.cross(rdu_sf[:, :, 1], rdu_sf[:, :, 0], dim=1)
246
325
  normals = normal0 / (
247
326
  normal0.norm(dim=1, keepdim=True)
@@ -252,11 +331,29 @@ class OffsetSurfaceMinThickness(BaseConstraints):
252
331
  def _offset_points(
253
332
  self, r_sf: torch.Tensor, rdu_sf: torch.Tensor, thickness: float
254
333
  ) -> tuple[torch.Tensor, torch.Tensor]:
255
- """Offset surface points and the normals they were offset along."""
334
+ """Offset surface points and the normals they were offset along.
335
+
336
+ Args:
337
+ r_sf (torch.Tensor): Reference Cartesian samples of the surface being offset.
338
+ rdu_sf (torch.Tensor): Surface first derivatives used to construct the offset geometry.
339
+ thickness (float): Offset-layer thickness in model length units.
340
+
341
+ Returns:
342
+ tuple[torch.Tensor, torch.Tensor]: Offset surface points and the normals they were
343
+ offset along.
344
+ """
256
345
  normals = self._surface_normals(rdu_sf=rdu_sf)
257
346
  return r_sf + self.normal_sign * thickness * normals, normals
258
347
 
259
348
  def _min_distance(self, thickness: float) -> float:
349
+ """Resolve the explicit separation requirement or the shell-thickness default.
350
+
351
+ Args:
352
+ thickness (float): Offset-layer thickness in model length units.
353
+
354
+ Returns:
355
+ float: Positive required separation in model length units; defaults to twice thickness.
356
+ """
260
357
  dmin = (
261
358
  float(self.min_distance)
262
359
  if self.min_distance is not None
@@ -268,8 +365,15 @@ class OffsetSurfaceMinThickness(BaseConstraints):
268
365
  """Take the Part this constraint is evaluated for and pair its points.
269
366
 
270
367
  The geometry updater hands over the Part it evaluates; only a
271
- :class:`~morphopt.codesign.OffsetBoundaryPart` carries a
272
- shell, so anything else is rejected here.
368
+ :class:`~morphopt.codesign.OffsetBoundaryPart` carries a shell, so anything else is rejected
369
+ here.
370
+
371
+ Args:
372
+ r0: Initial cylinder radius, or reference sample positions for a surface objective.
373
+ rdu0: Reference first derivatives with one surface block of shape (num_points, 3, 2).
374
+ part_interface: Kernel Part interface selected as the geometry target.
375
+ *args: Additional positional arguments accepted by the shared interface.
376
+ **kwargs: Additional keyword arguments accepted by the shared interface.
273
377
  """
274
378
  super().initialize(r0=r0, rdu0=rdu0, *args, **kwargs)
275
379
  if not isinstance(part_interface, OffsetBoundaryPart):
@@ -320,6 +424,22 @@ class OffsetSurfaceMinThickness(BaseConstraints):
320
424
  *args,
321
425
  **kwargs,
322
426
  ) -> torch.Tensor:
427
+ """Evaluate OffsetSurfaceMinThickness for the supplied inputs.
428
+
429
+ Args:
430
+ r (list[torch.Tensor]): Current Cartesian surface samples; each surface block has shape
431
+ (num_points, 3).
432
+ rdu (list[torch.Tensor]): Current first surface derivatives; each block has shape
433
+ (num_points, 3, 2).
434
+ rdu2 (list[torch.Tensor]): Current second surface derivatives; each block has shape
435
+ (num_points, 3, 2, 2).
436
+ *args: Additional positional arguments accepted by the shared interface.
437
+ **kwargs: Additional keyword arguments accepted by the shared interface.
438
+
439
+ Returns:
440
+ torch.Tensor: One-element penalty for insufficient separation of the offset shell
441
+ boundaries.
442
+ """
323
443
  loss = torch.zeros(1, device=r[0].device, dtype=r[0].dtype)
324
444
 
325
445
  for sf_idx in self._selected_surface_ids(len(r)):
@@ -36,6 +36,13 @@ class OffsetBoundaryPart(BoundaryPart):
36
36
  num_layers: int = 1,
37
37
  **kwargs: object,
38
38
  ) -> None:
39
+ """Initialize OffsetBoundaryPart and its configuration state.
40
+
41
+ Args:
42
+ shell_thickness (float): Thickness of the generated shell region in model length units.
43
+ num_layers (int): Number of offset finite-element layers.
44
+ **kwargs: Additional keyword arguments accepted by the shared interface.
45
+ """
39
46
  super().__init__(**kwargs)
40
47
 
41
48
  self.shell_thickness: float = float(shell_thickness)
@@ -55,17 +62,39 @@ class OffsetBoundaryPart(BoundaryPart):
55
62
  # ------------------------------------------------------------- shell mesh
56
63
  @property
57
64
  def surface_set_names(self) -> tuple[str, ...]:
65
+ """Return surface set names.
66
+
67
+ Returns:
68
+ tuple[str, ...]: Surface set names.
69
+ """
58
70
  return (*super().surface_set_names, *self._offset_set_names())
59
71
 
60
72
  @property
61
73
  def node_set_names(self) -> tuple[str, ...]:
74
+ """Return node set names.
75
+
76
+ Returns:
77
+ tuple[str, ...]: Node set names.
78
+ """
62
79
  return (*super().node_set_names, *self._offset_set_names())
63
80
 
64
81
  def _offset_set_names(self) -> tuple[str, ...]:
82
+ """List the generated shell-offset selections for the inner boundaries.
83
+
84
+ Returns:
85
+ tuple[str, ...]: Names surface_N_offset for each cavity, beginning at surface index one.
86
+ """
65
87
  return tuple(f"surface_{index}_offset" for index in range(1, self.num_surface_interfaces))
66
88
 
67
89
  def _compute_normals(self, base_nodes: torch.Tensor) -> torch.Tensor:
68
- """Cavity-surface normals evaluated on the current control points."""
90
+ """Cavity-surface normals evaluated on the current control points.
91
+
92
+ Args:
93
+ base_nodes (torch.Tensor): Reference Cartesian nodes before applying the surface offset.
94
+
95
+ Returns:
96
+ torch.Tensor: Cavity-surface normals evaluated on the current control points.
97
+ """
69
98
  normals = []
70
99
  for index in range(1, self.num_surface_interfaces):
71
100
  surface = self.surfaceinterfaces[index]
@@ -80,16 +109,39 @@ class OffsetBoundaryPart(BoundaryPart):
80
109
  return torch.cat(normals, dim=0)
81
110
 
82
111
  def _compute_offset_targets(self, base_nodes: torch.Tensor) -> torch.Tensor:
83
- """Offset the base nodes by ``shell_thickness`` along the normals."""
112
+ """Offset the base nodes by ``shell_thickness`` along the normals.
113
+
114
+ Args:
115
+ base_nodes (torch.Tensor): Reference Cartesian nodes before applying the surface offset.
116
+
117
+ Returns:
118
+ torch.Tensor: Offset the base nodes by ``shell_thickness`` along the normals.
119
+ """
84
120
  direction = self._compute_normals(base_nodes)
85
121
  return base_nodes + float(self.shell_thickness) * direction
86
122
 
87
123
  def _postprocess_part(self, part: torchfea.Part) -> torchfea.Part:
88
- """Add the offset shell wedge elements to the meshed Part."""
124
+ """Add the offset shell wedge elements to the meshed Part.
125
+
126
+ Args:
127
+ part (torchfea.Part): Part whose geometry, mesh, or named sets are processed.
128
+
129
+ Returns:
130
+ torchfea.Part: Add the offset shell wedge elements to the meshed Part.
131
+ """
89
132
  return self._build_shell_c3d6(part)
90
133
 
91
134
  def build_part(self, path_result=None, pools=None) -> torchfea.Part:
92
- """Build and validate the offset wedges, including quadratic conversion."""
135
+ """Build and validate the offset wedges, including quadratic conversion.
136
+
137
+ Args:
138
+ path_result: Optimization result directory containing scripts and log subdirectories.
139
+ pools: Optional multiprocessing pool for geometry preparation or export.
140
+
141
+ Returns:
142
+ torchfea.Part: TorchFEA Part with geometry-derived selections and the requested element
143
+ order.
144
+ """
93
145
  part = super().build_part(path_result=path_result, pools=pools)
94
146
  shell = part.elems["C3D6"]
95
147
  shell.initialize(nodes=part.nodes)
@@ -100,6 +152,15 @@ class OffsetBoundaryPart(BoundaryPart):
100
152
 
101
153
  def _build_shell_c3d6(self, part: torchfea.Part) -> torchfea.Part:
102
154
  # Ensure surface elements exist so we can query triangle meshes.
155
+ """Build shell c3d6.
156
+
157
+ Args:
158
+ part (torchfea.Part): Part whose geometry, mesh, or named sets are processed.
159
+
160
+ Returns:
161
+ torchfea.Part: Offset shell discretized with six-node wedge elements and named boundary
162
+ selections.
163
+ """
103
164
  part.surfaces.initialize(part)
104
165
 
105
166
  tri_by_surface: dict[int, np.ndarray] = {}
@@ -236,7 +297,14 @@ class OffsetBoundaryPart(BoundaryPart):
236
297
  def modify_assembly(
237
298
  self, design_sensitivity_vars: torch.Tensor, assembly: torchfea.Assembly
238
299
  ) -> None:
239
- """Update the Part nodes and keep the offset layers consistent."""
300
+ """Update the Part nodes and keep the offset layers consistent.
301
+
302
+ Args:
303
+ design_sensitivity_vars (torch.Tensor): Differentiable design-variable tensor used to
304
+ modify the assembly.
305
+ assembly (torchfea.Assembly): TorchFEA assembly containing the registered Parts,
306
+ Instances, loads, and reference points.
307
+ """
240
308
  super().modify_assembly(design_sensitivity_vars, assembly)
241
309
 
242
310
  part = assembly.get_part(self.part_name)
@@ -266,7 +334,14 @@ class OffsetBoundaryPart(BoundaryPart):
266
334
 
267
335
  @staticmethod
268
336
  def _default_opacity(index: int) -> float:
269
- """The solid volume is hidden so the shell stays visible."""
337
+ """The solid volume is hidden so the shell stays visible.
338
+
339
+ Args:
340
+ index (int): Zero-based position within the relevant collection.
341
+
342
+ Returns:
343
+ float: The solid volume is hidden so the shell stays visible.
344
+ """
270
345
  return (
271
346
  0.0
272
347
  if index == 0