Fem: Rename CalculiX time properties
This commit is contained in:
@@ -302,16 +302,16 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="l_ccx_initial_time_step">
|
||||
<widget class="QLabel" name="l_ccx_initial_time_increment">
|
||||
<property name="text">
|
||||
<string>Initial time step</string>
|
||||
<string>Initial time increment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="l_ccx_analysis_time">
|
||||
<widget class="QLabel" name="l_ccx_time_period">
|
||||
<property name="text">
|
||||
<string>End time</string>
|
||||
<string>Time period</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -427,38 +427,10 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_maximum_time_step">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_maximum_time_increment">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::DefaultContextMenu</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true"> s</string>
|
||||
</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="6" column="2">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_analysis_time">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
@@ -478,7 +450,35 @@
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisTime</cstring>
|
||||
<cstring>TimeMaximumIncrement</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_time_period">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string notr="true"> s</string>
|
||||
</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>TimePeriod</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
@@ -516,16 +516,16 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="l_ccx_max_iterations">
|
||||
<widget class="QLabel" name="l_ccx_max_increments">
|
||||
<property name="text">
|
||||
<string>Maximum number of iterations</string>
|
||||
<string>Maximum number of increments</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="l_ccx_minimum_time_step">
|
||||
<widget class="QLabel" name="l_ccx_minimum_time_increment">
|
||||
<property name="text">
|
||||
<string>Minimum time step</string>
|
||||
<string>Minimum time increment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -543,7 +543,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_minimum_time_step">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_minimum_time_increment">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::DefaultContextMenu</enum>
|
||||
</property>
|
||||
@@ -566,7 +566,7 @@
|
||||
<double>0.000010000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisTimeMinimumStep</cstring>
|
||||
<cstring>TimeMinimumIncrement</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
@@ -590,7 +590,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_initial_time_step">
|
||||
<widget class="Gui::PrefDoubleSpinBox" name="dsb_ccx_initial_time_increment">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::DefaultContextMenu</enum>
|
||||
</property>
|
||||
@@ -610,10 +610,10 @@
|
||||
<double>0.010000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>0.010000000000000</double>
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisTimeInitialStep</cstring>
|
||||
<cstring>TimeInitialIncrement</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
@@ -628,7 +628,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="Gui::PrefSpinBox" name="sb_ccx_max_iterations">
|
||||
<widget class="Gui::PrefSpinBox" name="sb_ccx_max_increments">
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
@@ -645,7 +645,7 @@
|
||||
<number>2000</number>
|
||||
</property>
|
||||
<property name="prefEntry" stdset="0">
|
||||
<cstring>AnalysisMaxIterations</cstring>
|
||||
<cstring>StepMaxIncrements</cstring>
|
||||
</property>
|
||||
<property name="prefPath" stdset="0">
|
||||
<cstring>Mod/Fem/Ccx</cstring>
|
||||
@@ -653,9 +653,9 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="l_ccx_maximum_time_step">
|
||||
<widget class="QLabel" name="l_ccx_maximum_time_increment">
|
||||
<property name="text">
|
||||
<string>Maximum time step</string>
|
||||
<string>Maximum time increment</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -43,8 +43,8 @@ DlgSettingsFemCcxImp::DlgSettingsFemCcxImp(QWidget* parent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
// set ranges
|
||||
ui->dsb_ccx_analysis_time->setMaximum(std::numeric_limits<float>::max());
|
||||
ui->dsb_ccx_initial_time_step->setMaximum(std::numeric_limits<float>::max());
|
||||
ui->dsb_ccx_time_period->setMaximum(std::numeric_limits<float>::max());
|
||||
ui->dsb_ccx_initial_time_increment->setMaximum(std::numeric_limits<float>::max());
|
||||
|
||||
connect(ui->fc_ccx_binary_path,
|
||||
&Gui::PrefFileChooser::fileNameChanged,
|
||||
@@ -67,11 +67,11 @@ void DlgSettingsFemCcxImp::saveSettings()
|
||||
ui->cb_use_iterations_param->onSave();
|
||||
|
||||
ui->cb_static->onSave();
|
||||
ui->sb_ccx_max_iterations->onSave(); // Max number of iterations
|
||||
ui->dsb_ccx_initial_time_step->onSave(); // Initial time step
|
||||
ui->dsb_ccx_analysis_time->onSave(); // Analysis time
|
||||
ui->dsb_ccx_minimum_time_step->onSave(); // Minimum time step
|
||||
ui->dsb_ccx_maximum_time_step->onSave(); // Maximum time step
|
||||
ui->sb_ccx_max_increments->onSave(); // Max number of increments
|
||||
ui->dsb_ccx_initial_time_increment->onSave(); // Initial time increment
|
||||
ui->dsb_ccx_time_period->onSave(); // Step time period
|
||||
ui->dsb_ccx_minimum_time_increment->onSave(); // Minimum time increment
|
||||
ui->dsb_ccx_maximum_time_increment->onSave(); // Maximum time increment
|
||||
ui->ckb_pipeline_result->onSave();
|
||||
ui->ckb_result_format->onSave();
|
||||
|
||||
@@ -96,11 +96,11 @@ void DlgSettingsFemCcxImp::loadSettings()
|
||||
ui->cb_use_iterations_param->onRestore();
|
||||
|
||||
ui->cb_static->onRestore();
|
||||
ui->sb_ccx_max_iterations->onRestore(); // Max number of iterations
|
||||
ui->dsb_ccx_initial_time_step->onRestore(); // Initial time step
|
||||
ui->dsb_ccx_analysis_time->onRestore(); // Analysis time
|
||||
ui->dsb_ccx_minimum_time_step->onRestore(); // Minimum time step
|
||||
ui->dsb_ccx_maximum_time_step->onRestore(); // Maximum time step
|
||||
ui->sb_ccx_max_increments->onRestore(); // Max number of increments
|
||||
ui->dsb_ccx_initial_time_increment->onRestore(); // Initial time increment
|
||||
ui->dsb_ccx_time_period->onRestore(); // Step time period
|
||||
ui->dsb_ccx_minimum_time_increment->onRestore(); // Minimum time increment
|
||||
ui->dsb_ccx_maximum_time_increment->onRestore(); // Maximum time increment
|
||||
ui->ckb_pipeline_result->onRestore();
|
||||
ui->ckb_result_format->onRestore();
|
||||
|
||||
|
||||
@@ -962,26 +962,26 @@ class _SolverCalculixContextManager:
|
||||
)
|
||||
)
|
||||
FreeCADGui.doCommand(
|
||||
"{}.IterationsMaximum = {}".format(
|
||||
self.cli_name, ccx_prefs.GetInt("AnalysisMaxIterations", 2000)
|
||||
"{}.IncrementsMaximum = {}".format(
|
||||
self.cli_name, ccx_prefs.GetInt("StepMaxIncrements", 2000)
|
||||
)
|
||||
)
|
||||
FreeCADGui.doCommand(
|
||||
"{}.TimeInitialStep = {}".format(
|
||||
self.cli_name, ccx_prefs.GetFloat("AnalysisTimeInitialStep", 1.0)
|
||||
"{}.TimeInitialIncrement = {}".format(
|
||||
self.cli_name, ccx_prefs.GetFloat("TimeInitialIncrement", 1.0)
|
||||
)
|
||||
)
|
||||
FreeCADGui.doCommand(
|
||||
"{}.TimeEnd = {}".format(self.cli_name, ccx_prefs.GetFloat("AnalysisTime", 1.0))
|
||||
"{}.TimePeriod = {}".format(self.cli_name, ccx_prefs.GetFloat("TimePeriod", 1.0))
|
||||
)
|
||||
FreeCADGui.doCommand(
|
||||
"{}.TimeMinimumStep = {}".format(
|
||||
self.cli_name, ccx_prefs.GetFloat("AnalysisTimeMinimumStep", 0.00001)
|
||||
"{}.TimeMinimumIncrement = {}".format(
|
||||
self.cli_name, ccx_prefs.GetFloat("TimeMinimumIncrement", 0.00001)
|
||||
)
|
||||
)
|
||||
FreeCADGui.doCommand(
|
||||
"{}.TimeMaximumStep = {}".format(
|
||||
self.cli_name, ccx_prefs.GetFloat("AnalysisTimeMaximumStep", 1.0)
|
||||
"{}.TimeMaximumIncrement = {}".format(
|
||||
self.cli_name, ccx_prefs.GetFloat("TimeMaximumIncrement", 1.0)
|
||||
)
|
||||
)
|
||||
FreeCADGui.doCommand(
|
||||
|
||||
@@ -106,10 +106,11 @@ class SolverCalculiX(base_fempythonobject.BaseFemPythonObject):
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyIntegerConstraint",
|
||||
name="IterationsMaximum",
|
||||
group="Solver",
|
||||
doc="Maximum Number of iterations in each time step before stopping jobs",
|
||||
value=2000,
|
||||
name="IncrementsMaximum",
|
||||
group="TimeIncrement",
|
||||
doc="Maximum Number of increments in each CalculiX step.\n"
|
||||
+ "Set to 0 to use CalculiX default value",
|
||||
value={"value": 2000, "min": 0},
|
||||
)
|
||||
)
|
||||
prop.append(
|
||||
@@ -124,36 +125,36 @@ class SolverCalculiX(base_fempythonobject.BaseFemPythonObject):
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyTime",
|
||||
name="TimeInitialStep",
|
||||
name="TimeInitialIncrement",
|
||||
group="TimeIncrement",
|
||||
doc="Initial time steps",
|
||||
value=0.01,
|
||||
)
|
||||
)
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyTime",
|
||||
name="TimeEnd",
|
||||
group="TimeIncrement",
|
||||
doc="End time analysis",
|
||||
doc="Initial time increment",
|
||||
value=1.0,
|
||||
)
|
||||
)
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyTime",
|
||||
name="TimeMinimumStep",
|
||||
name="TimePeriod",
|
||||
group="TimeIncrement",
|
||||
doc="Minimum time step",
|
||||
doc="Time period of the CalculiX step",
|
||||
value=1.0,
|
||||
)
|
||||
)
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyTime",
|
||||
name="TimeMinimumIncrement",
|
||||
group="TimeIncrement",
|
||||
doc="Minimum time increment",
|
||||
value=0.00001,
|
||||
)
|
||||
)
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyTime",
|
||||
name="TimeMaximumStep",
|
||||
name="TimeMaximumIncrement",
|
||||
group="TimeIncrement",
|
||||
doc="Maximum time step",
|
||||
doc="Maximum time increment",
|
||||
value=1.0,
|
||||
)
|
||||
)
|
||||
@@ -227,8 +228,8 @@ class SolverCalculiX(base_fempythonobject.BaseFemPythonObject):
|
||||
type="App::PropertyBool",
|
||||
name="AutomaticIncrementation",
|
||||
group="TimeIncrement",
|
||||
doc="If False, switch off automatic incrementation via CalculiX\n"
|
||||
+ "`DIRECT` parameter and ignore minimum and maximum time increments.\n"
|
||||
doc="If False, switch off automatic incrementation via `DIRECT`\n"
|
||||
+ "parameter and ignore minimum and maximum time increments.\n"
|
||||
+ "Analysis may not converge!",
|
||||
value=True,
|
||||
)
|
||||
@@ -341,5 +342,26 @@ class SolverCalculiX(base_fempythonobject.BaseFemPythonObject):
|
||||
obj.setPropertyStatus("IterationsUserDefinedTimeStepLength", "-LockDynamic")
|
||||
obj.removeProperty("IterationsUserDefinedTimeStepLength")
|
||||
|
||||
obj.TimeInitialIncrement = obj.getPropertyByName("TimeInitialStep")
|
||||
obj.setPropertyStatus("TimeInitialStep", "-LockDynamic")
|
||||
obj.removeProperty("TimeInitialStep")
|
||||
|
||||
obj.TimePeriod = obj.getPropertyByName("TimeEnd")
|
||||
obj.setPropertyStatus("TimeEnd", "-LockDynamic")
|
||||
obj.removeProperty("TimeEnd")
|
||||
|
||||
obj.TimeMaximumIncrement = obj.getPropertyByName("TimeMaximumStep")
|
||||
obj.setPropertyStatus("TimeMaximumStep", "-LockDynamic")
|
||||
obj.removeProperty("TimeMaximumStep")
|
||||
|
||||
obj.TimeMinimumIncrement = obj.getPropertyByName("TimeMinimumStep")
|
||||
obj.setPropertyStatus("TimeMinimumStep", "-LockDynamic")
|
||||
obj.removeProperty("TimeMinimumStep")
|
||||
|
||||
obj.IncrementsMaximum = obj.getPropertyByName("IterationsMaximum")
|
||||
obj.setPropertyStatus("IterationsMaximum", "-LockDynamic")
|
||||
obj.removeProperty("IterationsMaximum")
|
||||
|
||||
except Base.PropertyError:
|
||||
# do nothing
|
||||
pass
|
||||
|
||||
@@ -46,9 +46,9 @@ def write_step_equation(f, ccxwriter):
|
||||
"analysis are not allowed together, linear is used instead!\n"
|
||||
)
|
||||
|
||||
if ccxwriter.solver_obj.IterationsMaximum:
|
||||
if ccxwriter.solver_obj.IncrementsMaximum:
|
||||
if ccxwriter.analysis_type in ["static", "thermomech", "electrostatic"]:
|
||||
step += f", INC={ccxwriter.solver_obj.IterationsMaximum}"
|
||||
step += f", INC={ccxwriter.solver_obj.IncrementsMaximum}"
|
||||
|
||||
# write STEP line
|
||||
f.write(step + "\n")
|
||||
@@ -108,10 +108,10 @@ def write_step_equation(f, ccxwriter):
|
||||
analysis_parameter = ""
|
||||
if ccxwriter.analysis_type in ["static", "thermomech", "electromagnetic"]:
|
||||
analysis_parameter = "{},{},{},{}".format(
|
||||
ccxwriter.solver_obj.TimeInitialStep.getValueAs("s").Value,
|
||||
ccxwriter.solver_obj.TimeEnd.getValueAs("s").Value,
|
||||
ccxwriter.solver_obj.TimeMinimumStep.getValueAs("s").Value,
|
||||
ccxwriter.solver_obj.TimeMaximumStep.getValueAs("s").Value,
|
||||
ccxwriter.solver_obj.TimeInitialIncrement.getValueAs("s").Value,
|
||||
ccxwriter.solver_obj.TimePeriod.getValueAs("s").Value,
|
||||
ccxwriter.solver_obj.TimeMinimumIncrement.getValueAs("s").Value,
|
||||
ccxwriter.solver_obj.TimeMaximumIncrement.getValueAs("s").Value,
|
||||
)
|
||||
elif ccxwriter.analysis_type == "frequency":
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user