From 5d49f6197bf27b1f9c2d8955098f73356feb8eb8 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Wed, 16 Mar 2022 15:26:35 +0100 Subject: [PATCH] Add Multigrid::set_edge_in_matrix() --- include/deal.II/multigrid/multigrid.h | 9 ++++++ .../deal.II/multigrid/multigrid.templates.h | 28 +++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/include/deal.II/multigrid/multigrid.h b/include/deal.II/multigrid/multigrid.h index 0b59923c88..2fbe1849c7 100644 --- a/include/deal.II/multigrid/multigrid.h +++ b/include/deal.II/multigrid/multigrid.h @@ -237,6 +237,15 @@ public: set_edge_matrices(const MGMatrixBase &edge_out, const MGMatrixBase &edge_in); + /** + * Similar to the function above: however, only @p edge_in is set. This + * is useful if the matrix attached to this class ignores the edge + * constraints during vmult(), which is only used during the computation + * of the residual. + */ + void + set_edge_in_matrix(const MGMatrixBase &edge_in); + /** * Set additional matrices to correct residual computation at refinement * edges. These matrices originate from discontinuous Galerkin methods (see diff --git a/include/deal.II/multigrid/multigrid.templates.h b/include/deal.II/multigrid/multigrid.templates.h index 3ac7af229a..ada445176f 100644 --- a/include/deal.II/multigrid/multigrid.templates.h +++ b/include/deal.II/multigrid/multigrid.templates.h @@ -76,11 +76,23 @@ Multigrid::set_cycle(typename Multigrid::Cycle c) template void -Multigrid::set_edge_matrices(const MGMatrixBase &down, - const MGMatrixBase &up) +Multigrid::set_edge_matrices( + const MGMatrixBase &edge_out, + const MGMatrixBase &edge_in) { - edge_out = &down; - edge_in = &up; + this->edge_out = &edge_out; + this->edge_in = &edge_in; +} + + + +template +void +Multigrid::set_edge_in_matrix( + const MGMatrixBase &edge_in) +{ + this->edge_out = nullptr; + this->edge_in = &edge_in; } @@ -88,11 +100,11 @@ Multigrid::set_edge_matrices(const MGMatrixBase &down, template void Multigrid::set_edge_flux_matrices( - const MGMatrixBase &down, - const MGMatrixBase &up) + const MGMatrixBase &edge_down, + const MGMatrixBase &edge_up) { - edge_down = &down; - edge_up = &up; + this->edge_down = &edge_down; + this->edge_up = &edge_up; } -- 2.39.5