]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add Multigrid::set_edge_in_matrix() 13546/head
authorPeter Munch <peterrmuench@gmail.com>
Wed, 16 Mar 2022 14:26:35 +0000 (15:26 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Wed, 16 Mar 2022 22:31:27 +0000 (23:31 +0100)
include/deal.II/multigrid/multigrid.h
include/deal.II/multigrid/multigrid.templates.h

index 0b59923c8895d0b1ea5a7dd134109199249eae42..2fbe1849c7f9d7756a90aaa94e131061034f5431 100644 (file)
@@ -237,6 +237,15 @@ public:
   set_edge_matrices(const MGMatrixBase<VectorType> &edge_out,
                     const MGMatrixBase<VectorType> &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<VectorType> &edge_in);
+
   /**
    * Set additional matrices to correct residual computation at refinement
    * edges. These matrices originate from discontinuous Galerkin methods (see
index 3ac7af229a778e661b21b9794dfa932f4d58983d..ada445176fcf570183089783cf3861350af1ce82 100644 (file)
@@ -76,11 +76,23 @@ Multigrid<VectorType>::set_cycle(typename Multigrid<VectorType>::Cycle c)
 
 template <typename VectorType>
 void
-Multigrid<VectorType>::set_edge_matrices(const MGMatrixBase<VectorType> &down,
-                                         const MGMatrixBase<VectorType> &up)
+Multigrid<VectorType>::set_edge_matrices(
+  const MGMatrixBase<VectorType> &edge_out,
+  const MGMatrixBase<VectorType> &edge_in)
 {
-  edge_out = &down;
-  edge_in  = &up;
+  this->edge_out = &edge_out;
+  this->edge_in  = &edge_in;
+}
+
+
+
+template <typename VectorType>
+void
+Multigrid<VectorType>::set_edge_in_matrix(
+  const MGMatrixBase<VectorType> &edge_in)
+{
+  this->edge_out = nullptr;
+  this->edge_in  = &edge_in;
 }
 
 
@@ -88,11 +100,11 @@ Multigrid<VectorType>::set_edge_matrices(const MGMatrixBase<VectorType> &down,
 template <typename VectorType>
 void
 Multigrid<VectorType>::set_edge_flux_matrices(
-  const MGMatrixBase<VectorType> &down,
-  const MGMatrixBase<VectorType> &up)
+  const MGMatrixBase<VectorType> &edge_down,
+  const MGMatrixBase<VectorType> &edge_up)
 {
-  edge_down = &down;
-  edge_up   = &up;
+  this->edge_down = &edge_down;
+  this->edge_up   = &edge_up;
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.