From: Peter Munch Date: Wed, 16 Mar 2022 14:26:35 +0000 (+0100) Subject: Add Multigrid::set_edge_in_matrix() X-Git-Tag: v9.4.0-rc1~363^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13546%2Fhead;p=dealii.git Add Multigrid::set_edge_in_matrix() --- 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; }