File tree Expand file tree Collapse file tree 2 files changed +39
-33
lines changed Expand file tree Collapse file tree 2 files changed +39
-33
lines changed Original file line number Diff line number Diff line change 1- /*
2- * Vanilla SDC controller.
3- */
4-
51#ifndef _PFASST_SDC_HPP_
62#define _PFASST_SDC_HPP_
73
8- #include < iostream>
9- using namespace std ;
10-
114#include " controller.hpp"
12- # include " config.hpp "
5+
136
147namespace pfasst
158{
9+ /* *
10+ * Vanilla SDC controller.
11+ */
1612 template <typename time = time_precision>
1713 class SDC
1814 : public Controller<time>
1915 {
2016 public:
21- void run ()
22- {
23- auto sweeper = this ->get_level (0 );
24-
25- for (; this ->get_time () < this ->get_end_time (); this ->advance_time ()) {
26- bool initial = this ->get_step () == 0 ;
27- for (this ->set_iteration (0 );
28- this ->get_iteration () < this ->get_max_iterations ();
29- this ->advance_iteration ()) {
30- bool predict = this ->get_iteration () == 0 ;
31- if (predict) {
32- sweeper->predict (initial);
33- sweeper->post_predict ();
34- } else {
35- sweeper->sweep ();
36- sweeper->post_sweep ();
37- }
38- if (sweeper->converged ()) {
39- break ;
40- }
41- }
42- sweeper->post_step ();
43- sweeper->advance ();
44- }
45- }
17+ virtual void run ();
4618 };
4719} // ::pfasst
4820
21+ #include " sdc_impl.hpp"
22+
4923#endif
Original file line number Diff line number Diff line change 1+ #include " sdc.hpp"
2+
3+
4+ namespace pfasst
5+ {
6+ template <typename time>
7+ void SDC<time>::run()
8+ {
9+ auto sweeper = this ->get_level (0 );
10+
11+ for (; this ->get_time () < this ->get_end_time (); this ->advance_time ()) {
12+ bool initial = this ->get_step () == 0 ;
13+ for (this ->set_iteration (0 );
14+ this ->get_iteration () < this ->get_max_iterations ();
15+ this ->advance_iteration ()) {
16+ bool predict = this ->get_iteration () == 0 ;
17+ if (predict) {
18+ sweeper->predict (initial);
19+ sweeper->post_predict ();
20+ } else {
21+ sweeper->sweep ();
22+ sweeper->post_sweep ();
23+ }
24+ if (sweeper->converged ()) {
25+ break ;
26+ }
27+ }
28+ sweeper->post_step ();
29+ sweeper->advance ();
30+ }
31+ }
32+ } // ::pfasst
You can’t perform that action at this time.
0 commit comments