From 4b5d1c8ccd25578610ec5e1c1e5729f6bcb73c8a Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 30 Mar 2020 12:28:49 -0400 Subject: [PATCH] Use signals in Multigrid::level_step() --- .../deal.II/multigrid/multigrid.templates.h | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/include/deal.II/multigrid/multigrid.templates.h b/include/deal.II/multigrid/multigrid.templates.h index c21e1f5ff5..d3289c883e 100644 --- a/include/deal.II/multigrid/multigrid.templates.h +++ b/include/deal.II/multigrid/multigrid.templates.h @@ -168,22 +168,6 @@ template void Multigrid::level_step(const unsigned int level, Cycle cycle) { - char cychar = '?'; - switch (cycle) - { - case v_cycle: - cychar = 'V'; - break; - case f_cycle: - cychar = 'F'; - break; - case w_cycle: - cychar = 'W'; - break; - default: - Assert(false, ExcNotImplemented()); - } - // Combine the defect from the initial copy_to_mg with the one that has come // from the finer level by the transfer defect2[level] += defect[level]; @@ -191,12 +175,16 @@ Multigrid::level_step(const unsigned int level, Cycle cycle) if (level == minlevel) { + this->signals.coarse_solve(true, level); (*coarse)(level, solution[level], defect2[level]); + this->signals.coarse_solve(false, level); return; } // smoothing of the residual + this->signals.pre_smoother_step(true, level); pre_smooth->apply(level, solution[level], defect2[level]); + this->signals.pre_smoother_step(false, level); // compute residual on level, which includes the (CG) edge matrix matrix->vmult(level, t[level], solution[level]); @@ -211,7 +199,9 @@ Multigrid::level_step(const unsigned int level, Cycle cycle) else defect2[level - 1] = typename VectorType::value_type(0.); + this->signals.restriction(true, level); transfer->restrict_and_add(level, defect2[level - 1], t[level]); + this->signals.restriction(false, level); // Every cycle starts with a recursion of its type. level_step(level - 1, cycle); @@ -230,7 +220,9 @@ Multigrid::level_step(const unsigned int level, Cycle cycle) } // do coarse grid correction + this->signals.prolongation(true, level); transfer->prolongate(level, t[level], solution[level - 1]); + this->signals.prolongation(false, level); solution[level] += t[level]; // get in contribution from edge matrices to the defect @@ -247,7 +239,9 @@ Multigrid::level_step(const unsigned int level, Cycle cycle) } // post-smoothing + this->signals.post_smoother_step(true, level); post_smooth->smooth(level, solution[level], defect2[level]); + this->signals.post_smoother_step(false, level); } -- 2.39.5