Skip to content
Snippets Groups Projects
Commit 5e77dece authored by podlesny's avatar podlesny
Browse files

add minTau as minimal time step threshold

parent 305d06ea
Branches
No related tags found
No related merge requests found
...@@ -43,9 +43,11 @@ AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::AdaptiveTime ...@@ -43,9 +43,11 @@ AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::AdaptiveTime
Updaters &current, Updaters &current,
double relativeTime, double relativeTime,
double relativeTau, double relativeTau,
double minTau,
std::function<bool(Updaters &, Updaters &)> mustRefine) std::function<bool(Updaters &, Updaters &)> mustRefine)
: relativeTime_(relativeTime), : relativeTime_(relativeTime),
relativeTau_(relativeTau), relativeTau_(relativeTau),
minTau_(minTau),
stepBase_(stepBase), stepBase_(stepBase),
contactNetwork_(contactNetwork), contactNetwork_(contactNetwork),
current_(current), current_(current),
...@@ -133,6 +135,11 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::refine(U ...@@ -133,6 +135,11 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::refine(U
const auto& currentNBodyAssembler = contactNetwork_.nBodyAssembler(); const auto& currentNBodyAssembler = contactNetwork_.nBodyAssembler();
while (true) { while (true) {
if (relativeTau_ / 2.0 <= minTau_) {
std::cout << "Sufficiently refined!" << std::endl;
break;
}
setDeformation(current_); setDeformation(current_);
//auto F1_linearSolver = makeLinearSolver(); //auto F1_linearSolver = makeLinearSolver();
auto F1_Step = Step(stepBase_, current_, currentNBodyAssembler, relativeTime_, relativeTau_ / 2.0, iterationRegister_); auto F1_Step = Step(stepBase_, current_, currentNBodyAssembler, relativeTime_, relativeTau_ / 2.0, iterationRegister_);
...@@ -236,7 +243,7 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::determin ...@@ -236,7 +243,7 @@ int AdaptiveTimeStepper<Factory, ContactNetwork, Updaters, ErrorNorms>::determin
F1 = F1_Step.get(); F1 = F1_Step.get();
if (strategy>-1) { if (strategy>-1 && relativeTau_ / 2.0 > minTau_) {
setDeformation(F1.updaters); setDeformation(F1.updaters);
//auto F2_linearSolver = makeLinearSolver(); //auto F2_linearSolver = makeLinearSolver();
auto&& nBodyAssembler = step(currentNBodyAssembler); auto&& nBodyAssembler = step(currentNBodyAssembler);
......
...@@ -51,6 +51,7 @@ class AdaptiveTimeStepper { ...@@ -51,6 +51,7 @@ class AdaptiveTimeStepper {
Updaters &current, Updaters &current,
double relativeTime, double relativeTime,
double relativeTau, double relativeTau,
double minTau,
std::function<bool(Updaters &, Updaters &)> mustRefine); std::function<bool(Updaters &, Updaters &)> mustRefine);
bool reachedEnd(); bool reachedEnd();
...@@ -59,6 +60,7 @@ class AdaptiveTimeStepper { ...@@ -59,6 +60,7 @@ class AdaptiveTimeStepper {
double relativeTime_; double relativeTime_;
double relativeTau_; double relativeTau_;
const double minTau_;
private: private:
void setDeformation(const Updaters& updaters); void setDeformation(const Updaters& updaters);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment