Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New FEM CalculiX incrementation settings #12662

Merged
merged 39 commits into from Mar 25, 2024

Conversation

FEA-eng
Copy link
Contributor

@FEA-eng FEA-eng commented Feb 29, 2024

fixes #12357

  • adds minimum and maximum time increment properties for CalculiX solver settings (also in FEM preferences)
  • replaces the Iterations Thermo Mech Maximum property with a general property working also in static analyses

@marioalexis84 Can you check it?

@github-actions github-actions bot added the WB FEM Related to the FEM Workbench label Feb 29, 2024
@marioalexis84
Copy link
Member

Sorry for the delay.
The old IterationsThermoMechMaximum property still needs to be managed on document restore for old projects.

@FEA-eng
Copy link
Contributor Author

FEA-eng commented Mar 21, 2024

Sorry for the delay. The old IterationsThermoMechMaximum property still needs to be managed on document restore for old projects.

No problem. Done, thanks. Is the rest of the code ok (mainly default, min and max possible values of the new properties)?

Comment on lines 536 to 646
</widget>
</item>
<item row="7" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_minimum_time_step">
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>0.000000001000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>0.000010000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>AnalysisTimeMinimumStep</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Ccx</cstring>
</property>
</widget>
</item>
<item row="7" column="3">
<widget class="QLabel" name="l_hz_3">
<property name="text">
<string>s</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="l_ccx_maximum_time_step">
<property name="text">
<string>Time Maximum Step</string>
</property>
</widget>
</item>
<item row="8" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="2">
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_maximum_time_step">
<property name="contextMenuPolicy">
<enum>Qt::DefaultContextMenu</enum>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>0.000000001000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
<property name="prefEntry" stdset="0">
<cstring>AnalysisTimeMaximumStep</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Ccx</cstring>
</property>
</widget>
</item>
<item row="8" column="3">
<widget class="QLabel" name="l_hz_3">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a specific class Gui::PrefQuantitySpinBox that uses units inside the spin box, there is no need to combine a PrefDoubleSpinBox with an additional unit label (as currently used in the file).
Do not repeat widget names to avoid a warning on compilation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a specific class Gui::PrefQuantitySpinBox that uses units inside the spin box, there is no need to combine a PrefDoubleSpinBox with an additional unit label (as currently used in the file).

I would leave it for now because it has always been like that in this file. I can try to correct it in another PR.

Do not repeat widget names to avoid a warning on compilation.

Corrected.

Comment on lines 419 to 447
<item row="4" column="0">
<widget class="QLabel" name="l_ccx_max_iterations">
<property name="text">
<string>Maximum number of iterations</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="Gui::PrefSpinBox" name="sb_ccx_max_iterations">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>10000000</number>
</property>
<property name="singleStep">
<number>10</number>
</property>
<property name="value">
<number>2000</number>
</property>
<property name="prefEntry" stdset="0">
<cstring>AnalysisMaxIterations</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/Fem/Ccx</cstring>
</property>
</widget>
</item>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix value alignment like in the other widgets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was like this before but I corrected it now.

@FEA-eng
Copy link
Contributor Author

FEA-eng commented Mar 24, 2024

@marioalexis84 I've noticed that the 2 new properties (Time Minimum Step and Time Maximum Step) are getting reset when changed from defaults in Preferences. What I mean is that I change them, click OK and go back to Preferences only to see them unchanged. Do you know what can be the cause?

@marioalexis84
Copy link
Member

PrefWidget class has onSave and onRestore methods that must be called in saveSettings and loadSettings methods of PreferencePage class, respectively.
So, in DlgSettingsFemCcxImp.cpp file, you must call:
In the DlgSettingsFemCcxImp::saveSettings function:

    ui->dsb_ccx_maximum_time_step->onSave();
    ui->dsb_ccx_minimum_time_step->onSave();

And in the DlgSettingsFemCcxImp::loadSettings function:

    ui->dsb_ccx_maximum_time_step->onRestore();
    ui->dsb_ccx_minimum_time_step->onRestore();

Note that dsb_ccx_*_time_step are the names you assigned to the preference widgets inside the ui file.

@FEA-eng
Copy link
Contributor Author

FEA-eng commented Mar 25, 2024

@marioalexis84 Thanks a lot, it's working now.

@sliptonic sliptonic merged commit f5a5b66 into FreeCAD:main Mar 25, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WB FEM Related to the FEM Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Problem] Missing incrementation settings in FEM SolverCcxtools
3 participants