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.
- {morphopt-4.0.8 → morphopt-4.0.9}/PKG-INFO +3 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/pyproject.toml +3 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/__init__.py +20 -18
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/constraints.py +144 -24
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/offset_boundary_part.py +81 -6
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/constants.py +39 -15
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/opt_runner.py +63 -6
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/__init__.py +4 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/controller.py +107 -63
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/history.py +44 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/baseparam.py +97 -22
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/base_component.py +12 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/body_force.py +17 -2
- morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/boundary_condition.py +100 -0
- morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/contact.py +139 -0
- morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/couple.py +44 -0
- morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/point_load.py +140 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/pressure.py +25 -10
- morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/reference_point.py +37 -0
- morphopt-4.0.9/src/morphopt/optcore/modelparams/fea/spring.py +305 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/feaparams.py +25 -11
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/geometry.py +26 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/base_material.py +51 -7
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/homogeneous_material.py +5 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/models.py +10 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materialsparams.py +10 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/params.py +70 -31
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/base_part.py +115 -12
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/box_part.py +31 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/cad_part.py +204 -23
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/fixed_part.py +60 -6
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/inp_part.py +26 -6
- morphopt-4.0.9/src/morphopt/optcore/objfunc.py +350 -0
- morphopt-4.0.9/src/morphopt/optcore/protocal.py +234 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/solver.py +101 -77
- morphopt-4.0.9/src/morphopt/optcore/strategies.py +144 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/updaters.py +430 -105
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/_runtime.py +25 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/archive.py +154 -11
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/exports.py +134 -10
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/fields.py +174 -6
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/visualization.py +82 -12
- morphopt-4.0.9/src/morphopt/shapeopt/barriers.py +75 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/boundary_part.py +223 -35
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/basefuncs.py +33 -12
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/boundarys.py +35 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/distancesurface.py +25 -7
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/shapederivative.py +77 -7
- morphopt-4.0.9/src/morphopt/shapeopt/objectivefuncs/surfacefairness.py +320 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/volumemaximization.py +23 -0
- morphopt-4.0.9/src/morphopt/shapeopt/strategies.py +448 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/base_constraints.py +73 -31
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/base_surface.py +324 -80
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/brep_surface.py +357 -34
- morphopt-4.0.9/src/morphopt/shapeopt/surfaces/bsp_constraints.py +349 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/bsp_surface.py +216 -48
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/cpgeo_constraints.py +79 -27
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/cpgeo_surface.py +122 -37
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/mesh_surface.py +53 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/nurbs_face.py +181 -24
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/update_boundary_part.py +72 -27
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/objectivefuncs/basefuncs.py +15 -48
- morphopt-4.0.9/src/morphopt/simp/objectivefuncs/boundarys.py +104 -0
- morphopt-4.0.9/src/morphopt/simp/objectivefuncs/densityfield.py +53 -0
- morphopt-4.0.9/src/morphopt/simp/objectivefuncs/sensitivity.py +133 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/objectivefuncs/volfrac.py +29 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/simpmaterial.py +210 -32
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/update_simpmaterial.py +79 -30
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/void_elements.py +127 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/__init__.py +6 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/app.py +10 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/cad.py +73 -8
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/completion.py +58 -9
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/definitions.py +168 -16
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/devices.py +5 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/edit_history.py +140 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/editing.py +345 -23
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/editor_routing.py +20 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/expressions.py +19 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/fields.py +90 -11
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/finite_element.py +76 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/load_cases.py +109 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/part_mesh.py +12 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/part_sets.py +117 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/quickstart.py +99 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/results.py +73 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/runs.py +111 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/updaters.py +136 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/validation.py +155 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/values.py +33 -6
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application_icon.py +15 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/assets.py +15 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/custom_classes.py +93 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/generator.py +280 -47
- {morphopt-4.0.8/src/morphopt/ui/schemes → morphopt-4.0.9/src/morphopt/ui/codegen}/snippets.py +21 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/workspace.py +35 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/i18n.py +66 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/launcher.py +91 -17
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/locales/en-US.json +43 -24
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/locales/zh-CN.json +43 -24
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/mainwindow.py +113 -12
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/base_nodes.py +344 -26
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/chamberlayout.py +13 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/configuration.py +97 -16
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/fields.py +14 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/loaders.py +91 -8
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/__init__.py +8 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/custom_code.py +69 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/loads.py +36 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/parts.py +94 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/structural.py +320 -10
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/surfaces.py +2 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/symmetry.py +63 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/problem.py +597 -90
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/registry.py +47 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/strategies.py +27 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/observe_panel.py +107 -12
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/edit_history.py +9 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/history.py +28 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/labels.py +195 -9
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/navigation.py +118 -7
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/result_fields.py +25 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/processes.py +11 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/refresh.py +42 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/__init__.py +7 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/fonts.py +116 -7
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/manager.py +63 -9
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/palette.py +16 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/base.qss +1 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/stylesheet.py +9 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/themes/dark.py +24 -0
- morphopt-4.0.9/src/morphopt/ui/theme/themes/light.py +117 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/visualization.py +16 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/assets.py +9 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/geometry.py +473 -17
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/loads.py +205 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/rendering.py +28 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/scene.py +63 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/asset_browser.py +65 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/case_deletion.py +9 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/codeeditor.py +90 -7
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/collection_controls.py +52 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/controller_editor.py +29 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/custom_classes.py +57 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/definition_actions.py +248 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/definition_manager.py +27 -5
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/edit_history.py +55 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/editor.py +86 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/editor_pages.py +34 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/file_dialogs.py +72 -6
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/finite_element.py +57 -11
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/font_settings.py +6 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/helper_editor.py +31 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/history_dialogs.py +7 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/history_export.py +34 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/labels.py +53 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/load_cases.py +17 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/model_tree.py +108 -15
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/objective_editor.py +53 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/observation_pages.py +58 -2
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/param_form.py +40 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/part_set_list.py +16 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/preview_renderer.py +88 -22
- morphopt-4.0.9/src/morphopt/ui/widgets/problems.py +119 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/quickstart.py +157 -44
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/run_dialogs.py +11 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/sequence_input.py +19 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/solver_editor.py +19 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/source_view.py +12 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/template_insert_dialog.py +36 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/updater_editor.py +131 -27
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/viewer.py +74 -15
- morphopt-4.0.9/src/morphopt/ui/widgets/viewport.py +562 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/visualization_settings.py +11 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/workspace_objective.py +12 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/workbench.py +110 -22
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/worker.py +9 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/gradient_check.py +48 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/history_read.py +5 -4
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/paths.py +8 -1
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/quadrature.py +17 -7
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/PKG-INFO +3 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/SOURCES.txt +2 -3
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/requires.txt +2 -2
- morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/boundary_condition.py +0 -76
- morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/contact.py +0 -117
- morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/couple.py +0 -35
- morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/point_load.py +0 -79
- morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/reference_point.py +0 -29
- morphopt-4.0.8/src/morphopt/optcore/modelparams/fea/spring.py +0 -156
- morphopt-4.0.8/src/morphopt/optcore/objfunc.py +0 -232
- morphopt-4.0.8/src/morphopt/optcore/protocal.py +0 -130
- morphopt-4.0.8/src/morphopt/optcore/strategies.py +0 -87
- morphopt-4.0.8/src/morphopt/shapeopt/barriers.py +0 -38
- morphopt-4.0.8/src/morphopt/shapeopt/objectivefuncs/surfacefairness.py +0 -164
- morphopt-4.0.8/src/morphopt/shapeopt/strategies.py +0 -360
- morphopt-4.0.8/src/morphopt/shapeopt/surfaces/bsp_constraints.py +0 -89
- morphopt-4.0.8/src/morphopt/simp/objectivefuncs/boundarys.py +0 -76
- morphopt-4.0.8/src/morphopt/simp/objectivefuncs/densityfield.py +0 -29
- morphopt-4.0.8/src/morphopt/simp/objectivefuncs/sensitivity.py +0 -72
- morphopt-4.0.8/src/morphopt/ui/schemes/__init__.py +0 -26
- morphopt-4.0.8/src/morphopt/ui/schemes/base.py +0 -407
- morphopt-4.0.8/src/morphopt/ui/theme/themes/light.py +0 -130
- morphopt-4.0.8/src/morphopt/ui/widgets/viewport.py +0 -159
- {morphopt-4.0.8 → morphopt-4.0.9}/README.md +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/setup.cfg +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/codesign/update_offset_boundary_part.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/base_model_component.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/fea/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/materials/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/optcore/modelparams/parts/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/postprocess/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/objectivefuncs/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/shapeopt/surfaces/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/simp/objectivefuncs/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/__main__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/application/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/assets/morphopt.svg +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/codegen/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/material_models.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/cad.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/materials.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/objectives.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/model/node_types/penalties.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/presentation/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/controls.qss +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/styles/inputs.qss +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/theme/themes/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/visualization/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/ui/widgets/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt/utils/__init__.py +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/dependency_links.txt +0 -0
- {morphopt-4.0.8 → morphopt-4.0.9}/src/morphopt.egg-info/entry_points.txt +0 -0
- {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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Examples
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
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
|