]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
pseudo vmult_add added
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 25 Feb 2003 13:36:57 +0000 (13:36 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 25 Feb 2003 13:36:57 +0000 (13:36 +0000)
git-svn-id: https://svn.dealii.org/trunk@7239 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/precondition_block.h
deal.II/lac/include/lac/precondition_block.templates.h

index 8180dcacd36b03884de2bba0b4f32dbab03a39cb..6b93e66f32594bd2783e59886f30ad4ae69ea172 100644 (file)
@@ -425,6 +425,10 @@ class PreconditionBlockJacobi : public virtual Subscriptor,
                                   /**
                                    * Actual implementation of the
                                    * preconditioner.
+                                   *
+                                   * Depending on @p{adding}, the
+                                   * result of preconditioning is
+                                   * added to the destination vector.
                                    */
     template <typename number2>
     void do_vmult (Vector<number2>&,
@@ -443,7 +447,7 @@ class PreconditionBlockJacobi : public virtual Subscriptor,
  * arbitrarily.
  *
  * See @ref{PreconditionBlock} for requirements on the matrix.
- * @author Ralf Hartmann, Guido Kanschat, 1999, 2000
+ * @author Ralf Hartmann, Guido Kanschat, 1999, 2000, 2001, 2002, 2003
  */
 template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
 class PreconditionBlockSOR : public virtual Subscriptor,
@@ -501,6 +505,26 @@ class PreconditionBlockSOR : public virtual Subscriptor,
     template <typename number2>
     void vmult (Vector<number2>&, const Vector<number2>&) const;
 
+                                    /**
+                                     * Execute block SOR
+                                     * preconditioning.
+                                     *
+                                     * Warning: this function
+                                     * performs normal @p{vmult}
+                                     * without adding. The reason for
+                                     * its existence is that
+                                     * @ref{BlockMatrixArray}
+                                     * requires the adding version by
+                                     * default. On the other hand,
+                                     * adding requires an additional
+                                     * auxiliary vector, which is not
+                                     * desirable.
+                                     *
+                                     * @see{vmult}.
+                                     */
+    template <typename number2>
+    void vmult_add (Vector<number2>&, const Vector<number2>&) const;
+
                                     /**
                                      * Backward application of @ref{vmult}.
                                      *
@@ -517,6 +541,20 @@ class PreconditionBlockSOR : public virtual Subscriptor,
                                      */
     template <typename number2>
     void Tvmult (Vector<number2>&, const Vector<number2>&) const;
+
+  private:
+                                    /**
+                                     * Actual implementation of the
+                                     * preconditioning algorithm.
+                                     *
+                                     * The parameter @p{adding} does
+                                     * not have any function, yet.
+                                     */
+    template <typename number2>
+    void do_vmult (Vector<number2>&,
+                  const Vector<number2>&,
+                  const bool adding) const;
+
 };
 
 
index 426734bb09eaac8a2bc073fa9941a0b9d572c912..daa3e0ba55fa1fefe58676c5efd751aa1cad8407 100644 (file)
@@ -387,8 +387,10 @@ void PreconditionBlockJacobi<MATRIX,inverse_type>
 
 template <class MATRIX, typename inverse_type>
 template <typename number2>
-void PreconditionBlockSOR<MATRIX,inverse_type>::vmult (Vector<number2>       &dst,
-                                                      const Vector<number2> &src) const
+void PreconditionBlockSOR<MATRIX,inverse_type>::do_vmult (
+  Vector<number2>       &dst,
+  const Vector<number2> &src,
+  const bool) const
 {
                                   // introduce the following typedef
                                   // since in the use of exceptions,
@@ -606,6 +608,26 @@ void PreconditionBlockSOR<MATRIX,inverse_type>::Tvmult (Vector<number2>       &d
       }
 }
 
+template <class MATRIX, typename inverse_type>
+template <typename number2>
+void PreconditionBlockSOR<MATRIX,inverse_type>
+::vmult (Vector<number2>       &dst,
+        const Vector<number2> &src) const
+{
+  do_vmult(dst, src, false);
+}
+
+
+template <class MATRIX, typename inverse_type>
+template <typename number2>
+void PreconditionBlockSOR<MATRIX,inverse_type>
+::vmult_add (Vector<number2>       &dst,
+            const Vector<number2> &src) const
+{
+  do_vmult(dst, src, true);
+}
+
+
 //----------------------------------------------------------------------//
 
 

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.