Skip to content

Commit

Permalink
Add restart method to two-scale convergence tester
Browse files Browse the repository at this point in the history
for use in inner iteration of semi-analytic solver
  • Loading branch information
Dylan Harries committed Dec 20, 2016
1 parent a552680 commit 3407649
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/two_scale_convergence_tester.hpp
Expand Up @@ -31,6 +31,7 @@ class Convergence_tester<Two_scale> {
virtual ~Convergence_tester();
virtual bool accuracy_goal_reached() = 0;
virtual unsigned int max_iterations() const = 0;
virtual void restart() = 0;
};

}
Expand Down
9 changes: 9 additions & 0 deletions src/two_scale_convergence_tester_drbar.hpp
Expand Up @@ -43,6 +43,7 @@ class Convergence_tester_DRbar<Model<Two_scale> > :
virtual bool accuracy_goal_reached() override;
virtual double get_accuracy_goal() const { return accuracy_goal; }
virtual unsigned int max_iterations() const override { return max_it; }
virtual void restart() override;
double get_current_accuracy() const { return current_accuracy; }
/// set maximum number of iterations
void set_max_iterations(unsigned it) { max_it = it; }
Expand Down Expand Up @@ -146,6 +147,14 @@ void Convergence_tester_DRbar<Model<Two_scale> >::run_to_scale()
}
}

template <template<class Method> class Model>
void Convergence_tester_DRbar<Model<Two_scale> >::restart()
{
it_count = 0;
current_model = Model<Two_scale>();
last_iteration_model = Model<Two_scale>();
}

} // namespace flexiblesusy

#endif
2 changes: 1 addition & 1 deletion src/two_scale_solver.cpp
Expand Up @@ -109,7 +109,7 @@ void RGFlow<Two_scale>::solve()
}

/**
* Sanity checks the models and boundary condtitions.
* Sanity checks the models and boundary conditions.
*/
void RGFlow<Two_scale>::check_setup() const
{
Expand Down

0 comments on commit 3407649

Please sign in to comment.