Merge pull request #18608 from marioalexis84/fem-netgen_log_verbosity

Fem: Add preference entry to set Netgen (new implementation) log verbosity and number of threads for meshing
This commit is contained in:
Chris Hennes
2024-12-23 12:02:32 -05:00
committed by GitHub
13 changed files with 326 additions and 135 deletions

View File

@@ -301,10 +301,10 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="toolTip">
<string>Set to zero to automatically use maximum number of available cores</string>
<string>Number of threads used for analysis</string>
</property>
<property name="minimum">
<number>0</number>
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>AnalysisNumCPUs</cstring>

View File

@@ -45,9 +45,6 @@ DlgSettingsFemCcxImp::DlgSettingsFemCcxImp(QWidget* parent)
// set ranges
ui->dsb_ccx_analysis_time->setMaximum(FLOAT_MAX);
ui->dsb_ccx_initial_time_step->setMaximum(FLOAT_MAX);
// determine number of CPU cores
int processor_count = QThread::idealThreadCount();
ui->sb_ccx_numcpu->setMaximum(processor_count);
connect(ui->fc_ccx_binary_path,
&Gui::PrefFileChooser::fileNameChanged,
@@ -117,6 +114,11 @@ void DlgSettingsFemCcxImp::loadSettings()
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Fem/Ccx");
// determine number of CPU threads
int processor_count = hGrp->GetInt("AnalysisNumCPUs", QThread::idealThreadCount());
ui->sb_ccx_numcpu->setValue(processor_count);
int index = hGrp->GetInt("Solver", 0);
if (index > -1) {
ui->cmb_solver->setCurrentIndex(index);

View File

@@ -151,6 +151,32 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_threads">
<property name="text">
<string>Number of threads</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefSpinBox" name="sb_threads">
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="toolTip">
<string>Number of threads used for meshing</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>NumOfThreads</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Gmsh</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
@@ -193,6 +219,11 @@
<extends>QComboBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="Resources/Fem.qrc"/>

View File

@@ -25,6 +25,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
#include <QMessageBox>
#include <QThread>
#endif
#include <App/Application.h>
@@ -53,6 +54,7 @@ void DlgSettingsFemGmshImp::saveSettings()
ui->cb_gmsh_binary_std->onSave();
ui->fc_gmsh_binary_path->onSave();
ui->cb_log_verbosity->onSave();
ui->sb_threads->onSave();
}
void DlgSettingsFemGmshImp::loadSettings()
@@ -60,6 +62,11 @@ void DlgSettingsFemGmshImp::loadSettings()
ui->cb_gmsh_binary_std->onRestore();
ui->fc_gmsh_binary_path->onRestore();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Fem/Gmsh");
// determine number of CPU threads
ui->sb_threads->setValue(hGrp->GetInt("NumOfThreads", QThread::idealThreadCount()));
populateLogVerbosity();
ui->cb_log_verbosity->onRestore();
}

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Gui::Dialog::DlgSettingsNetgen</class>
<widget class="QWidget" name="Gui::Dialog::DlgSettingsNetgen">
<class>FemGui::DlgSettingsNetgen</class>
<widget class="QWidget" name="FemGui::DlgSettingsNetgen">
<property name="geometry">
<rect>
<x>0</x>
@@ -45,6 +45,71 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_options">
<property name="title">
<string>Options</string>
</property>
<layout class="QHBoxLayout" name="hbl_otions">
<item>
<layout class="QGridLayout" name="gl_options">
<item row="0" column="0">
<widget class="QLabel" name="lbl_log_level">
<property name="text">
<string>Log verbosity</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefComboBox" name="cb_log_verbosity">
<property name="toolTip">
<string>Level of verbosity printed on the task panel</string>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
<property name="prefEntry" stdset="0">
<cstring>LogVerbosity</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Netgen</cstring>
</property>
<property name="prefType" stdset="0">
<number></number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_threads">
<property name="text">
<string>Number of threads</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefSpinBox" name="sb_threads">
<property name="alignment">
<set>Qt::AlignLeft|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="toolTip">
<string>Number of threads used for meshing</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>NumOfThreads</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Netgen</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_1">
<property name="orientation">
@@ -60,6 +125,11 @@
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefSpinBox</class>
<extends>QSpinBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>