|
1 | 1 | #include "pfasst/encap/imex_sweeper.hpp" |
2 | 2 |
|
| 3 | +#include <algorithm> |
3 | 4 | #include <cassert> |
4 | 5 | using namespace std; |
5 | 6 |
|
@@ -39,6 +40,15 @@ namespace pfasst |
39 | 40 | if (! this->quadrature->left_is_node()) { |
40 | 41 | this->fs_expl_start = this->get_factory()->create(pfasst::encap::function); |
41 | 42 | } |
| 43 | + |
| 44 | + size_t nsteps = this->get_controller()->get_end_time() / this->get_controller()->get_time_step(); |
| 45 | + size_t digit_step = (this->get_controller()->get_time_step() > 0) ? |
| 46 | + to_string(nsteps + 1).length() : 3; |
| 47 | + size_t digit_iter = (this->get_controller()->get_max_iterations() > 0) ? |
| 48 | + to_string(this->get_controller()->get_max_iterations() - 1).length() : 3; |
| 49 | + this->FORMAT_STR = "step: %|" + to_string(digit_step) + "| iter: %|" + to_string(digit_iter) + "|" |
| 50 | + + " n1: %|2| n2: %|3|" |
| 51 | + + " residual: %10.4e" + " err: %10.4e"; |
42 | 52 | } |
43 | 53 |
|
44 | 54 | template<typename time> |
@@ -165,8 +175,8 @@ namespace pfasst |
165 | 175 | { |
166 | 176 | time dt = this->get_controller()->get_time_step(); |
167 | 177 | time t = this->get_controller()->get_time(); |
168 | | - CLOG(INFO, "Sweeper") << "predicting step " << this->get_controller()->get_step() + 1 |
169 | | - << " (t=" << t << ", dt=" << dt << ")"; |
| 178 | + CVLOG(1, "Sweeper") << "predicting step " << this->get_controller()->get_step() + 1 |
| 179 | + << " (t=" << t << ", dt=" << dt << ")"; |
170 | 180 |
|
171 | 181 | if (initial) { |
172 | 182 | this->state[0]->copy(this->start_state); |
@@ -195,8 +205,8 @@ namespace pfasst |
195 | 205 | UNUSED(initial); |
196 | 206 | time dt = this->get_controller()->get_time_step(); |
197 | 207 | time t = this->get_controller()->get_time(); |
198 | | - CLOG(INFO, "Sweeper") << "predicting step " << this->get_controller()->get_step() + 1 |
199 | | - << " (t=" << t << ", dt=" << dt << ")"; |
| 208 | + CVLOG(1, "Sweeper") << "predicting step " << this->get_controller()->get_step() + 1 |
| 209 | + << " (t=" << t << ", dt=" << dt << ")"; |
200 | 210 | time ds; |
201 | 211 |
|
202 | 212 | shared_ptr<Encapsulation<time>> rhs = this->get_factory()->create(pfasst::encap::solution); |
@@ -228,8 +238,8 @@ namespace pfasst |
228 | 238 | auto const nodes = this->quadrature->get_nodes(); |
229 | 239 | auto const dt = this->get_controller()->get_time_step(); |
230 | 240 | auto const s_mat = this->quadrature->get_s_mat().block(1, 0, nodes.size()-1, nodes.size()); |
231 | | - CLOG(INFO, "Sweeper") << "sweeping on step " << this->get_controller()->get_step() + 1 |
232 | | - << " in iteration " << this->get_controller()->get_iteration() << " (dt=" << dt << ")"; |
| 241 | + CVLOG(1, "Sweeper") << "sweeping on step " << this->get_controller()->get_step() + 1 |
| 242 | + << " in iteration " << this->get_controller()->get_iteration() << " (dt=" << dt << ")"; |
233 | 243 | time ds; |
234 | 244 |
|
235 | 245 | this->s_integrals[0]->mat_apply(this->s_integrals, dt, s_mat, this->fs_expl, true); |
@@ -266,8 +276,8 @@ namespace pfasst |
266 | 276 | auto const nodes = this->quadrature->get_nodes(); |
267 | 277 | auto const dt = this->get_controller()->get_time_step(); |
268 | 278 | auto const s_mat = this->quadrature->get_s_mat(); |
269 | | - CLOG(INFO, "Sweeper") << "sweeping on step " << this->get_controller()->get_step() + 1 |
270 | | - << " in iteration " << this->get_controller()->get_iteration() << " (dt=" << dt << ")"; |
| 279 | + CVLOG(1, "Sweeper") << "sweeping on step " << this->get_controller()->get_step() + 1 |
| 280 | + << " in iteration " << this->get_controller()->get_iteration() << " (dt=" << dt << ")"; |
271 | 281 | time ds; |
272 | 282 |
|
273 | 283 | this->s_integrals[0]->mat_apply(this->s_integrals, dt, s_mat, this->fs_expl, true); |
|
0 commit comments