minlevel,
maxlevel,
Multigrid<VectorType>::v_cycle);
- mg1.set_debug(3);
+
for (unsigned int i = minlevel; i <= maxlevel; ++i)
mg1.defect[i].reinit(N);
- mg1.cycle();
- deallog << std::endl;
- mg1.set_cycle(Multigrid<VectorType>::w_cycle);
- mg1.cycle();
- deallog << std::endl;
+ {
+ auto print_coarse_solve = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "V-cycle entering level " << level << std::endl;
+ deallog << "V-cycle Defect norm 0" << std::endl;
+ deallog << "Coarse level " << level << std::endl;
+ }
+ };
+
+ auto print_restriction = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "Residual on level " << level << std::endl;
+ deallog << "Residual norm 0" << std::endl;
+ }
+ };
+
+ auto print_prolongation = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "Prolongate norm 0" << std::endl;
+ deallog << "V-cycle Defect norm 0" << std::endl;
+ }
+ };
+
+ auto print_pre_smoother_step = [](const bool start,
+ const unsigned int level) {
+ if (start)
+ {
+ deallog << "V-cycle entering level " << level << std::endl;
+ deallog << "V-cycle Defect norm 0" << std::endl;
+ deallog << "Smoothing on level " << level << std::endl;
+ deallog << "Solution norm 0" << std::endl;
+ }
+ };
+
+ auto print_post_smoother_step = [](const bool start,
+ const unsigned int level) {
+ if (start)
+ {
+ deallog << "Smoothing on level " << level << std::endl;
+ deallog << "Solution norm 0" << std::endl;
+ deallog << "V-cycle leaving level " << level << std::endl;
+ }
+ };
+
+ const auto coarse_connection = mg1.connect_coarse_solve(print_coarse_solve);
+ const auto restriction_connection =
+ mg1.connect_restriction(print_restriction);
+ const auto prolongation_connection =
+ mg1.connect_prolongation(print_prolongation);
+ const auto pre_smoother_connection =
+ mg1.connect_pre_smoother_step(print_pre_smoother_step);
+ const auto post_smoother_connection =
+ mg1.connect_post_smoother_step(print_post_smoother_step);
+
+ mg1.cycle();
+ deallog << std::endl;
+
+ coarse_connection.disconnect();
+ restriction_connection.disconnect();
+ prolongation_connection.disconnect();
+ pre_smoother_connection.disconnect();
+ post_smoother_connection.disconnect();
+ }
+
+ {
+ auto print_coarse_solve_w = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "W-cycle entering level " << level << std::endl;
+ deallog << "W-cycle defect norm 0" << std::endl;
+ deallog << "W-cycle coarse level " << level << std::endl;
+ }
+ };
+
+ auto print_restriction_w = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "W-cycle residual level " << level << std::endl;
+ deallog << "W-cycle residual norm 0" << std::endl;
+ }
+ };
+
+ auto print_prolongation_w = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "W-cycle Defect norm 0" << std::endl;
+ }
+ };
+
+ auto print_pre_smoother_step_w = [](const bool start,
+ const unsigned int level) {
+ if (start)
+ {
+ deallog << "W-cycle entering level " << level << std::endl;
+ deallog << "W-cycle defect norm 0" << std::endl;
+ deallog << "W-cycle smoothing level " << level << std::endl;
+ deallog << "W-cycle solution norm 0" << std::endl;
+ }
+ };
+
+ auto print_post_smoother_step_w = [](const bool start,
+ const unsigned int level) {
+ if (start)
+ {
+ deallog << "W-cycle smoothing level " << level << std::endl;
+ deallog << "W-cycle solution norm 0" << std::endl;
+ deallog << "W-cycle leaving level " << level << std::endl;
+ }
+ };
+
+ const auto coarse_connection =
+ mg1.connect_coarse_solve(print_coarse_solve_w);
+ const auto restriction_connection =
+ mg1.connect_restriction(print_restriction_w);
+ const auto prolongation_connection =
+ mg1.connect_prolongation(print_prolongation_w);
+ const auto pre_smoother_connection =
+ mg1.connect_pre_smoother_step(print_pre_smoother_step_w);
+ const auto post_smoother_connection =
+ mg1.connect_post_smoother_step(print_post_smoother_step_w);
+
+ mg1.set_cycle(Multigrid<VectorType>::w_cycle);
+ mg1.cycle();
+ deallog << std::endl;
+
+ coarse_connection.disconnect();
+ restriction_connection.disconnect();
+ prolongation_connection.disconnect();
+ pre_smoother_connection.disconnect();
+ post_smoother_connection.disconnect();
+ }
+
+ {
+ auto print_coarse_solve_f = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "F-cycle entering level " << level << std::endl;
+ deallog << "F-cycle defect norm 0" << std::endl;
+ deallog << "F-cycle coarse level " << level << std::endl;
+ }
+ };
+
+ auto print_restriction_f = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "F-cycle residual level " << level << std::endl;
+ deallog << "F-cycle residual norm 0" << std::endl;
+ }
+ };
+
+ auto print_prolongation_f = [](const bool start, const unsigned int level) {
+ if (start)
+ {
+ deallog << "F-cycle Defect norm 0" << std::endl;
+ }
+ };
+
+ auto print_pre_smoother_step_f = [](const bool start,
+ const unsigned int level) {
+ if (start)
+ {
+ deallog << "F-cycle entering level " << level << std::endl;
+ deallog << "F-cycle defect norm 0" << std::endl;
+ deallog << "F-cycle smoothing level " << level << std::endl;
+ deallog << "F-cycle solution norm 0" << std::endl;
+ }
+ };
+
+ auto print_post_smoother_step_f = [](const bool start,
+ const unsigned int level) {
+ if (start)
+ {
+ deallog << "F-cycle smoothing level " << level << std::endl;
+ deallog << "F-cycle solution norm 0" << std::endl;
+ deallog << "F-cycle leaving level " << level << std::endl;
+ }
+ };
+
+ mg1.connect_coarse_solve(print_coarse_solve_f);
+ mg1.connect_restriction(print_restriction_f);
+ mg1.connect_prolongation(print_prolongation_f);
+ mg1.connect_pre_smoother_step(print_pre_smoother_step_f);
+ mg1.connect_post_smoother_step(print_post_smoother_step_f);
- mg1.set_cycle(Multigrid<VectorType>::f_cycle);
- mg1.cycle();
+ mg1.set_cycle(Multigrid<VectorType>::f_cycle);
+ mg1.cycle();
+ }
}
int
DEAL::F-cycle smoothing level 1
DEAL::F-cycle solution norm 0
DEAL::F-cycle leaving level 1
-DEAL::V-cycle entering level 1
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 1
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 1
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 0
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle coarse level 0
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 1
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 1
+DEAL::F-cycle entering level 1
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 1
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 1
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 0
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle coarse level 0
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 1
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 1
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 2
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 2
+DEAL::F-cycle entering level 2
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 2
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 2
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 1
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 1
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 1
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 0
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle coarse level 0
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 1
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 1
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 2
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 2
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 3
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 3
+DEAL::F-cycle entering level 3
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 3
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 3
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 2
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 2
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 2
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 1
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 1
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 1
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 0
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle coarse level 0
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 1
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 1
DEAL::F-cycle Defect norm 0
DEAL::F-cycle smoothing level 2
DEAL::F-cycle solution norm 0
DEAL::F-cycle leaving level 2
-DEAL::V-cycle entering level 2
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 2
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 2
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 1
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 1
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 1
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 0
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle coarse level 0
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 1
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 1
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 2
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 2
DEAL::F-cycle Defect norm 0
DEAL::F-cycle smoothing level 3
DEAL::F-cycle solution norm 0
DEAL::F-cycle leaving level 3
-DEAL::V-cycle entering level 3
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 3
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 3
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 2
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 2
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 2
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 1
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 1
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 1
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 0
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle coarse level 0
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 1
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 1
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 2
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 2
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 3
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 3
DEAL::F-cycle Defect norm 0
DEAL::F-cycle smoothing level 4
DEAL::F-cycle solution norm 0
DEAL::F-cycle smoothing level 3
DEAL::F-cycle solution norm 0
DEAL::F-cycle leaving level 3
-DEAL::V-cycle entering level 3
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 3
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 3
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 2
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle coarse level 2
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 3
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 3
+DEAL::F-cycle entering level 3
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 3
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 3
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 2
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle coarse level 2
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 3
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 3
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 4
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 4
+DEAL::F-cycle entering level 4
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 4
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 4
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 3
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle smoothing level 3
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle residual level 3
+DEAL::F-cycle residual norm 0
+DEAL::F-cycle entering level 2
+DEAL::F-cycle defect norm 0
+DEAL::F-cycle coarse level 2
+DEAL::F-cycle Defect norm 0
+DEAL::F-cycle smoothing level 3
+DEAL::F-cycle solution norm 0
+DEAL::F-cycle leaving level 3
DEAL::F-cycle Defect norm 0
DEAL::F-cycle smoothing level 4
DEAL::F-cycle solution norm 0
DEAL::F-cycle leaving level 4
-DEAL::V-cycle entering level 4
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 4
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 4
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 3
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle smoothing level 3
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle residual level 3
-DEAL::V-cycle residual norm 0
-DEAL::V-cycle entering level 2
-DEAL::V-cycle defect norm 0
-DEAL::V-cycle coarse level 2
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 3
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 3
-DEAL::V-cycle Defect norm 0
-DEAL::V-cycle smoothing level 4
-DEAL::V-cycle solution norm 0
-DEAL::V-cycle leaving level 4
DEAL::F-cycle Defect norm 0
DEAL::F-cycle smoothing level 5
DEAL::F-cycle solution norm 0