pyfemtet 0.9.5__py3-none-any.whl → 1.0.0b0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (272) hide show
  1. pyfemtet/__init__.py +6 -1
  2. pyfemtet/_i18n/1. make_pot_and_update_po.bat +8 -0
  3. pyfemtet/_i18n/2. build_mo.bat +5 -0
  4. pyfemtet/_i18n/__init__.py +4 -0
  5. pyfemtet/_i18n/babel.cfg +2 -0
  6. pyfemtet/_i18n/i18n.py +37 -0
  7. pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.mo +0 -0
  8. pyfemtet/_i18n/locales/ja/LC_MESSAGES/messages.po +1020 -0
  9. pyfemtet/_i18n/locales/messages.pot +987 -0
  10. pyfemtet/{_message → _i18n}/messages.py +128 -41
  11. pyfemtet/_util/closing.py +19 -0
  12. pyfemtet/_util/dask_util.py +89 -7
  13. pyfemtet/_util/df_util.py +29 -0
  14. pyfemtet/_util/excel_macro_util.py +8 -3
  15. pyfemtet/_util/excel_parse_util.py +43 -23
  16. pyfemtet/_util/femtet_access_inspection.py +120 -0
  17. pyfemtet/{_femtet_config_util/autosave.py → _util/femtet_autosave.py} +7 -0
  18. pyfemtet/_util/femtet_exit.py +105 -0
  19. pyfemtet/_util/femtet_version.py +20 -0
  20. pyfemtet/_util/helper.py +94 -0
  21. pyfemtet/_util/process_util.py +107 -0
  22. pyfemtet/_util/str_enum.py +44 -0
  23. pyfemtet/core.py +15 -47
  24. pyfemtet/dispatch_extensions/__init__.py +8 -11
  25. pyfemtet/dispatch_extensions/_impl.py +42 -198
  26. pyfemtet/logger/__init__.py +8 -1
  27. pyfemtet/logger/_impl.py +5 -6
  28. pyfemtet/opt/__init__.py +3 -17
  29. pyfemtet/opt/exceptions.py +45 -0
  30. pyfemtet/opt/femopt.py +608 -0
  31. pyfemtet/opt/history/__init__.py +11 -0
  32. pyfemtet/opt/history/_history.py +1404 -0
  33. pyfemtet/opt/history/_hypervolume.py +169 -0
  34. pyfemtet/opt/history/_optimality.py +79 -0
  35. pyfemtet/opt/interface/__init__.py +17 -24
  36. pyfemtet/opt/interface/_base_interface.py +222 -0
  37. pyfemtet/opt/interface/_excel_interface/__init__.py +3 -0
  38. pyfemtet/opt/interface/_excel_interface/debug-excel-interface.xlsm +0 -0
  39. pyfemtet/opt/interface/_excel_interface/excel_interface.py +999 -0
  40. pyfemtet/opt/interface/_femtet_interface/__init__.py +3 -0
  41. pyfemtet/opt/interface/{_femtet_parametric.py → _femtet_interface/_femtet_parametric.py} +20 -12
  42. pyfemtet/opt/interface/{_femtet.py → _femtet_interface/femtet_interface.py} +505 -349
  43. pyfemtet/opt/interface/_femtet_with_nx_interface/__init__.py +5 -0
  44. pyfemtet/opt/interface/_femtet_with_nx_interface/femtet_with_nx_interface.py +230 -0
  45. pyfemtet/opt/interface/_femtet_with_nx_interface/model1.prt +0 -0
  46. pyfemtet/opt/interface/_femtet_with_nx_interface/model1.x_t +98 -0
  47. pyfemtet/opt/interface/{_femtet_with_nx → _femtet_with_nx_interface}/update_model.py +1 -3
  48. pyfemtet/opt/interface/_femtet_with_solidworks/__init__.py +5 -0
  49. pyfemtet/opt/interface/_femtet_with_solidworks/femtet_with_solidworks_interface.py +122 -0
  50. pyfemtet/opt/interface/_solidworks_interface/__init__.py +5 -0
  51. pyfemtet/opt/interface/_solidworks_interface/solidworks_interface.py +206 -0
  52. pyfemtet/opt/interface/_surrogate_model_interface/__init__.py +8 -0
  53. pyfemtet/opt/interface/_surrogate_model_interface/base_surrogate_interface.py +150 -0
  54. pyfemtet/opt/interface/_surrogate_model_interface/botorch_interface.py +298 -0
  55. pyfemtet/opt/interface/_surrogate_model_interface/debug-pof-botorch.reccsv +18 -0
  56. pyfemtet/opt/interface/_with_excel_settings/__init__.py +61 -0
  57. pyfemtet/opt/interface/_with_excel_settings/with_excel_settings.py +134 -0
  58. pyfemtet/opt/meta_script/YAML_Generator.xlsm +0 -0
  59. pyfemtet/opt/meta_script/__main__.py +58 -36
  60. pyfemtet/opt/optimizer/__init__.py +7 -9
  61. pyfemtet/opt/optimizer/_base_optimizer.py +885 -0
  62. pyfemtet/opt/optimizer/optuna_optimizer/__init__.py +9 -0
  63. pyfemtet/opt/optimizer/optuna_optimizer/_optuna_attribute.py +73 -0
  64. pyfemtet/opt/optimizer/optuna_optimizer/_optuna_optimizer.py +678 -0
  65. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/__init__.py +7 -0
  66. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/debug-pof-botorch.reccsv +18 -0
  67. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/enable_nonlinear_constraint.py +244 -0
  68. pyfemtet/opt/optimizer/optuna_optimizer/_pof_botorch/pof_botorch_sampler.py +1249 -0
  69. pyfemtet/opt/optimizer/optuna_optimizer/wat_ex14_parametric_jp.femprj +0 -0
  70. pyfemtet/opt/optimizer/scipy_optimizer/__init__.py +1 -0
  71. pyfemtet/opt/optimizer/scipy_optimizer/_scipy_optimizer.py +364 -0
  72. pyfemtet/opt/prediction/__init__.py +7 -0
  73. pyfemtet/opt/prediction/_botorch_utils.py +133 -0
  74. pyfemtet/opt/prediction/_gpytorch_modules_extension.py +142 -0
  75. pyfemtet/opt/prediction/_helper.py +155 -0
  76. pyfemtet/opt/prediction/_model.py +118 -0
  77. pyfemtet/opt/problem/problem.py +304 -0
  78. pyfemtet/opt/problem/variable_manager/__init__.py +20 -0
  79. pyfemtet/opt/problem/variable_manager/_string_as_expression.py +115 -0
  80. pyfemtet/opt/problem/variable_manager/_variable_manager.py +295 -0
  81. pyfemtet/opt/visualization/history_viewer/__main__.py +5 -0
  82. pyfemtet/opt/visualization/{_base.py → history_viewer/_base_application.py} +18 -13
  83. pyfemtet/opt/visualization/history_viewer/_common_pages.py +150 -0
  84. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/alert_region.py +10 -5
  85. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/control_femtet.py +16 -13
  86. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/main_graph.py +117 -47
  87. pyfemtet/opt/visualization/{_complex_components → history_viewer/_complex_components}/pm_graph.py +159 -138
  88. pyfemtet/opt/visualization/history_viewer/_process_monitor/_application.py +173 -0
  89. pyfemtet/opt/visualization/history_viewer/_process_monitor/_pages.py +291 -0
  90. pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/dbc.py +1 -1
  91. pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/dcc.py +1 -1
  92. pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/html.py +1 -1
  93. pyfemtet/opt/visualization/history_viewer/result_viewer/__main__.py +5 -0
  94. pyfemtet/opt/visualization/{result_viewer/application.py → history_viewer/result_viewer/_application.py} +6 -6
  95. pyfemtet/opt/visualization/{result_viewer/pages.py → history_viewer/result_viewer/_pages.py} +106 -82
  96. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.csv +18 -0
  97. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08.db +0 -0
  98. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.jpg +0 -0
  99. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.log +45 -0
  100. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8.pdt +0 -0
  101. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.jpg +0 -0
  102. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_1.pdt +0 -0
  103. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.jpg +0 -0
  104. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_10.pdt +0 -0
  105. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.jpg +0 -0
  106. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_11.pdt +0 -0
  107. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.jpg +0 -0
  108. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_12.pdt +0 -0
  109. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.jpg +0 -0
  110. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_13.pdt +0 -0
  111. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.jpg +0 -0
  112. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_14.pdt +0 -0
  113. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.jpg +0 -0
  114. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_15.pdt +0 -0
  115. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.jpg +0 -0
  116. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_16.pdt +0 -0
  117. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.jpg +0 -0
  118. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_17.pdt +0 -0
  119. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.jpg +0 -0
  120. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_18.pdt +0 -0
  121. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.jpg +0 -0
  122. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_19.pdt +0 -0
  123. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.jpg +0 -0
  124. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_2.pdt +0 -0
  125. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.jpg +0 -0
  126. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_20.pdt +0 -0
  127. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.jpg +0 -0
  128. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_3.pdt +0 -0
  129. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bgr +0 -0
  130. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.bnd +0 -0
  131. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.btr +0 -0
  132. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.jpg +0 -0
  133. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.mtl +0 -0
  134. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.pdt +0 -0
  135. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_4.prm +0 -0
  136. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.jpg +0 -0
  137. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_5.pdt +0 -0
  138. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.jpg +0 -0
  139. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_6.pdt +0 -0
  140. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.jpg +0 -0
  141. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_7.pdt +0 -0
  142. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.jpg +0 -0
  143. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_8.pdt +0 -0
  144. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.jpg +0 -0
  145. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.Results/ex8_trial_9.pdt +0 -0
  146. pyfemtet/opt/visualization/history_viewer/result_viewer/tutorial_files/tutorial_gau_ex08_parametric.femprj +0 -0
  147. pyfemtet/opt/visualization/plotter/main_figure_creator.py +536 -0
  148. pyfemtet/opt/visualization/plotter/pm_graph_creator.py +359 -0
  149. pyfemtet/opt/worker_status.py +120 -0
  150. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/METADATA +23 -24
  151. pyfemtet-1.0.0b0.dist-info/RECORD +172 -0
  152. pyfemtet-1.0.0b0.dist-info/entry_points.txt +3 -0
  153. pyfemtet/_femtet_config_util/exit.py +0 -59
  154. pyfemtet/_message/1. make_pot.bat +0 -11
  155. pyfemtet/_message/2. make_mo.bat +0 -6
  156. pyfemtet/_message/__init__.py +0 -5
  157. pyfemtet/_message/babel.cfg +0 -2
  158. pyfemtet/_message/locales/ja/LC_MESSAGES/messages.mo +0 -0
  159. pyfemtet/_message/locales/ja/LC_MESSAGES/messages.po +0 -570
  160. pyfemtet/_message/locales/messages.pot +0 -551
  161. pyfemtet/_warning.py +0 -87
  162. pyfemtet/brep/_impl.py +0 -18
  163. pyfemtet/opt/_femopt.py +0 -1007
  164. pyfemtet/opt/_femopt_core.py +0 -1169
  165. pyfemtet/opt/_test_utils/control_femtet.py +0 -39
  166. pyfemtet/opt/_test_utils/hyper_sphere.py +0 -24
  167. pyfemtet/opt/_test_utils/record_history.py +0 -130
  168. pyfemtet/opt/advanced_samples/excel_ui/(ref) original_project.femprj +0 -0
  169. pyfemtet/opt/advanced_samples/excel_ui/femtet-macro.xlsm +0 -0
  170. pyfemtet/opt/advanced_samples/excel_ui/pyfemtet-core.py +0 -291
  171. pyfemtet/opt/advanced_samples/excel_ui/test-pyfemtet-core.cmd +0 -22
  172. pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric.femprj +0 -0
  173. pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric_restart.py +0 -99
  174. pyfemtet/opt/advanced_samples/restart/gal_ex13_parametric_restart_jp.py +0 -102
  175. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_create_training_data.py +0 -60
  176. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_create_training_data_jp.py +0 -57
  177. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate.py +0 -100
  178. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_optimize_with_surrogate_jp.py +0 -90
  179. pyfemtet/opt/advanced_samples/surrogate_model/gal_ex13_parametric.femprj +0 -0
  180. pyfemtet/opt/interface/_base.py +0 -101
  181. pyfemtet/opt/interface/_excel_interface.py +0 -984
  182. pyfemtet/opt/interface/_femtet_excel.py +0 -141
  183. pyfemtet/opt/interface/_femtet_with_nx/__init__.py +0 -3
  184. pyfemtet/opt/interface/_femtet_with_nx/_interface.py +0 -178
  185. pyfemtet/opt/interface/_femtet_with_sldworks.py +0 -298
  186. pyfemtet/opt/interface/_surrogate/__init__.py +0 -5
  187. pyfemtet/opt/interface/_surrogate/_base.py +0 -129
  188. pyfemtet/opt/interface/_surrogate/_chaospy.py +0 -71
  189. pyfemtet/opt/interface/_surrogate/_singletaskgp.py +0 -71
  190. pyfemtet/opt/interface/_surrogate_excel.py +0 -102
  191. pyfemtet/opt/optimizer/_base.py +0 -376
  192. pyfemtet/opt/optimizer/_optuna/_botorch_patch/enable_nonlinear_constraint.py +0 -220
  193. pyfemtet/opt/optimizer/_optuna/_optuna.py +0 -434
  194. pyfemtet/opt/optimizer/_optuna/_pof_botorch.py +0 -1914
  195. pyfemtet/opt/optimizer/_scipy.py +0 -159
  196. pyfemtet/opt/optimizer/_scipy_scalar.py +0 -127
  197. pyfemtet/opt/optimizer/parameter.py +0 -113
  198. pyfemtet/opt/prediction/_base.py +0 -61
  199. pyfemtet/opt/prediction/single_task_gp.py +0 -119
  200. pyfemtet/opt/samples/femprj_sample/ParametricIF.femprj +0 -0
  201. pyfemtet/opt/samples/femprj_sample/ParametricIF.py +0 -29
  202. pyfemtet/opt/samples/femprj_sample/ParametricIF_test_result.reccsv +0 -13
  203. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.femprj +0 -0
  204. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.prt +0 -0
  205. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX.py +0 -135
  206. pyfemtet/opt/samples/femprj_sample/cad_ex01_NX_test_result.reccsv +0 -23
  207. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.SLDPRT +0 -0
  208. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.femprj +0 -0
  209. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW.py +0 -131
  210. pyfemtet/opt/samples/femprj_sample/cad_ex01_SW_test_result.reccsv +0 -23
  211. pyfemtet/opt/samples/femprj_sample/constrained_pipe.femprj +0 -0
  212. pyfemtet/opt/samples/femprj_sample/constrained_pipe.py +0 -96
  213. pyfemtet/opt/samples/femprj_sample/constrained_pipe_test_result.reccsv +0 -13
  214. pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric.femprj +0 -0
  215. pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric.py +0 -74
  216. pyfemtet/opt/samples/femprj_sample/gal_ex58_parametric_test_result.reccsv +0 -13
  217. pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric.femprj +0 -0
  218. pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric.py +0 -58
  219. pyfemtet/opt/samples/femprj_sample/gau_ex08_parametric_test_result.reccsv +0 -23
  220. pyfemtet/opt/samples/femprj_sample/gau_ex12_parametric.femprj +0 -0
  221. pyfemtet/opt/samples/femprj_sample/gau_ex12_parametric.py +0 -52
  222. pyfemtet/opt/samples/femprj_sample/her_ex40_parametric.femprj +0 -0
  223. pyfemtet/opt/samples/femprj_sample/her_ex40_parametric.py +0 -138
  224. pyfemtet/opt/samples/femprj_sample/her_ex40_parametric_test_result.reccsv +0 -18
  225. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric.femprj +0 -0
  226. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric.py +0 -60
  227. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric_parallel.py +0 -61
  228. pyfemtet/opt/samples/femprj_sample/paswat_ex1_parametric_test_result.reccsv +0 -18
  229. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric.femprj +0 -0
  230. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric.py +0 -58
  231. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric_parallel.py +0 -58
  232. pyfemtet/opt/samples/femprj_sample/wat_ex14_parametric_test_result.reccsv +0 -18
  233. pyfemtet/opt/samples/femprj_sample_jp/ParametricIF_jp.femprj +0 -0
  234. pyfemtet/opt/samples/femprj_sample_jp/ParametricIF_jp.py +0 -29
  235. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_NX_jp.femprj +0 -0
  236. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_NX_jp.py +0 -129
  237. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_SW_jp.femprj +0 -0
  238. pyfemtet/opt/samples/femprj_sample_jp/cad_ex01_SW_jp.py +0 -125
  239. pyfemtet/opt/samples/femprj_sample_jp/constrained_pipe_jp.py +0 -93
  240. pyfemtet/opt/samples/femprj_sample_jp/gal_ex58_parametric_jp.femprj +0 -0
  241. pyfemtet/opt/samples/femprj_sample_jp/gal_ex58_parametric_jp.py +0 -70
  242. pyfemtet/opt/samples/femprj_sample_jp/gau_ex08_parametric_jp.femprj +0 -0
  243. pyfemtet/opt/samples/femprj_sample_jp/gau_ex08_parametric_jp.py +0 -57
  244. pyfemtet/opt/samples/femprj_sample_jp/gau_ex12_parametric_jp.py +0 -52
  245. pyfemtet/opt/samples/femprj_sample_jp/her_ex40_parametric_jp.femprj +0 -0
  246. pyfemtet/opt/samples/femprj_sample_jp/her_ex40_parametric_jp.py +0 -138
  247. pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_jp.femprj +0 -0
  248. pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_jp.py +0 -58
  249. pyfemtet/opt/samples/femprj_sample_jp/paswat_ex1_parametric_parallel_jp.py +0 -59
  250. pyfemtet/opt/samples/femprj_sample_jp/wat_ex14_parametric_jp.py +0 -56
  251. pyfemtet/opt/samples/femprj_sample_jp/wat_ex14_parametric_parallel_jp.py +0 -56
  252. pyfemtet/opt/visualization/_complex_components/main_figure_creator.py +0 -332
  253. pyfemtet/opt/visualization/_complex_components/pm_graph_creator.py +0 -201
  254. pyfemtet/opt/visualization/_process_monitor/application.py +0 -226
  255. pyfemtet/opt/visualization/_process_monitor/pages.py +0 -406
  256. pyfemtet/opt/visualization/_wrapped_components/__init__.py +0 -0
  257. pyfemtet/opt/visualization/result_viewer/__init__.py +0 -0
  258. pyfemtet-0.9.5.dist-info/RECORD +0 -158
  259. pyfemtet-0.9.5.dist-info/entry_points.txt +0 -3
  260. /pyfemtet/{_femtet_config_util → opt/problem}/__init__.py +0 -0
  261. /pyfemtet/{brep → opt/visualization/history_viewer}/__init__.py +0 -0
  262. /pyfemtet/opt/{_test_utils → visualization/history_viewer/_complex_components}/__init__.py +0 -0
  263. /pyfemtet/opt/{optimizer/_optuna → visualization/history_viewer/_process_monitor}/__init__.py +0 -0
  264. /pyfemtet/opt/{optimizer/_optuna/_botorch_patch → visualization/history_viewer/_wrapped_components}/__init__.py +0 -0
  265. /pyfemtet/opt/visualization/{_wrapped_components → history_viewer/_wrapped_components}/str_enum.py +0 -0
  266. /pyfemtet/opt/visualization/{result_viewer → history_viewer/result_viewer}/.gitignore +0 -0
  267. /pyfemtet/opt/visualization/{_complex_components → history_viewer/result_viewer}/__init__.py +0 -0
  268. /pyfemtet/opt/visualization/{_process_monitor → plotter}/__init__.py +0 -0
  269. /pyfemtet/opt/{samples/femprj_sample_jp/wat_ex14_parametric_jp.femprj → wat_ex14_parametric_jp.femprj} +0 -0
  270. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/LICENSE +0 -0
  271. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/LICENSE_THIRD_PARTY.txt +0 -0
  272. {pyfemtet-0.9.5.dist-info → pyfemtet-1.0.0b0.dist-info}/WHEEL +0 -0
@@ -1,52 +0,0 @@
1
- """Optimization using parametric analysis output settings as the objective function
2
-
3
- This demo shows how to use the values outputted by Femtet's parametric
4
- analysis output setting feature as the objective function for optimization.
5
- This feature allows you to perform optimization without coding the objective function.
6
-
7
-
8
- Note:
9
-
10
- Please be aware of the following when using this feature.
11
-
12
- - The sweep table from the parametric analysis will be deleted.
13
- - Output settings that produce complex numbers or vectors will only use
14
- the first value as the objective function. (For complex numbers, it will be
15
- the real part, and for vector values, it will be components such as X.)
16
-
17
-
18
- Corresponding project: gau_ex12_parametric.femprj
19
-
20
- """
21
-
22
- from pyfemtet.opt import FEMOpt, FemtetInterface
23
-
24
-
25
- if __name__ == '__main__':
26
-
27
- # Initialize an object to connect to
28
- # Femtet for referencing Femtet settings.
29
- fem = FemtetInterface()
30
-
31
- # Set the output settings of the parametric analysis as the objective function.
32
- # `number` is the index from the `results output settings` tab of the
33
- # Femtet parametric analysis dialog, and `direction` is
34
- # the goal of that objective function (similar to FEMOpt.add_objective).
35
-
36
- # Mutual inductance
37
- fem.use_parametric_output_as_objective(number=1, direction=1.5e-7)
38
-
39
- # Strength of magnetic field at the center of the coil
40
- fem.use_parametric_output_as_objective(number=2, direction='minimize')
41
-
42
- # Initialize optimization object.
43
- # Pass in the previously initialized fem object.
44
- femopt = FEMOpt(fem=fem)
45
-
46
- # Set parameters.
47
- femopt.add_parameter('in_radius', 10, 5, 10)
48
- femopt.add_parameter('out_radius', 20, 20, 25)
49
-
50
- # Execute optimization.
51
- femopt.set_random_seed(42) # Fix random seed
52
- femopt.optimize(n_trials=20)
@@ -1,138 +0,0 @@
1
- """Single-objective optimization: Resonant frequency of a circular patch antenna
2
-
3
- Using Femtet’s electromagnetic wave analysis solver,
4
- we explain an example of setting the resonant frequency
5
- of a circular patch antenna to a specific value.
6
-
7
- Corresponding project: her_ex40_parametric.femprj
8
- """
9
- from time import sleep
10
-
11
- import numpy as np
12
- from scipy.signal import find_peaks
13
- from tqdm import tqdm
14
-
15
- from pyfemtet.core import SolveError
16
- from pyfemtet.opt import OptunaOptimizer, FEMOpt
17
- from pyfemtet.opt.optimizer import PoFBoTorchSampler
18
-
19
-
20
- class SParameterCalculator:
21
- """Calculating S-parameters and resonance frequencies."""
22
-
23
- def __init__(self):
24
- self.freq = []
25
- self.S = []
26
- self.interpolated_function = None
27
- self.resonance_frequency = None
28
- self.minimum_S = None
29
-
30
- def _get_freq_and_S_parameter(self, Femtet):
31
- """Obtain the relationship between frequency and S-parameter"""
32
-
33
- Gogh = Femtet.Gogh
34
-
35
- freq_list = []
36
- dB_S_list = []
37
- for mode in tqdm(range(Gogh.Hertz.nMode), 'Obtain frequency and S-parameter.'):
38
- # mode setting
39
- Gogh.Hertz.Mode = mode
40
- sleep(0.01)
41
-
42
- # Obtain frequency
43
- freq = Gogh.Hertz.GetFreq().Real
44
-
45
- # Obtain S(1, 1)
46
- comp_S = Gogh.Hertz.GetSMatrix(0, 0)
47
- norm = np.linalg.norm((comp_S.Real, comp_S.Imag))
48
- dB_S = 20 * np.log10(norm)
49
-
50
- # Save them
51
- freq_list.append(freq)
52
- dB_S_list.append(dB_S)
53
-
54
- self.freq = freq_list
55
- self.S = dB_S_list
56
-
57
- def _calc_resonance_frequency(self):
58
- """Compute the frequency that gives the first peak for S-parameter."""
59
- peaks, _ = find_peaks(-np.array(self.S), height=None, threshold=None, distance=None, prominence=0.5, width=None, wlen=None, rel_height=0.5, plateau_size=None)
60
- if len(peaks) == 0:
61
- raise SolveError('No S(1,1) peaks detected.')
62
- self.resonance_frequency = self.freq[peaks[0]]
63
- self.minimum_S = self.S[peaks[0]]
64
-
65
- def get_resonance_frequency(self, Femtet):
66
- """Calculate the resonant frequency.
67
-
68
- Note:
69
- The objective or constraint function should take Femtet
70
- as its first argument and return a float as the output.
71
-
72
- Params:
73
- Femtet: This is an instance for manipulating Femtet with macros. For detailed information, please refer to "Femtet Macro Help".
74
-
75
- Returns:
76
- float: A resonance frequency of the antenna.
77
- """
78
- self._get_freq_and_S_parameter(Femtet)
79
- self._calc_resonance_frequency()
80
- return self.resonance_frequency # unit: Hz
81
-
82
-
83
- def antenna_is_smaller_than_substrate(Femtet, opt):
84
- """Calculate the relationship between antenna size and board size.
85
-
86
- This function is used to constrain the model
87
- from breaking down while changing parameters.
88
-
89
- Returns:
90
- float: Difference between the substrate size and antenna size. Must be equal to or grater than 1 mm.
91
- """
92
- params = opt.get_parameter()
93
- r = params['antenna_radius']
94
- w = params['substrate_w']
95
- return w / 2 - r # unit: mm
96
-
97
-
98
- def port_is_inside_antenna(Femtet, opt):
99
- """Calculate the relationship between the feed port location and antenna size."""
100
- params = opt.get_parameter()
101
- r = params['antenna_radius']
102
- x = params['port_x']
103
- return r - x # unit: mm. Must be equal to or grater than 1 mm.
104
-
105
-
106
- if __name__ == '__main__':
107
- # Initialize the object for calculating frequency characteristics.
108
- s = SParameterCalculator()
109
-
110
- # Initialize the numerical optimization problem.
111
- # (determine the optimization method)
112
- opt = OptunaOptimizer(
113
- sampler_class=PoFBoTorchSampler,
114
- sampler_kwargs=dict(
115
- n_startup_trials=10,
116
- )
117
- )
118
-
119
- # Initialize the FEMOpt object.
120
- # (establish connection between the optimization problem and Femtet)
121
- femopt = FEMOpt(opt=opt)
122
-
123
- # Add design variables to the optimization problem.
124
- # (Specify the variables registered in the femprj file.)
125
- femopt.add_parameter('antenna_radius', 10, 5, 20)
126
- femopt.add_parameter('substrate_w', 50, 40, 60)
127
- femopt.add_parameter('port_x', 5, 1, 20)
128
-
129
- # Add the constraint function to the optimization problem.
130
- femopt.add_constraint(antenna_is_smaller_than_substrate, 'antenna and substrate clearance', lower_bound=1, args=(opt,))
131
- femopt.add_constraint(port_is_inside_antenna, 'antenna and port clearance', lower_bound=1, args=(opt,))
132
-
133
- # Add the objective function to the optimization problem.
134
- # The target frequency is 3.0 GHz.
135
- femopt.add_objective(s.get_resonance_frequency, 'first resonant frequency(Hz)', direction=3.0 * 1e9)
136
-
137
- femopt.set_random_seed(42)
138
- femopt.optimize(n_trials=15)
@@ -1,18 +0,0 @@
1
- "{""femprj_path"": ""E:\\pyfemtet\\pyfemtet\\pyfemtet\\opt\\femprj_sample\\her_ex40_parametric.femprj"", ""model_name"": ""Harm""}",prm,prm_lb,prm_ub,prm,prm_lb,prm_ub,prm,prm_lb,prm_ub,obj,obj_direction,,cns,cns_lb,cns_ub,cns,cns_lb,cns_ub,,,,
2
- ,,,,,,,,,,,,,,,,,,,,,,
3
- trial,antenna_radius,antenna_radius_lower_bound,antenna_radius_upper_bound,substrate_w,substrate_w_lower_bound,substrate_w_upper_bound,port_x,port_x_lower_bound,port_x_upper_bound,first resonant frequency(Hz),first resonant frequency(Hz)_direction,non_domi,antenna and substrate clearance,antenna and substrate clearance_lower_bound,antenna and substrate clearance_upper_bound,antenna and port clearance,antenna and port clearance_lower_bound,antenna and port clearance_upper_bound,feasible,hypervolume,message,time
4
- 1,10.0,5.0,20.0,50.0,40.0,60.0,5.0,1.0,20.0,4289000000.0,3000000000.0,False,15.0,1,,5.0,1,,True,-1.0,initial,2024-09-11 15:22:45.703728
5
- 2,13.979877262955549,5.0,20.0,43.12037280884873,40.0,60.0,3.96389588638785,1.0,20.0,3050000000.0,3000000000.0,False,7.580309141468815,1,,10.015981376567698,1,,True,-1.0,,2024-09-11 15:23:00.502240
6
- 3,17.48663961200633,5.0,20.0,44.246782213565524,40.0,60.0,4.4546743769349115,1.0,20.0,2460000000.0,3000000000.0,False,4.6367514947764334,1,,13.031965235071418,1,,True,-1.0,,2024-09-11 15:23:19.497216
7
- 4,11.841049763255539,5.0,20.0,55.70351922786027,40.0,60.0,4.793801861008835,1.0,20.0,3581000000.0,3000000000.0,False,16.010709850674594,1,,7.047247902246704,1,,True,-1.0,,2024-09-11 15:23:38.392090
8
- 5,12.713516576204174,5.0,20.0,51.84829137724085,40.0,60.0,1.8825578416799567,1.0,20.0,2932000000.0,3000000000.0,False,13.21062911241625,1,,10.830958734524218,1,,True,-1.0,,2024-09-11 15:23:50.146083
9
- 6,14.113172778521575,5.0,20.0,43.41048247374583,40.0,60.0,2.235980266720311,1.0,20.0,2991000000.0,3000000000.0,True,7.59206845835134,1,,11.877192511801264,1,,True,-1.0,,2024-09-11 15:24:04.616007
10
- 7,19.233283058799998,5.0,20.0,59.31264066149119,40.0,60.0,16.35954961421276,1.0,20.0,2283000000.0,3000000000.0,False,10.423037271945596,1,,2.873733444587238,1,,True,-1.0,,2024-09-11 15:24:33.762831
11
- 8,11.60228740609402,5.0,20.0,42.44076469689558,40.0,60.0,10.408361292114133,1.0,20.0,3758000000.0,3000000000.0,False,9.61809494235377,1,,1.1939261139798862,1,,True,-1.0,,2024-09-11 15:24:53.700769
12
- 9,14.93783426530973,5.0,20.0,46.23422152178822,40.0,60.0,10.881292402378406,1.0,20.0,2932000000.0,3000000000.0,False,8.17927649558438,1,,4.056541862931324,1,,True,-1.0,,2024-09-11 15:25:17.611571
13
- 10,13.968499682166277,5.0,20.0,58.437484700462335,40.0,60.0,2.6813575389864703,1.0,20.0,2991000000.0,3000000000.0,True,15.25024266806489,1,,11.287142143179807,1,,True,-1.0,,2024-09-11 15:25:33.276468
14
- 11,14.05789863217095,5.0,20.0,51.01059902831617,40.0,60.0,1.737571530783426,1.0,20.0,2991000000.0,3000000000.0,True,11.447400881987136,1,,12.320327101387523,1,,True,-1.0,,2024-09-11 15:26:05.718398
15
- 12,14.201356537883626,5.0,20.0,52.843533197525375,40.0,60.0,7.413439727286647,1.0,20.0,3050000000.0,3000000000.0,False,12.220410060879061,1,,6.787916810596979,1,,True,-1.0,,2024-09-11 15:26:37.472938
16
- 13,13.425463212064672,5.0,20.0,52.02680338112066,40.0,60.0,1.0,1.0,20.0,3109000000.0,3000000000.0,False,12.587938478495657,1,,12.425463212064672,1,,True,-1.0,,2024-09-11 15:27:05.737378
17
- 14,14.859313853083268,5.0,20.0,48.76719051860414,40.0,60.0,4.518838210753849,1.0,20.0,2873000000.0,3000000000.0,False,9.524281406218801,1,,10.34047564232942,1,,True,-1.0,,2024-09-11 15:27:37.696689
18
- 15,13.72477890084936,5.0,20.0,49.21346368364997,40.0,60.0,4.707562522313161,1.0,20.0,3050000000.0,3000000000.0,False,10.881952940975625,1,,9.0172163785362,1,,True,-1.0,,2024-09-11 15:28:09.261355
@@ -1,60 +0,0 @@
1
- """Multi-objective optimization: Air cooling of IC on a printed circuit board (forced convection).
2
-
3
- Using Femtet's simple fluid-thermal analysis solver,
4
- design a solution that reduces the chip temperature
5
- while minimizing the substrate size.
6
-
7
- Related project: paswat_ex1_parametric.femprj
8
- """
9
- from pyfemtet.opt import FEMOpt
10
-
11
-
12
- def chip_temp(Femtet, chip_name):
13
- """Obtain the maximum temperature of the chip.
14
-
15
- Note:
16
- The objective or constraint function should take Femtet
17
- as its first argument and return a float as the output.
18
-
19
- Params:
20
- Femtet: An instance for manipulating Femtet with macros. For detailed information, please refer to "Femtet Macro Help".
21
- chip_name (str): The body attribute name defined in femprj. Valid values are 'MAINCHIP' or 'SUBCHIP'.
22
-
23
- Returns:
24
- float: The maximum temperature of the body with the specified body attribute name.
25
- """
26
- Gogh = Femtet.Gogh
27
-
28
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
29
-
30
- return max_temperature # unit: degree
31
-
32
-
33
- def substrate_size(Femtet):
34
- """Calculate the occupied area on the XY plane of the substrate."""
35
- substrate_w = Femtet.GetVariableValue('substrate_w')
36
- substrate_d = Femtet.GetVariableValue('substrate_d')
37
- return substrate_w * substrate_d # unit: mm2
38
-
39
-
40
- if __name__ == '__main__':
41
-
42
- # Initialize the FEMOpt object.
43
- # (establish connection between the optimization problem and Femtet)
44
- femopt = FEMOpt()
45
-
46
- # Add design variables to the optimization problem.
47
- # (Specify the variables registered in the femprj file.)
48
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=60)
49
- femopt.add_parameter("substrate_d", 60, lower_bound=34, upper_bound=60)
50
- femopt.add_parameter("rot", 0, lower_bound=0, upper_bound=180)
51
-
52
- # Add the objective function to the optimization problem.
53
- # The target bending angle is 90 degrees.
54
- femopt.add_objective(chip_temp, name='max temp. of<br>MAINCHIP (degree)', direction='minimize', args=('MAINCHIP',))
55
- femopt.add_objective(chip_temp, name='max temp. of<br>SUBCHIP (degree)', direction='minimize', args=('SUBCHIP',))
56
- femopt.add_objective(substrate_size, name='substrate size (mm2)', direction='minimize')
57
-
58
- # Run optimization.
59
- femopt.set_random_seed(42)
60
- femopt.optimize(n_trials=15)
@@ -1,61 +0,0 @@
1
- """Multi-objective optimization: Air cooling of IC on a printed circuit board (forced convection).
2
-
3
- Using Femtet's simple fluid-thermal analysis solver,
4
- design a solution that reduces the chip temperature
5
- while minimizing the substrate size.
6
-
7
- Related project: paswat_ex1_parametric.femprj
8
- """
9
- from pyfemtet.opt import FEMOpt
10
-
11
-
12
- def chip_temp(Femtet, chip_name):
13
- """Obtain the maximum temperature of the chip.
14
-
15
- Note:
16
- The objective or constraint function should take Femtet
17
- as its first argument and return a float as the output.
18
-
19
- Params:
20
- Femtet: An instance for manipulating Femtet with macros. For detailed information, please refer to "Femtet Macro Help".
21
- chip_name (str): The body attribute name defined in femprj. Valid values are 'MAINCHIP' or 'SUBCHIP'.
22
-
23
- Returns:
24
- float: The maximum temperature of the body with the specified body attribute name.
25
- """
26
- Gogh = Femtet.Gogh
27
-
28
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
29
-
30
- return max_temperature # unit: degree
31
-
32
-
33
- def substrate_size(Femtet):
34
- """Calculate the occupied area on the XY plane of the substrate."""
35
- substrate_w = Femtet.GetVariableValue('substrate_w')
36
- substrate_d = Femtet.GetVariableValue('substrate_d')
37
- return substrate_w * substrate_d # unit: mm2
38
-
39
-
40
- if __name__ == '__main__':
41
-
42
- # Initialize the FEMOpt object.
43
- # (establish connection between the optimization problem and Femtet)
44
- femopt = FEMOpt()
45
-
46
- # Add design variables to the optimization problem.
47
- # (Specify the variables registered in the femprj file.)
48
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=60)
49
- femopt.add_parameter("substrate_d", 60, lower_bound=34, upper_bound=60)
50
- femopt.add_parameter("rot", 0, lower_bound=0, upper_bound=180)
51
-
52
- # Add the objective function to the optimization problem.
53
- # The target bending angle is 90 degrees.
54
- femopt.add_objective(chip_temp, name='max temp. of<br>MAINCHIP (degree)', direction='minimize', args=('MAINCHIP',))
55
- femopt.add_objective(chip_temp, name='max temp. of<br>SUBCHIP (degree)', direction='minimize', args=('SUBCHIP',))
56
- femopt.add_objective(substrate_size, name='substrate size (mm2)', direction='minimize')
57
-
58
- # Run optimization.
59
- femopt.set_random_seed(42)
60
- # femopt.optimize(n_trials=15)
61
- femopt.optimize(n_trials=30, n_parallel=3) # This line is the only difference with no parallel pattern.
@@ -1,18 +0,0 @@
1
- "{""femprj_path"": null, ""model_name"": ""Ex1""}",prm,prm_lb,prm_ub,prm,prm_lb,prm_ub,prm,prm_lb,prm_ub,obj,obj_direction,obj,obj_direction,obj,obj_direction,,,,,
2
- ,,,,,,,,,,,,,,,,,,,,
3
- trial,substrate_w,substrate_w_lower_bound,substrate_w_upper_bound,substrate_d,substrate_d_lower_bound,substrate_d_upper_bound,rot,rot_lower_bound,rot_upper_bound,max temp. of<br>MAINCHIP (degree),max temp. of<br>MAINCHIP (degree)_direction,max temp. of<br>SUBCHIP (degree),max temp. of<br>SUBCHIP (degree)_direction,substrate size (mm2),substrate size (mm2)_direction,non_domi,feasible,hypervolume,message,time
4
- 1,40.0,22.0,60.0,60.0,34.0,60.0,0.0,0.0,180.0,33.67695768585457,minimize,33.95371403109053,minimize,2400.0,minimize,True,True,0.0,initial,2024-07-24 10:05:57.757339
5
- 2,36.232524516199774,22.0,60.0,58.71857196665782,34.0,60.0,131.75890952605292,0.0,180.0,36.75061339654762,minimize,35.98760273556493,minimize,2127.522098595014,minimize,False,True,0.0,,2024-07-24 10:06:01.296834
6
- 3,44.74902239948739,22.0,60.0,38.05648465150335,34.0,60.0,28.079013660516477,0.0,180.0,37.66121580232737,minimize,37.68837572841849,minimize,1702.9904863055572,minimize,False,True,0.0,,2024-07-24 10:06:04.717053
7
- 4,24.20717726239158,22.0,60.0,56.52057979014832,34.0,60.0,108.20070211377758,0.0,180.0,38.03360975556741,minimize,37.13220773920758,minimize,1368.2036963173987,minimize,False,True,0.0,,2024-07-24 10:06:08.044829
8
- 5,48.90675795624973,22.0,60.0,34.53519685169086,34.0,60.0,174.58377338915898,0.0,180.0,35.80085616996519,minimize,35.41803365229831,minimize,1689.0045172706505,minimize,True,True,2655.3792155560236,,2024-07-24 10:06:11.673901
9
- 6,53.632820350416026,22.0,60.0,39.520816877635184,34.0,60.0,32.72849409727811,0.0,180.0,36.27586854474357,minimize,36.24746978386388,minimize,2119.612874858985,minimize,False,True,2655.3792155560236,,2024-07-24 10:06:15.225128
10
- 7,28.969371374430487,22.0,60.0,41.91029831694798,34.0,60.0,94.45615769380281,0.0,180.0,37.30507756126405,minimize,37.03664336282748,minimize,1214.1149969374887,minimize,True,True,19184.32668678295,,2024-07-24 10:06:18.764796
11
- 8,38.413910708400394,22.0,60.0,41.57195764514909,34.0,60.0,110.1335210500283,0.0,180.0,37.576825749440374,minimize,37.231832629702204,minimize,1596.9414668705863,minimize,False,True,19184.32668678295,,2024-07-24 10:06:22.282485
12
- 9,27.30076670477759,22.0,60.0,41.59576086191567,34.0,60.0,65.9451317928645,0.0,180.0,40.33192963854171,minimize,40.39845817793035,minimize,1135.596164039882,minimize,True,True,24234.66796011994,,2024-07-24 10:06:25.904124
13
- 10,39.33065940024737,22.0,60.0,54.41457499621835,34.0,60.0,35.941280788504756,0.0,180.0,36.33478914704486,minimize,36.42436238619176,minimize,2140.161115720755,minimize,False,True,24234.66796011994,,2024-07-24 10:06:29.260928
14
- 11,29.88951598161767,22.0,60.0,48.530123354694155,34.0,60.0,153.62497867846213,0.0,180.0,39.42958363258023,minimize,38.570208604192814,minimize,1450.5418998462744,minimize,False,True,24234.66796011994,,2024-07-24 10:06:32.748741
15
- 12,51.50411117580676,22.0,60.0,34.64935734325736,34.0,60.0,163.37966315085322,0.0,180.0,36.243388661644765,minimize,35.89913974080298,minimize,1784.5843513877317,minimize,False,True,24234.66796011994,,2024-07-24 10:06:36.255279
16
- 13,58.47128834592597,22.0,60.0,50.2261717064815,34.0,60.0,69.5953458965549,0.0,180.0,33.72761232832835,minimize,33.570434569823526,minimize,2936.788965676001,minimize,False,True,24234.66796011994,,2024-07-24 10:06:39.727153
17
- 14,46.461083991705294,22.0,60.0,52.67788993568556,34.0,60.0,1.566043851073855,0.0,180.0,33.15699451479896,minimize,33.36797160473804,minimize,2447.4718675866516,minimize,True,True,24235.06403490691,,2024-07-24 10:06:43.291946
18
- 15,32.86246372091377,22.0,60.0,44.89911623031552,34.0,60.0,177.41375888117255,0.0,180.0,37.33987016195943,minimize,36.382991928600596,minimize,1475.495576284582,minimize,True,True,24335.190010579503,,2024-07-24 10:06:46.809916
@@ -1,58 +0,0 @@
1
- """Multi-objective optimization: heating element on substrate.
2
-
3
- Using Femtet's heat conduction analysis solver, we will design
4
- to reduce the chip temperature and shrink the board size.
5
-
6
- Corresponding project: wat_ex14_parametric.femprj
7
- """
8
- from pyfemtet.opt import FEMOpt
9
-
10
-
11
- def chip_temp(Femtet, chip_name):
12
- """Obtain the maximum temperature of the chip.
13
-
14
- Note:
15
- The objective or constraint function should take Femtet
16
- as its first argument and return a float as the output.
17
-
18
- Params:
19
- Femtet: An instance for manipulating Femtet with macros. For detailed information, please refer to "Femtet Macro Help".
20
- chip_name (str): The body attribute name defined in femprj. Valid values are 'MAINCHIP' or 'SUBCHIP'.
21
-
22
- Returns:
23
- float: The maximum temperature of the body with the specified body attribute name.
24
- """
25
- Gogh = Femtet.Gogh
26
-
27
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
28
-
29
- return max_temperature # unit: degree
30
-
31
-
32
- def substrate_size(Femtet):
33
- """Calculate the occupied area on the XY plane of the substrate."""
34
- substrate_w = Femtet.GetVariableValue('substrate_w')
35
- substrate_d = Femtet.GetVariableValue('substrate_d')
36
- return substrate_w * substrate_d # unit: mm2
37
-
38
-
39
- if __name__ == '__main__':
40
-
41
- # Initialize the FEMOpt object.
42
- # (establish connection between the optimization problem and Femtet)
43
- femopt = FEMOpt()
44
-
45
- # Add design variables to the optimization problem.
46
- # (Specify the variables registered in the femprj file.)
47
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=40)
48
- femopt.add_parameter("substrate_d", 60, lower_bound=33, upper_bound=60)
49
-
50
- # Add the objective function to the optimization problem.
51
- # The target bending angle is 90 degrees.
52
- femopt.add_objective(chip_temp, name='max temp. of<br>MAINCHIP (degree)', direction='minimize', args=('MAINCHIP',))
53
- femopt.add_objective(chip_temp, name='max temp. of<br>SUBCHIP (degree)', direction='minimize', args=('SUBCHIP',))
54
- femopt.add_objective(substrate_size, name='substrate size')
55
-
56
- # Run optimization.
57
- femopt.set_random_seed(42)
58
- femopt.optimize(n_trials=15)
@@ -1,58 +0,0 @@
1
- """Multi-objective optimization: heating element on substrate.
2
-
3
- Using Femtet's heat conduction analysis solver, we will design
4
- to reduce the chip temperature and shrink the board size.
5
-
6
- Corresponding project: wat_ex14_parametric.femprj
7
- """
8
- from pyfemtet.opt import FEMOpt
9
-
10
-
11
- def chip_temp(Femtet, chip_name):
12
- """Obtain the maximum temperature of the chip.
13
-
14
- Note:
15
- The objective or constraint function should take Femtet
16
- as its first argument and return a float as the output.
17
-
18
- Params:
19
- Femtet: An instance for manipulating Femtet with macros. For detailed information, please refer to "Femtet Macro Help".
20
- chip_name (str): The body attribute name defined in femprj. Valid values are 'MAINCHIP' or 'SUBCHIP'.
21
-
22
- Returns:
23
- float: The maximum temperature of the body with the specified body attribute name.
24
- """
25
- Gogh = Femtet.Gogh
26
-
27
- max_temperature, min_temperature, mean_temperature = Gogh.Watt.GetTemp(chip_name)
28
-
29
- return max_temperature # unit: degree
30
-
31
-
32
- def substrate_size(Femtet):
33
- """Calculate the occupied area on the XY plane of the substrate."""
34
- substrate_w = Femtet.GetVariableValue('substrate_w')
35
- substrate_d = Femtet.GetVariableValue('substrate_d')
36
- return substrate_w * substrate_d # unit: mm2
37
-
38
-
39
- if __name__ == '__main__':
40
-
41
- # Initialize the FEMOpt object.
42
- # (establish connection between the optimization problem and Femtet)
43
- femopt = FEMOpt()
44
-
45
- # Add design variables to the optimization problem.
46
- # (Specify the variables registered in the femprj file.)
47
- femopt.add_parameter("substrate_w", 40, lower_bound=22, upper_bound=40)
48
- femopt.add_parameter("substrate_d", 60, lower_bound=33, upper_bound=60)
49
-
50
- # Add the objective function to the optimization problem.
51
- # The target bending angle is 90 degrees.
52
- femopt.add_objective(chip_temp, name='max temp. of<br>MAINCHIP (degree)', direction='minimize', args=('MAINCHIP',))
53
- femopt.add_objective(chip_temp, name='max temp. of<br>SUBCHIP (degree)', direction='minimize', args=('SUBCHIP',))
54
- femopt.add_objective(substrate_size, name='substrate size')
55
-
56
- # Run optimization.
57
- femopt.set_random_seed(42)
58
- femopt.optimize(n_trials=15, n_parallel=3) # This line is the only difference with no parallel pattern.
@@ -1,18 +0,0 @@
1
- "{""femprj_path"": null, ""model_name"": ""Ex14""}",prm,prm_lb,prm_ub,prm,prm_lb,prm_ub,obj,obj_direction,obj,obj_direction,obj,obj_direction,,,,,
2
- ,,,,,,,,,,,,,,,,,
3
- trial,substrate_w,substrate_w_lower_bound,substrate_w_upper_bound,substrate_d,substrate_d_lower_bound,substrate_d_upper_bound,max temp. of<br>MAINCHIP (degree),max temp. of<br>MAINCHIP (degree)_direction,max temp. of<br>SUBCHIP (degree),max temp. of<br>SUBCHIP (degree)_direction,substrate size,substrate size_direction,non_domi,feasible,hypervolume,message,time
4
- 1,40.0,22.0,40.0,60.0,33.0,60.0,37.52037094717731,minimize,37.219570759650736,minimize,2400.0,minimize,True,True,0.0,initial,2024-07-24 10:07:32.666526
5
- 2,28.741722139252524,22.0,40.0,58.66928627306774,33.0,60.0,39.95088309760373,minimize,39.59942341709205,minimize,1686.2563226399373,minimize,True,True,1004.6311537424114,,2024-07-24 10:07:36.235277
6
- 3,35.17589095260529,22.0,40.0,49.163779073319986,33.0,60.0,39.867379609048285,minimize,39.62643441509008,minimize,1729.3797347696782,minimize,True,True,25365.03825293653,,2024-07-24 10:07:39.981477
7
- 4,24.808335527963855,22.0,40.0,37.21185204907747,33.0,60.0,45.61866728925043,minimize,45.45408511056278,minimize,923.164108992346,minimize,True,True,25695.992887931534,,2024-07-24 10:07:43.232027
8
- 5,23.04550501902759,22.0,40.0,56.38675593592325,33.0,60.0,42.04691673228557,minimize,41.642550825244506,minimize,1299.4612650272293,minimize,True,True,25701.081609370387,,2024-07-24 10:07:46.698370
9
- 6,32.82007021137776,22.0,40.0,52.11795960049323,33.0,60.0,39.918786164350244,minimize,39.65372077490424,minimize,1710.515092752764,minimize,True,True,31200.00590260607,,2024-07-24 10:07:50.473962
10
- 7,22.370520897324443,22.0,40.0,59.18756600837385,33.0,60.0,41.857660922474366,minimize,41.412359617291756,minimize,1324.0566822231292,minimize,True,True,31203.56786646332,,2024-07-24 10:07:53.889769
11
- 8,36.98396753440759,22.0,40.0,38.733155988313456,33.0,60.0,41.45996648696103,minimize,41.32468374993554,minimize,1432.50578267643,minimize,True,True,31790.813541701624,,2024-07-24 10:07:58.053685
12
- 9,25.27284940972781,22.0,40.0,37.951921766042716,33.0,60.0,45.20399679357152,minimize,45.02945742630538,minimize,959.1532040919769,minimize,True,True,32301.318493974897,,2024-07-24 10:08:01.291490
13
- 10,27.476360373271678,22.0,40.0,47.16842365407042,33.0,60.0,42.200179274800846,minimize,41.949960829060736,minimize,1296.0166090811015,minimize,True,True,32384.56270596188,,2024-07-24 10:08:04.782594
14
- 11,29.753896984166904,22.0,40.0,42.82064718778404,33.0,60.0,42.41314540018037,minimize,42.21795783881831,minimize,1274.0811262621385,minimize,True,True,32426.930123733742,,2024-07-24 10:08:08.125688
15
- 12,22.13585174769328,22.0,40.0,54.852445501369665,33.0,60.0,42.65360619217794,minimize,42.24952120572936,minimize,1214.2055989703324,minimize,True,True,32660.650342998557,,2024-07-24 10:08:11.592612
16
- 13,29.149763374560322,22.0,40.0,53.176207139251,33.0,60.0,40.66778530667245,minimize,40.366618584975996,minimize,1550.0738554744003,minimize,True,True,33245.08260831299,,2024-07-24 10:08:15.159162
17
- 14,26.693664733353113,22.0,40.0,55.077892815471856,33.0,60.0,41.04842885906005,minimize,40.713086869244584,minimize,1470.2308027857441,minimize,True,True,34355.966685256455,,2024-07-24 10:08:18.814670
18
- 15,32.2698615678703,22.0,40.0,33.33240157825331,33.0,60.0,44.11111121424868,minimize,44.02287246781605,minimize,1075.6319864276184,minimize,True,True,34721.48535892087,,2024-07-24 10:08:22.185387
@@ -1,29 +0,0 @@
1
- from pyfemtet.opt import FemtetInterface, FEMOpt, AbstractOptimizer
2
-
3
-
4
- def ex_in(_, opt: AbstractOptimizer):
5
- ex_r, in_r = opt.get_parameter('values')
6
- return ex_r - in_r
7
-
8
-
9
-
10
- if __name__ == '__main__':
11
-
12
- fem = FemtetInterface(
13
- parametric_output_indexes_use_as_objective={
14
- 0: "minimize",
15
- 1: "minimize",
16
- 2: "minimize",
17
- },
18
- )
19
-
20
- femopt = FEMOpt(fem=fem)
21
-
22
- femopt.add_parameter("external_radius", 10, 1, 10)
23
- femopt.add_parameter("internal_radius", 5, 1, 10)
24
- femopt.add_constraint(ex_in, lower_bound=1, strict=True, args=(femopt.opt,))
25
- femopt.set_random_seed(42)
26
- femopt.optimize(
27
- n_trials=10,
28
- n_parallel=1,
29
- )