diff --git a/dune/tectonic/time-stepping/adaptivetimestepper.cc b/dune/tectonic/time-stepping/adaptivetimestepper.cc index d9ef1c5aa09e303d457be8d9f3ee6a0fb1d479d7..d8b009083d9fece76764f658da1ba3aad9a387bc 100644 --- a/dune/tectonic/time-stepping/adaptivetimestepper.cc +++ b/dune/tectonic/time-stepping/adaptivetimestepper.cc @@ -43,9 +43,11 @@ AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::AdaptiveTime Updaters ¤t, double relativeTime, double relativeTau, + double minTau, std::function<bool(Updaters &, Updaters &)> mustRefine) : relativeTime_(relativeTime), relativeTau_(relativeTau), + minTau_(minTau), stepBase_(stepBase), contactNetwork_(contactNetwork), current_(current), @@ -133,6 +135,11 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::refine(U const auto& currentNBodyAssembler = contactNetwork_.nBodyAssembler(); while (true) { + if (relativeTau_ / 2.0 <= minTau_) { + std::cout << "Sufficiently refined!" << std::endl; + break; + } + setDeformation(current_); //auto F1_linearSolver = makeLinearSolver(); auto F1_Step = Step(stepBase_, current_, currentNBodyAssembler, relativeTime_, relativeTau_ / 2.0, iterationRegister_); @@ -236,7 +243,7 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::determin F1 = F1_Step.get(); - if (strategy>-1) { + if (strategy>-1 && relativeTau_ / 2.0 > minTau_) { setDeformation(F1.updaters); //auto F2_linearSolver = makeLinearSolver(); auto&& nBodyAssembler = step(currentNBodyAssembler); diff --git a/dune/tectonic/time-stepping/adaptivetimestepper.hh b/dune/tectonic/time-stepping/adaptivetimestepper.hh index 2d11dd9db763578ee9555e5427464d7363991969..43b16ec602e954ab1ecd99f6f8e43b16d7b220a8 100644 --- a/dune/tectonic/time-stepping/adaptivetimestepper.hh +++ b/dune/tectonic/time-stepping/adaptivetimestepper.hh @@ -51,6 +51,7 @@ class AdaptiveTimeStepper { Updaters ¤t, double relativeTime, double relativeTau, + double minTau, std::function<bool(Updaters &, Updaters &)> mustRefine); bool reachedEnd(); @@ -59,6 +60,7 @@ class AdaptiveTimeStepper { double relativeTime_; double relativeTau_; + const double minTau_; private: void setDeformation(const Updaters& updaters);