Commit 65c488c5 authored by Lukas Riedel's avatar Lukas Riedel

Store Newton It limits as int and use rounding in limit calculation

parent af162122
......@@ -18,7 +18,7 @@ private:
const R eps; //!< error margin
const R dtinc, dtdec; //!< time step mutliplicators
R tEnd; //!< simulation time limits
const R itmax,itmin; //!< newton iteration limits
const int itmax, itmin; //!< newton iteration limits
const TSC& tsc; //!< Class with Function getNextTimeStamp()
......@@ -38,7 +38,7 @@ public:
, dtinc(config.get<R>("time.timestepIncreaseFactor"))
, dtdec(config.get<R>("time.timestepDecreaseFactor"))
, tEnd(config.get<R>("time.end"))
, itmax(config.get<int>("time.maxIterations")+1-eps) // (int) rounds down
, itmax(config.get<int>("time.maxIterations"))
, itmin(config.get<int>("time.minIterations"))
, tsc(tsc_)
{
......@@ -179,7 +179,7 @@ private:
*/
inline int calcIterations (const R dt)
{
return (int)( (itmin-itmax) * std::log10(dt-dtmin+1.0) / std::log10(dtmax-dtmin+1.0) + itmax );
return std::round( (itmin-itmax) * std::log10(dt-dtmin+1.0) / std::log10(dtmax-dtmin+1.0) + itmax );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment