PyFemtet 1.8.3__tar.gz → 1.9.0__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.
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/PKG-INFO +1 -1
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/femopt.py +9 -144
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_base_interface.py +10 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_excel_interface/excel_interface.py +0 -4
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_interface/_femtet_parametric.py +0 -1
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_interface/femtet_interface.py +11 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +1 -1
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/_base_optimizer.py +149 -62
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyproject.toml +1 -1
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/LICENSE +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/LICENSE_THIRD_PARTY.txt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/README.md +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/1. make_pot_and_update_po.bat +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/2. build_mo.bat +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/babel.cfg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/i18n.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.po +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/locales/messages.pot +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_i18n/messages.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/closing.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/dask_util.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/df_util.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/excel_macro_util.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/excel_parse_util.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/femtet_access_inspection.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/femtet_autosave.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/femtet_exit.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/femtet_version.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/helper.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/process_util.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/sample.xlsx +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/solidworks_variable.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/str_enum.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/_util/symbol_support_for_param_name.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/core.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/dispatch_extensions/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/dispatch_extensions/_impl.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/logger/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/logger/_impl.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/exceptions.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/history/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/history/_history.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/history/_hypervolume.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/history/_optimality.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_dummy_classes.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_excel_interface/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_excel_interface/debug-excel-interface.xlsm +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_interface/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_with_nx_interface/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_with_nx_interface/femtet_with_nx_interface.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.prt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_with_nx_interface/model1.x_t +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_with_nx_interface/update_model.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_with_solidworks/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_with_solidworks/femtet_with_solidworks_interface.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_multiple_fem_interface.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_reopen_decorator.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_solidworks_interface/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_solidworks_interface/solidworks_interface.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_solidworks_interface/sw_const.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_surrogate_model_interface/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_surrogate_model_interface/botorch_interface.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_surrogate_model_interface/debug-pof-botorch.reccsv +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_with_excel_settings/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_with_excel_settings/with_excel_settings.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/meta_script/YAML_Generator.xlsm +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/meta_script/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/meta_script/__main__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/meta_script/sample/sample.bas +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/meta_script/sample/sample.femprj +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/_trial_queue.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/debug-pof-botorch.reccsv +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/enable_nonlinear_constraint.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/pof_botorch_sampler.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/optuna_optimizer/wat_ex14_parametric_jp.femprj +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/scipy_optimizer/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/optimizer/scipy_optimizer/_scipy_optimizer.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/prediction/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/prediction/_botorch_utils.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/prediction/_gpytorch_modules_extension.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/prediction/_helper.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/prediction/_model.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/problem/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/problem/problem.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/problem/variable_manager/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/problem/variable_manager/_string_as_expression.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/problem/variable_manager/_variable_manager.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/_create_wrapped_components.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/__main__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_base_application.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_common_pages.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_complex_components/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_complex_components/alert_region.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_complex_components/control_femtet.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_complex_components/detail_graphs.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_complex_components/main_graph.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_complex_components/pm_graph.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_detail_page.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_helper.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dbc.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/dcc.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/html.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/_wrapped_components/str_enum.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/.gitignore +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/_application.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/_pages.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.log +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bgr +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bnd +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.btr +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.mtl +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.prm +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.jpg +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/plotter/__init__.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/plotter/contour_creator.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/plotter/main_figure_creator.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/plotter/parallel_plot_creator.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/visualization/plotter/pm_graph_creator.py +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/wat_ex14_parametric_jp.femprj +0 -0
- {pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/worker_status.py +0 -0
|
@@ -49,8 +49,8 @@ class FEMOpt:
|
|
|
49
49
|
|
|
50
50
|
def __init__(
|
|
51
51
|
self,
|
|
52
|
-
fem: AbstractFEMInterface = None,
|
|
53
|
-
opt: AbstractOptimizer = None,
|
|
52
|
+
fem: AbstractFEMInterface | None = None,
|
|
53
|
+
opt: AbstractOptimizer | None = None,
|
|
54
54
|
):
|
|
55
55
|
self.opt: AbstractOptimizer = opt or OptunaOptimizer()
|
|
56
56
|
|
|
@@ -160,7 +160,7 @@ class FEMOpt:
|
|
|
160
160
|
names: str | list[str],
|
|
161
161
|
fun: Callable[..., Sequence[float]],
|
|
162
162
|
n_return: int,
|
|
163
|
-
directions: DIRECTION | Sequence[DIRECTION] = None,
|
|
163
|
+
directions: DIRECTION | Sequence[DIRECTION] | None = None,
|
|
164
164
|
args: tuple | None = None,
|
|
165
165
|
kwargs: dict | None = None,
|
|
166
166
|
):
|
|
@@ -208,7 +208,7 @@ class FEMOpt:
|
|
|
208
208
|
):
|
|
209
209
|
self.opt.set_termination_condition(func)
|
|
210
210
|
|
|
211
|
-
def set_monitor_host(self, host: str = None, port: int = None):
|
|
211
|
+
def set_monitor_host(self, host: str | None = None, port: int | None = None):
|
|
212
212
|
"""Sets the host IP address and the port of the process monitor.
|
|
213
213
|
|
|
214
214
|
Args:
|
|
@@ -240,14 +240,14 @@ class FEMOpt:
|
|
|
240
240
|
|
|
241
241
|
def optimize(
|
|
242
242
|
self,
|
|
243
|
-
n_trials: int = None,
|
|
243
|
+
n_trials: int | None = None,
|
|
244
244
|
n_parallel: int = 1,
|
|
245
|
-
timeout: float = None,
|
|
245
|
+
timeout: float | None = None,
|
|
246
246
|
wait_setup: bool = True,
|
|
247
247
|
confirm_before_exit: bool = True,
|
|
248
|
-
history_path: str = None,
|
|
248
|
+
history_path: str | None = None,
|
|
249
249
|
with_monitor: bool = True,
|
|
250
|
-
scheduler_address: str = None,
|
|
250
|
+
scheduler_address: str | None = None,
|
|
251
251
|
seed: int | None = None,
|
|
252
252
|
):
|
|
253
253
|
|
|
@@ -258,7 +258,7 @@ class FEMOpt:
|
|
|
258
258
|
ver=pyfemtet.__version__,
|
|
259
259
|
)
|
|
260
260
|
)
|
|
261
|
-
client: Client
|
|
261
|
+
client: Client | DummyClient
|
|
262
262
|
|
|
263
263
|
# set arguments
|
|
264
264
|
self.opt.n_trials = n_trials or self.opt.n_trials
|
|
@@ -274,7 +274,6 @@ class FEMOpt:
|
|
|
274
274
|
worker_name_base = 'Sub'
|
|
275
275
|
if n_parallel == 1:
|
|
276
276
|
cluster = nullcontext()
|
|
277
|
-
# noinspection PyTypeChecker
|
|
278
277
|
client = DummyClient()
|
|
279
278
|
|
|
280
279
|
else:
|
|
@@ -534,137 +533,3 @@ class FEMOpt:
|
|
|
534
533
|
logger.info(_('All processes are terminated.'))
|
|
535
534
|
|
|
536
535
|
return df
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
def debug_1():
|
|
540
|
-
# noinspection PyUnresolvedReferences
|
|
541
|
-
from time import sleep
|
|
542
|
-
# from pyfemtet.opt.optimizer import InterruptOptimization
|
|
543
|
-
import optuna
|
|
544
|
-
from pyfemtet.opt.interface import AbstractFEMInterface, NoFEM
|
|
545
|
-
|
|
546
|
-
def _parabola(_fem: AbstractFEMInterface, _opt: AbstractOptimizer):
|
|
547
|
-
x = _opt.get_variables('values')
|
|
548
|
-
# print(os.getpid())
|
|
549
|
-
# raise RuntimeError
|
|
550
|
-
# raise Interrupt
|
|
551
|
-
# if get_worker() is None:
|
|
552
|
-
# raise RuntimeError
|
|
553
|
-
return (x ** 2).sum()
|
|
554
|
-
|
|
555
|
-
def _cns(_fem: AbstractFEMInterface, _opt: AbstractOptimizer):
|
|
556
|
-
x = _opt.get_variables('values')
|
|
557
|
-
return x[0]
|
|
558
|
-
|
|
559
|
-
_opt = OptunaOptimizer()
|
|
560
|
-
_opt.sampler = optuna.samplers.TPESampler(seed=42)
|
|
561
|
-
_opt.n_trials = 10
|
|
562
|
-
|
|
563
|
-
_fem = NoFEM()
|
|
564
|
-
_opt.fem = _fem
|
|
565
|
-
|
|
566
|
-
_args = (_opt,)
|
|
567
|
-
|
|
568
|
-
_opt.add_parameter('x1', 1, -1, 1, step=0.2)
|
|
569
|
-
_opt.add_parameter('x2', 1, -1, 1, step=0.2)
|
|
570
|
-
|
|
571
|
-
_opt.add_constraint('cns', _cns, lower_bound=-0.5, args=_args)
|
|
572
|
-
|
|
573
|
-
_opt.add_objective('obj', _parabola, args=_args)
|
|
574
|
-
|
|
575
|
-
_femopt = FEMOpt(fem=_fem, opt=_opt)
|
|
576
|
-
_femopt.opt = _opt
|
|
577
|
-
# _femopt.opt.history.path = 'v1test/femopt-restart-test.csv'
|
|
578
|
-
_femopt.optimize(n_parallel=2)
|
|
579
|
-
|
|
580
|
-
print(os.path.abspath(_femopt.opt.history.path))
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
def substrate_size(Femtet):
|
|
584
|
-
"""基板のXY平面上での専有面積を計算します。"""
|
|
585
|
-
substrate_w = Femtet.GetVariableValue('substrate_w')
|
|
586
|
-
substrate_d = Femtet.GetVariableValue('substrate_d')
|
|
587
|
-
|
|
588
|
-
# assert get_worker() is not None
|
|
589
|
-
|
|
590
|
-
return substrate_w * substrate_d # 単位: mm2
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
def debug_2():
|
|
594
|
-
from pyfemtet.opt.interface import FemtetInterface
|
|
595
|
-
from pyfemtet.opt.optimizer import OptunaOptimizer
|
|
596
|
-
|
|
597
|
-
fem = FemtetInterface(
|
|
598
|
-
femprj_path=os.path.join(os.path.dirname(__file__), 'wat_ex14_parametric_jp.femprj'),
|
|
599
|
-
)
|
|
600
|
-
|
|
601
|
-
opt = OptunaOptimizer()
|
|
602
|
-
|
|
603
|
-
opt.fem = fem
|
|
604
|
-
|
|
605
|
-
opt.add_parameter(name="substrate_w", initial_value=40, lower_bound=22, upper_bound=60)
|
|
606
|
-
opt.add_parameter(name="substrate_d", initial_value=60, lower_bound=34, upper_bound=60)
|
|
607
|
-
opt.add_objective(name='基板サイズ(mm2)', fun=substrate_size)
|
|
608
|
-
opt.add_objective(name='obj2', fun=substrate_size)
|
|
609
|
-
opt.add_objective(name='obj3', fun=substrate_size)
|
|
610
|
-
|
|
611
|
-
opt.n_trials = 10
|
|
612
|
-
# opt.history.path = os.path.join(os.path.dirname(__file__), 'femtet-test.csv')
|
|
613
|
-
|
|
614
|
-
femopt = FEMOpt()
|
|
615
|
-
|
|
616
|
-
femopt.opt = opt
|
|
617
|
-
|
|
618
|
-
femopt.optimize(n_parallel=1)
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
def debug_3():
|
|
622
|
-
# noinspection PyUnresolvedReferences
|
|
623
|
-
from time import sleep
|
|
624
|
-
# from pyfemtet.opt.optimizer import InterruptOptimization
|
|
625
|
-
import optuna
|
|
626
|
-
from pyfemtet.opt.interface import AbstractFEMInterface, NoFEM
|
|
627
|
-
|
|
628
|
-
def _parabola(_fem: AbstractFEMInterface, _opt: AbstractOptimizer):
|
|
629
|
-
x = _opt.get_variables('values')
|
|
630
|
-
# print(os.getpid())
|
|
631
|
-
# raise RuntimeError
|
|
632
|
-
# raise Interrupt
|
|
633
|
-
# if get_worker() is None:
|
|
634
|
-
# raise RuntimeError
|
|
635
|
-
return (x ** 2).sum()
|
|
636
|
-
|
|
637
|
-
def _cns(_fem: AbstractFEMInterface, _opt: AbstractOptimizer):
|
|
638
|
-
x = _opt.get_variables('values')
|
|
639
|
-
return x[0]
|
|
640
|
-
|
|
641
|
-
_opt = OptunaOptimizer()
|
|
642
|
-
_opt.sampler = optuna.samplers.TPESampler(seed=42)
|
|
643
|
-
|
|
644
|
-
_fem = NoFEM()
|
|
645
|
-
_opt.fem = _fem
|
|
646
|
-
|
|
647
|
-
_args = (_opt,)
|
|
648
|
-
|
|
649
|
-
_opt.add_parameter('x1', 1, -1, 1, step=0.2)
|
|
650
|
-
_opt.add_parameter('x2', 1, -1, 1, step=0.2)
|
|
651
|
-
|
|
652
|
-
_opt.add_constraint('cns', _cns, lower_bound=-0.5, args=_args)
|
|
653
|
-
|
|
654
|
-
_opt.add_objective('obj', _parabola, args=_args)
|
|
655
|
-
|
|
656
|
-
_femopt = FEMOpt(fem=_fem, opt=_opt)
|
|
657
|
-
_femopt.optimize(
|
|
658
|
-
scheduler_address='<dask scheduler で起動したスケジューラの tcp をここに入力>',
|
|
659
|
-
n_trials=80,
|
|
660
|
-
n_parallel=6,
|
|
661
|
-
with_monitor=True,
|
|
662
|
-
confirm_before_exit=False,
|
|
663
|
-
)
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
if __name__ == '__main__':
|
|
667
|
-
# for i in range(1):
|
|
668
|
-
debug_1()
|
|
669
|
-
# debug_2()
|
|
670
|
-
# debug_3()
|
|
@@ -244,6 +244,16 @@ class AbstractFEMInterface:
|
|
|
244
244
|
def _get_additional_data(self) -> dict:
|
|
245
245
|
return dict()
|
|
246
246
|
|
|
247
|
+
# name
|
|
248
|
+
@property
|
|
249
|
+
def name(self) -> str:
|
|
250
|
+
if hasattr(self, '_name'):
|
|
251
|
+
return self._name
|
|
252
|
+
return self.__class__.__name__
|
|
253
|
+
|
|
254
|
+
@name.setter
|
|
255
|
+
def name(self, value: str):
|
|
256
|
+
self._name = value
|
|
247
257
|
|
|
248
258
|
class COMInterface(AbstractFEMInterface):
|
|
249
259
|
|
{pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_excel_interface/excel_interface.py
RENAMED
|
@@ -662,7 +662,6 @@ class ExcelInterface(COMInterface):
|
|
|
662
662
|
upper_bound=ub,
|
|
663
663
|
step=step,
|
|
664
664
|
fix=not use,
|
|
665
|
-
supress_duplicated_name_check=True,
|
|
666
665
|
)
|
|
667
666
|
|
|
668
667
|
elif kind == 'Categorical':
|
|
@@ -675,7 +674,6 @@ class ExcelInterface(COMInterface):
|
|
|
675
674
|
initial_value=value,
|
|
676
675
|
choices=choices,
|
|
677
676
|
fix=not use,
|
|
678
|
-
supress_duplicated_name_check=True,
|
|
679
677
|
)
|
|
680
678
|
|
|
681
679
|
else:
|
|
@@ -722,7 +720,6 @@ class ExcelInterface(COMInterface):
|
|
|
722
720
|
direction=direction,
|
|
723
721
|
fun=_ScapeGoatObjective(),
|
|
724
722
|
kwargs=dict(name=name),
|
|
725
|
-
supress_duplicated_name_check=True,
|
|
726
723
|
)
|
|
727
724
|
|
|
728
725
|
def load_constraints(self, opt: OptimizationDataPerFEM, raise_if_no_keyword=False):
|
|
@@ -784,7 +781,6 @@ class ExcelInterface(COMInterface):
|
|
|
784
781
|
fun=_ScapeGoatObjective(),
|
|
785
782
|
kwargs=dict(name=name),
|
|
786
783
|
using_fem=not calc_before_solve,
|
|
787
|
-
supress_duplicated_name_check=True,
|
|
788
784
|
)
|
|
789
785
|
|
|
790
786
|
def objective_from_excel(self, _, name: str):
|
{pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_interface/_femtet_parametric.py
RENAMED
|
@@ -223,7 +223,6 @@ def add_parametric_results_as_objectives(opt, Femtet, indexes, directions) -> bo
|
|
|
223
223
|
# objective value function
|
|
224
224
|
opt.add_objective(
|
|
225
225
|
name=name, fun=_parametric_objective, direction=direction, args=(i,),
|
|
226
|
-
supress_duplicated_name_check=True,
|
|
227
226
|
)
|
|
228
227
|
return True # ここまで来たら成功
|
|
229
228
|
|
{pyfemtet-1.8.3 → pyfemtet-1.9.0}/pyfemtet/opt/interface/_femtet_interface/femtet_interface.py
RENAMED
|
@@ -185,6 +185,17 @@ class FemtetInterface(COMInterface):
|
|
|
185
185
|
|
|
186
186
|
# ===== system =====
|
|
187
187
|
|
|
188
|
+
@property
|
|
189
|
+
def name(self) -> str:
|
|
190
|
+
name = ""
|
|
191
|
+
if self.femprj_path is not None:
|
|
192
|
+
name += os.path.basename(self.femprj_path)
|
|
193
|
+
if self.model_name is not None:
|
|
194
|
+
name += f' - {self.model_name}'
|
|
195
|
+
if name == "":
|
|
196
|
+
name = super().name
|
|
197
|
+
return name
|
|
198
|
+
|
|
188
199
|
@property
|
|
189
200
|
def object_pass_to_fun(self):
|
|
190
201
|
"""The object pass to the first argument of user-defined objective functions.
|
|
@@ -122,7 +122,7 @@ class AbstractSurrogateModelInterfaceBase(AbstractFEMInterface):
|
|
|
122
122
|
def dummy(*args, **kwargs):
|
|
123
123
|
assert False
|
|
124
124
|
|
|
125
|
-
ctx.add_objective(obj_name, dummy, direction
|
|
125
|
+
ctx.add_objective(obj_name, dummy, direction)
|
|
126
126
|
|
|
127
127
|
# ctx の目的関数のうち train に含まれるものを差し替え
|
|
128
128
|
# directions の目的変数名を validation しているので漏れはないはず
|
|
@@ -84,6 +84,11 @@ class OptimizationData:
|
|
|
84
84
|
self._initialize_objectives()
|
|
85
85
|
self.constraints = Constraints()
|
|
86
86
|
self.other_outputs = Functions()
|
|
87
|
+
self._suppress_duplicate_name_check = False
|
|
88
|
+
|
|
89
|
+
def _check_duplicated_name(self, name, names, suppress=False):
|
|
90
|
+
if not suppress and not self._suppress_duplicate_name_check:
|
|
91
|
+
_duplicated_name_check(name, names)
|
|
87
92
|
|
|
88
93
|
def add_constant_value(
|
|
89
94
|
self,
|
|
@@ -110,8 +115,7 @@ class OptimizationData:
|
|
|
110
115
|
var.value = value
|
|
111
116
|
var.pass_to_fem = pass_to_fem
|
|
112
117
|
var.properties = properties if properties is not None else {}
|
|
113
|
-
|
|
114
|
-
_duplicated_name_check(name, self.variable_manager.variables.keys())
|
|
118
|
+
self._check_duplicated_name(name, self.variable_manager.variables.keys(), supress_duplicated_name_check)
|
|
115
119
|
self.variable_manager.set_variable(var)
|
|
116
120
|
return var
|
|
117
121
|
|
|
@@ -141,8 +145,7 @@ class OptimizationData:
|
|
|
141
145
|
prm.step = step
|
|
142
146
|
prm.properties = properties
|
|
143
147
|
prm.pass_to_fem = pass_to_fem
|
|
144
|
-
|
|
145
|
-
_duplicated_name_check(name, self.variable_manager.variables.keys())
|
|
148
|
+
self._check_duplicated_name(name, self.variable_manager.variables.keys(), supress_duplicated_name_check)
|
|
146
149
|
self.variable_manager.set_variable(prm)
|
|
147
150
|
return prm
|
|
148
151
|
|
|
@@ -162,8 +165,7 @@ class OptimizationData:
|
|
|
162
165
|
)
|
|
163
166
|
var.properties = properties or dict()
|
|
164
167
|
var.pass_to_fem = pass_to_fem
|
|
165
|
-
|
|
166
|
-
_duplicated_name_check(name, self.variable_manager.variables.keys())
|
|
168
|
+
self._check_duplicated_name(name, self.variable_manager.variables.keys(), supress_duplicated_name_check)
|
|
167
169
|
self.variable_manager.set_variable(var)
|
|
168
170
|
return var
|
|
169
171
|
|
|
@@ -181,8 +183,7 @@ class OptimizationData:
|
|
|
181
183
|
var._expr = ExpressionFromString.InternalClass(sympy_expr=sympy_expr)
|
|
182
184
|
var.properties = properties or dict()
|
|
183
185
|
var.pass_to_fem = pass_to_fem
|
|
184
|
-
|
|
185
|
-
_duplicated_name_check(name, self.variable_manager.variables.keys())
|
|
186
|
+
self._check_duplicated_name(name, self.variable_manager.variables.keys(), supress_duplicated_name_check)
|
|
186
187
|
self.variable_manager.set_variable(var)
|
|
187
188
|
return var
|
|
188
189
|
|
|
@@ -204,8 +205,7 @@ class OptimizationData:
|
|
|
204
205
|
var.kwargs = kwargs or dict()
|
|
205
206
|
var.properties = properties or dict()
|
|
206
207
|
var.pass_to_fem = pass_to_fem
|
|
207
|
-
|
|
208
|
-
_duplicated_name_check(name, self.variable_manager.variables.keys())
|
|
208
|
+
self._check_duplicated_name(name, self.variable_manager.variables.keys(), supress_duplicated_name_check)
|
|
209
209
|
self.variable_manager.set_variable(var)
|
|
210
210
|
return var
|
|
211
211
|
|
|
@@ -231,8 +231,7 @@ class OptimizationData:
|
|
|
231
231
|
prm.choices = choices
|
|
232
232
|
prm.properties = properties
|
|
233
233
|
prm.pass_to_fem = pass_to_fem
|
|
234
|
-
|
|
235
|
-
_duplicated_name_check(name, self.variable_manager.variables.keys())
|
|
234
|
+
self._check_duplicated_name(name, self.variable_manager.variables.keys(), supress_duplicated_name_check)
|
|
236
235
|
self.variable_manager.set_variable(prm)
|
|
237
236
|
return prm
|
|
238
237
|
|
|
@@ -251,8 +250,7 @@ class OptimizationData:
|
|
|
251
250
|
obj.kwargs = kwargs or {}
|
|
252
251
|
obj.direction = direction
|
|
253
252
|
obj.fem_ctx = None
|
|
254
|
-
|
|
255
|
-
_duplicated_name_check(name, self.objectives.keys())
|
|
253
|
+
self._check_duplicated_name(name, self.objectives.keys(), supress_duplicated_name_check)
|
|
256
254
|
self.objectives.update({name: obj})
|
|
257
255
|
return obj # Context で fem_ctx をセットするために返す
|
|
258
256
|
|
|
@@ -334,8 +332,7 @@ class OptimizationData:
|
|
|
334
332
|
cns.hard = strict
|
|
335
333
|
cns.fem_ctx = None
|
|
336
334
|
cns.using_fem = using_fem
|
|
337
|
-
|
|
338
|
-
_duplicated_name_check(name, self.constraints.keys())
|
|
335
|
+
self._check_duplicated_name(name, self.constraints.keys(), supress_duplicated_name_check)
|
|
339
336
|
self.constraints.update({name: cns})
|
|
340
337
|
return cns # Context で fem_ctx をセットするために返す
|
|
341
338
|
|
|
@@ -352,8 +349,7 @@ class OptimizationData:
|
|
|
352
349
|
other_func.args = args or ()
|
|
353
350
|
other_func.kwargs = kwargs or {}
|
|
354
351
|
other_func.fem_ctx = None
|
|
355
|
-
|
|
356
|
-
_duplicated_name_check(name, self.other_outputs.keys())
|
|
352
|
+
self._check_duplicated_name(name, self.other_outputs.keys(), supress_duplicated_name_check)
|
|
357
353
|
self.other_outputs.update({name: other_func})
|
|
358
354
|
return other_func
|
|
359
355
|
|
|
@@ -473,8 +469,21 @@ class OptimizationDataPerFEM(OptimizationData):
|
|
|
473
469
|
)
|
|
474
470
|
|
|
475
471
|
def _y_common(self, fem: AbstractFEMInterface) -> TrialOutput:
|
|
472
|
+
|
|
473
|
+
if len(self.objectives) > 0:
|
|
474
|
+
logger.info(_(
|
|
475
|
+
en_message='Evaluating objective functions for {fem_name}...',
|
|
476
|
+
jp_message='{fem_name} の目的関数を評価しています...',
|
|
477
|
+
fem_name=fem.name,
|
|
478
|
+
))
|
|
479
|
+
|
|
476
480
|
out = TrialOutput()
|
|
477
481
|
for name, obj in self.objectives.items():
|
|
482
|
+
logger.info(_(
|
|
483
|
+
en_message=' Evaluating objective function {obj_name}...',
|
|
484
|
+
jp_message=' 目的関数 {obj_name} を評価しています...',
|
|
485
|
+
obj_name=name,
|
|
486
|
+
))
|
|
478
487
|
obj_result = ObjectiveResult(obj, fem)
|
|
479
488
|
out.update({name: obj_result})
|
|
480
489
|
return out
|
|
@@ -496,8 +505,28 @@ class OptimizationDataPerFEM(OptimizationData):
|
|
|
496
505
|
fem: AbstractFEMInterface,
|
|
497
506
|
hard: bool,
|
|
498
507
|
) -> TrialConstraintOutput:
|
|
508
|
+
if len([cns for cns in self.constraints.values() if cns.hard == hard]) > 0:
|
|
509
|
+
if hard:
|
|
510
|
+
logger.info(_(
|
|
511
|
+
en_message='Evaluating hard constraint functions...',
|
|
512
|
+
jp_message='{fem_name} の hard 拘束関数を評価しています...',
|
|
513
|
+
fem_name=fem.name,
|
|
514
|
+
))
|
|
515
|
+
else:
|
|
516
|
+
logger.info(_(
|
|
517
|
+
en_message='Evaluating soft constraint functions...',
|
|
518
|
+
jp_message='{fem_name} の soft 拘束関数を評価しています...',
|
|
519
|
+
fem_name=fem.name,
|
|
520
|
+
|
|
521
|
+
))
|
|
522
|
+
|
|
499
523
|
for name, cns in self.constraints.items():
|
|
500
524
|
if cns.hard == hard:
|
|
525
|
+
logger.info(_(
|
|
526
|
+
en_message=' Evaluating constraint function {cns_name}...',
|
|
527
|
+
jp_message=' 制約関数 {cns_name} を評価しています...',
|
|
528
|
+
cns_name=name,
|
|
529
|
+
))
|
|
501
530
|
cns_result = ConstraintResult(cns, fem)
|
|
502
531
|
out.update({name: cns_result})
|
|
503
532
|
return out
|
|
@@ -509,6 +538,14 @@ class OptimizationDataPerFEM(OptimizationData):
|
|
|
509
538
|
return self._c_common(out, self.fem, hard=False)
|
|
510
539
|
|
|
511
540
|
def _other_outputs_common(self, out: TrialFunctionOutput, fem: AbstractFEMInterface) -> TrialFunctionOutput:
|
|
541
|
+
|
|
542
|
+
if len(self.other_outputs) > 0:
|
|
543
|
+
logger.info(_(
|
|
544
|
+
en_message='Evaluating other outputs for {fem_name}...',
|
|
545
|
+
jp_message='{fem_name} のその他の出力を評価しています...',
|
|
546
|
+
fem_name=fem.name,
|
|
547
|
+
))
|
|
548
|
+
|
|
512
549
|
for name, other_func in self.other_outputs.items():
|
|
513
550
|
other_func_result = FunctionResult(other_func, fem)
|
|
514
551
|
out.update({name: other_func_result})
|
|
@@ -525,6 +562,16 @@ class OptimizationDataPerFEM(OptimizationData):
|
|
|
525
562
|
|
|
526
563
|
class FEMListForGlobal(FEMListInterface):
|
|
527
564
|
|
|
565
|
+
@property
|
|
566
|
+
def name(self) -> str:
|
|
567
|
+
if len(self._fems) == 1:
|
|
568
|
+
return self._fems[0].name
|
|
569
|
+
else:
|
|
570
|
+
return _(
|
|
571
|
+
en_message='Entire',
|
|
572
|
+
jp_message='全体',
|
|
573
|
+
)
|
|
574
|
+
|
|
528
575
|
# 単一 FEM しか使わない場合に list を意識させないため
|
|
529
576
|
# 長さ 1 の時は要素を返す処理が方々で必要
|
|
530
577
|
@property
|
|
@@ -989,34 +1036,47 @@ class AbstractOptimizer(OptimizationData):
|
|
|
989
1036
|
|
|
990
1037
|
from contextlib import nullcontext
|
|
991
1038
|
|
|
1039
|
+
def _get_pass_to_fem(ctx__):
|
|
1040
|
+
# 共通
|
|
1041
|
+
pass_to_fem__ = self.opt.fem_manager.global_data.variable_manager.get_variables(
|
|
1042
|
+
filter="pass_to_fem",
|
|
1043
|
+
format="raw",
|
|
1044
|
+
)
|
|
1045
|
+
# FEM ごとのものを追加
|
|
1046
|
+
pass_to_fem__.update(ctx__.variable_manager.get_variables(
|
|
1047
|
+
filter="pass_to_fem",
|
|
1048
|
+
format="raw",
|
|
1049
|
+
))
|
|
1050
|
+
return pass_to_fem__
|
|
1051
|
+
|
|
992
1052
|
# start solve per FEM
|
|
993
1053
|
if opt_.sub_fidelity_name != MAIN_FIDELITY_NAME:
|
|
994
1054
|
logger.info('----------')
|
|
995
1055
|
logger.info(_('fidelity: ({name})', name=opt_.sub_fidelity_name))
|
|
996
|
-
for ctx in opt_.fem_manager.contexts:
|
|
997
|
-
logger.info(_('input variables:'))
|
|
998
|
-
logger.info(parameters)
|
|
999
1056
|
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
format="raw",
|
|
1057
|
+
# ===== Phase 1: update_parameter + hard constraint for ALL contexts =====
|
|
1058
|
+
for ctx in opt_.fem_manager.contexts:
|
|
1059
|
+
# ===== update FEM parameter (for hard constraint evaluation) =====
|
|
1060
|
+
if not isinstance(ctx.fem, FEMListForGlobal):
|
|
1061
|
+
pass_to_fem = _get_pass_to_fem(ctx)
|
|
1062
|
+
|
|
1063
|
+
logger.info(_(
|
|
1064
|
+
en_message='Updating variables for {fem_name}...',
|
|
1065
|
+
jp_message='{fem_name} の変数を更新しています...',
|
|
1066
|
+
fem_name=ctx.fem.name,
|
|
1011
1067
|
))
|
|
1012
|
-
logger.info(_(
|
|
1068
|
+
logger.info(_(
|
|
1069
|
+
en_message=' Input: {variables}',
|
|
1070
|
+
jp_message=' 入力: {variables}',
|
|
1071
|
+
variables=pass_to_fem,
|
|
1072
|
+
))
|
|
1073
|
+
|
|
1013
1074
|
ctx.fem.update_parameter(pass_to_fem)
|
|
1014
1075
|
opt_._check_and_raise_interruption()
|
|
1015
1076
|
|
|
1016
1077
|
# ===== evaluate hard constraint =====
|
|
1017
1078
|
with nullcontext():
|
|
1018
1079
|
ctx_hard_c = TrialConstraintOutput()
|
|
1019
|
-
logger.info(_('evaluating constraint functions...'))
|
|
1020
1080
|
|
|
1021
1081
|
try:
|
|
1022
1082
|
ctx._hard_c(ctx_hard_c)
|
|
@@ -1047,9 +1107,23 @@ class AbstractOptimizer(OptimizationData):
|
|
|
1047
1107
|
|
|
1048
1108
|
raise HardConstraintViolation
|
|
1049
1109
|
|
|
1110
|
+
# ===== Phase 2: FEM execution + objectives + soft constraints + other outputs =====
|
|
1111
|
+
for ctx in opt_.fem_manager.contexts:
|
|
1112
|
+
|
|
1113
|
+
# ===== update FEM parameter (again, for Femtet parametric compatibility) =====
|
|
1114
|
+
with nullcontext():
|
|
1115
|
+
pass_to_fem = _get_pass_to_fem(ctx)
|
|
1116
|
+
ctx.fem.update_parameter(pass_to_fem)
|
|
1117
|
+
opt_._check_and_raise_interruption()
|
|
1118
|
+
|
|
1050
1119
|
# ===== update FEM =====
|
|
1051
1120
|
with nullcontext():
|
|
1052
|
-
|
|
1121
|
+
if not isinstance(ctx.fem, FEMListForGlobal):
|
|
1122
|
+
logger.info(_(
|
|
1123
|
+
en_message='Solving {fem_name}...',
|
|
1124
|
+
jp_message='{fem_name} の解析を実行しています...',
|
|
1125
|
+
fem_name=ctx.fem.name,
|
|
1126
|
+
))
|
|
1053
1127
|
|
|
1054
1128
|
try:
|
|
1055
1129
|
ctx.fem.update()
|
|
@@ -1072,8 +1146,6 @@ class AbstractOptimizer(OptimizationData):
|
|
|
1072
1146
|
|
|
1073
1147
|
# ===== evaluate y =====
|
|
1074
1148
|
with nullcontext():
|
|
1075
|
-
logger.info(_('evaluating objective functions...'))
|
|
1076
|
-
|
|
1077
1149
|
try:
|
|
1078
1150
|
ctx_y: TrialOutput = ctx._y()
|
|
1079
1151
|
record.y.update(ctx_y)
|
|
@@ -1097,7 +1169,6 @@ class AbstractOptimizer(OptimizationData):
|
|
|
1097
1169
|
# ===== evaluate soft constraint =====
|
|
1098
1170
|
with nullcontext():
|
|
1099
1171
|
ctx_soft_c = TrialConstraintOutput()
|
|
1100
|
-
logger.info(_('evaluating remaining constraints...'))
|
|
1101
1172
|
|
|
1102
1173
|
try:
|
|
1103
1174
|
ctx._soft_c(ctx_soft_c)
|
|
@@ -1117,8 +1188,6 @@ class AbstractOptimizer(OptimizationData):
|
|
|
1117
1188
|
|
|
1118
1189
|
# ===== evaluate other functions =====
|
|
1119
1190
|
with nullcontext():
|
|
1120
|
-
logger.info(_('evaluating other functions...'))
|
|
1121
|
-
|
|
1122
1191
|
ctx_other_outputs = TrialFunctionOutput()
|
|
1123
1192
|
try:
|
|
1124
1193
|
ctx._other_outputs(ctx_other_outputs)
|
|
@@ -1141,8 +1210,11 @@ class AbstractOptimizer(OptimizationData):
|
|
|
1141
1210
|
|
|
1142
1211
|
raise e
|
|
1143
1212
|
|
|
1144
|
-
logger.info(_(
|
|
1145
|
-
|
|
1213
|
+
logger.info(_(
|
|
1214
|
+
en_message='Trial finished. Objective values:',
|
|
1215
|
+
jp_message='トライアルが終了しました。目的関数の値:',
|
|
1216
|
+
))
|
|
1217
|
+
logger.info(f' 出力: {record.y}')
|
|
1146
1218
|
record.state = TrialState.succeeded
|
|
1147
1219
|
|
|
1148
1220
|
opt_._check_and_raise_interruption()
|
|
@@ -1390,27 +1462,42 @@ class AbstractOptimizer(OptimizationData):
|
|
|
1390
1462
|
return LoggingOutput()
|
|
1391
1463
|
|
|
1392
1464
|
def _refresh_problem(self):
|
|
1393
|
-
# ctx の内容が減っている場合でも検出できるように初期化
|
|
1394
|
-
self._initialize_problem()
|
|
1395
1465
|
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1466
|
+
class SuppressDuplicateNameCheck:
|
|
1467
|
+
|
|
1468
|
+
def __init__(self, opt: OptimizationData):
|
|
1469
|
+
self._opt = opt
|
|
1470
|
+
|
|
1471
|
+
def __enter__(self_):
|
|
1472
|
+
self_._opt._suppress_duplicate_name_check = True
|
|
1473
|
+
|
|
1474
|
+
def __exit__(self_, exc_type, exc_val, exc_tb):
|
|
1475
|
+
self_._opt._suppress_duplicate_name_check = False
|
|
1476
|
+
|
|
1477
|
+
with SuppressDuplicateNameCheck(self):
|
|
1478
|
+
# ctx の内容が減っている場合でも検出できるように初期化
|
|
1479
|
+
self._initialize_problem()
|
|
1480
|
+
|
|
1481
|
+
for ctx in self.fem_manager.contexts:
|
|
1482
|
+
with SuppressDuplicateNameCheck(ctx):
|
|
1483
|
+
# femlist が _load すると各 FEMInterface が
|
|
1484
|
+
# 想定するのと異なる object_pass_to_fun (=Sequence)が
|
|
1485
|
+
# 渡されてしまうので、
|
|
1486
|
+
# 各 context のみが _load_... を行う必要がある。
|
|
1487
|
+
if not isinstance(ctx, GlobalOptimizationData):
|
|
1488
|
+
ctx._load_problem_from_fem()
|
|
1489
|
+
|
|
1490
|
+
# optimizer に反映する
|
|
1491
|
+
self.objectives.update(ctx.objectives)
|
|
1492
|
+
self.constraints.update(ctx.constraints)
|
|
1493
|
+
self.other_outputs.update(ctx.other_outputs)
|
|
1494
|
+
self.variable_manager.variables.update(ctx.variable_manager.variables)
|
|
1495
|
+
|
|
1496
|
+
# 特殊処理が必要な場合は最後に fem の責任で行う
|
|
1497
|
+
for ctx in self.fem_manager.contexts:
|
|
1498
|
+
if not isinstance(ctx, GlobalOptimizationData):
|
|
1499
|
+
with SuppressDuplicateNameCheck(ctx):
|
|
1500
|
+
ctx.fem.contact_to_optimizer(self, self.fem_manager.global_data, ctx)
|
|
1414
1501
|
|
|
1415
1502
|
# noinspection PyMethodMayBeStatic
|
|
1416
1503
|
def _get_additional_data(self) -> dict:
|
|
File without changes
|
|
File without changes
|