Skip to content

Commit

Permalink
- fixed command line parameter evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
janbender committed Dec 16, 2021
1 parent a85d4f4 commit 299beaa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
2.11.2
- fixed command line parameter evaluation
- updated documentation

2.11.1
- implemented a non-avx version of the elasticity solver by Kugelstadt et al. "Fast Corotated Elastic SPH Solids with Implicit Zero-Energy Mode Control", 2021
- Linux fixes

Expand Down
12 changes: 12 additions & 0 deletions Simulator/SimulatorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,11 @@ void SimulatorBase::init(int argc, char **argv, const std::string &windowName)
setUseGUI(false);
}

m_cmdLineStopAt = false;
if (result.count("stopAt"))
{
m_stopAt = result["stopAt"].as<Real>();
m_cmdLineStopAt = true;
}

if (result.count("param"))
Expand Down Expand Up @@ -330,9 +332,11 @@ void SimulatorBase::init(int argc, char **argv, const std::string &windowName)
m_outputPath = result["output-dir"].as<std::string>();
}

m_cmdLineNoInitialPause = false;
if (result.count("no-initial-pause"))
{
m_doPause = false;
m_cmdLineNoInitialPause = true;
}

setStateFile("");
Expand Down Expand Up @@ -543,7 +547,15 @@ void SimulatorBase::runSimulation()
deferredInit();

if (getStateFile() != "")
{
// avoid that command line parameter is overwritten
const Real temp = m_stopAt;
loadState(getStateFile());
if (m_cmdLineStopAt)
m_stopAt = temp;
if (m_cmdLineNoInitialPause)
m_doPause = false;
}
setCommandLineParameter();

if (!m_useGUI)
Expand Down
2 changes: 2 additions & 0 deletions Simulator/SimulatorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace SPH
bool m_doPause;
Real m_pauseAt;
Real m_stopAt;
bool m_cmdLineStopAt;
bool m_cmdLineNoInitialPause;
bool m_enableRigidBodyVTKExport;
bool m_enableRigidBodyExport;
bool m_enableStateExport;
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.11.1
2.11.2

0 comments on commit 299beaa

Please sign in to comment.