]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Undo Guido's changes. Use a better way to disambiguate which vmult function is used...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 Jul 2004 18:18:25 +0000 (18:18 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 12 Jul 2004 18:18:25 +0000 (18:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@9515 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/block_matrix_base.h
deal.II/lac/include/lac/block_sparse_matrix.h
deal.II/lac/include/lac/petsc_block_sparse_matrix.h
deal.II/lac/include/lac/petsc_parallel_block_sparse_matrix.h

index b3132ff1063fc66ad948328a7e269eaba8500932..919bbd51799212eb8a6ac8dfde3a2ca4624a7026 100644 (file)
@@ -18,7 +18,6 @@
 #include <base/table.h>
 #include <base/smartpointer.h>
 #include <lac/block_indices.h>
-#include <lac/vector.h>
 
 #include <cmath>
 
@@ -488,99 +487,8 @@ class BlockMatrixBase : public Subscriptor
                                      */
     template <class BlockMatrixType>
     void add_scaled (const value_type       factor,
-                    const BlockMatrixType &matrix);
-    
-                                    /**
-                                     * Matrix-vector multiplication:
-                                     * let $dst = M*src$ with $M$
-                                     * being this matrix.
-                                     */
-    template <class BlockVectorType>
-    void vmult (BlockVectorType       &dst,
-               const BlockVectorType &src) const;
-
-                                    /**
-                                     * Matrix-vector
-                                     * multiplication. Just like the
-                                     * previous function, but only
-                                     * applicable if the matrix has
-                                     * only one block column.
-                                     */
-    template <class BlockVectorType,
-              class VectorType>
-    void vmult (BlockVectorType          &dst,
-               const VectorType &src) const;
-
-                                    /**
-                                     * Matrix-vector
-                                     * multiplication. Just like the
-                                     * previous function, but only
-                                     * applicable if the matrix has
-                                     * only one block row.
-                                     */
-    template <class BlockVectorType,
-              class VectorType>
-    void vmult (VectorType    &dst,
-               const BlockVectorType &src) const;
-
-                                    /**
-                                     * Matrix-vector
-                                     * multiplication. Just like the
-                                     * previous function, but only
-                                     * applicable if the matrix has
-                                     * only one block.
-                                     */
-    template <typename number>
-    void vmult (Vector<number>       &dst,
-               const Vector<number> &src) const;
-    
-                                    /**
-                                     * Matrix-vector multiplication:
-                                     * let $dst = M^T*src$ with $M$
-                                     * being this matrix. This
-                                     * function does the same as
-                                     * vmult() but takes the
-                                     * transposed matrix.
-                                     */
-    template <class BlockVectorType>
-    void Tvmult (BlockVectorType       &dst,
-                const BlockVectorType &src) const;
+                    const BlockMatrixType &matrix);    
   
-                                    /**
-                                     * Matrix-vector
-                                     * multiplication. Just like the
-                                     * previous function, but only
-                                     * applicable if the matrix has
-                                     * only one block row.
-                                     */
-    template <class BlockVectorType,
-              class VectorType>
-    void Tvmult (BlockVectorType  &dst,
-                const VectorType &src) const;
-
-                                    /**
-                                     * Matrix-vector
-                                     * multiplication. Just like the
-                                     * previous function, but only
-                                     * applicable if the matrix has
-                                     * only one block column.
-                                     */
-    template <class BlockVectorType,
-              class VectorType>
-    void Tvmult (VectorType    &dst,
-                const BlockVectorType &src) const;
-
-                                    /**
-                                     * Matrix-vector
-                                     * multiplication. Just like the
-                                     * previous function, but only
-                                     * applicable if the matrix has
-                                     * only one block.
-                                     */
-    template <typename number>
-    void Tvmult (Vector<number>       &dst,
-                const Vector<number> &src) const;
-    
                                     /**
                                      * Adding Matrix-vector
                                      * multiplication. Add $M*src$ on
@@ -604,8 +512,8 @@ class BlockMatrixBase : public Subscriptor
     template <class BlockVectorType>
     void Tvmult_add (BlockVectorType       &dst,
                     const BlockVectorType &src) const;
-  
-                                    /**
+
+                                     /**
                                      * Return the norm of the vector
                                      * <i>v</i> with respect to the
                                      * norm induced by this matrix,
@@ -768,6 +676,186 @@ class BlockMatrixBase : public Subscriptor
                                       * therefore export this function.
                                       */
     void collect_sizes ();
+
+                                    /**
+                                     * Matrix-vector multiplication:
+                                     * let $dst = M*src$ with $M$
+                                     * being this matrix.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class BlockVectorType>
+    void vmult_block_block (BlockVectorType       &dst,
+                           const BlockVectorType &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block column.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class BlockVectorType,
+              class VectorType>
+    void vmult_block_nonblock (BlockVectorType          &dst,
+                              const VectorType &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block row.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class BlockVectorType,
+              class VectorType>
+    void vmult_nonblock_block (VectorType    &dst,
+                              const BlockVectorType &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class VectorType>
+    void vmult_nonblock_nonblock (VectorType       &dst,
+                                 const VectorType &src) const;
+    
+                                    /**
+                                     * Matrix-vector multiplication:
+                                     * let $dst = M^T*src$ with $M$
+                                     * being this matrix. This
+                                     * function does the same as
+                                     * vmult() but takes the
+                                     * transposed matrix.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class BlockVectorType>
+    void Tvmult_block_block (BlockVectorType       &dst,
+                            const BlockVectorType &src) const;
+  
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block row.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class BlockVectorType,
+              class VectorType>
+    void Tvmult_block_nonblock (BlockVectorType  &dst,
+                               const VectorType &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block column.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class BlockVectorType,
+              class VectorType>
+    void Tvmult_nonblock_block (VectorType    &dst,
+                               const BlockVectorType &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block.
+                                     *
+                                     * Due to problems with deriving template
+                                     * arguments between the block and
+                                     * non-block versions of the vmult/Tvmult
+                                     * functions, the actual functions are
+                                     * implemented in derived classes, with
+                                     * implementations forwarding the calls
+                                     * to the implementations provided here
+                                     * under a unique name for which template
+                                     * arguments can be derived by the
+                                     * compiler.
+                                     */
+    template <class VectorType>
+    void Tvmult_nonblock_nonblock (VectorType       &dst,
+                                  const VectorType &src) const;
+    
     
                                     /**
                                      * Make the iterator class a
@@ -1356,8 +1444,9 @@ add_scaled (const value_type factor,
 template <class MatrixType>
 template <class BlockVectorType>
 void
-BlockMatrixBase<MatrixType>::vmult (BlockVectorType       &dst,
-                                    const BlockVectorType &src) const
+BlockMatrixBase<MatrixType>::
+vmult_block_block (BlockVectorType       &dst,
+                   const BlockVectorType &src) const
 {
   Assert (dst.n_blocks() == n_block_rows(),
          ExcDimensionMismatch(dst.n_blocks(), n_block_rows()));
@@ -1380,8 +1469,9 @@ template <class MatrixType>
 template <class BlockVectorType,
           class VectorType>
 void
-BlockMatrixBase<MatrixType>::vmult (VectorType    &dst,
-                                    const BlockVectorType &src) const
+BlockMatrixBase<MatrixType>::
+vmult_nonblock_block (VectorType    &dst,
+                      const BlockVectorType &src) const
 {
   Assert (n_block_rows() == 1,
          ExcDimensionMismatch(1, n_block_rows()));
@@ -1399,8 +1489,9 @@ template <class MatrixType>
 template <class BlockVectorType,
           class VectorType>
 void
-BlockMatrixBase<MatrixType>::vmult (BlockVectorType  &dst,
-                                    const VectorType &src) const
+BlockMatrixBase<MatrixType>::
+vmult_block_nonblock (BlockVectorType  &dst,
+                      const VectorType &src) const
 {
   Assert (dst.n_blocks() == n_block_rows(),
          ExcDimensionMismatch(dst.n_blocks(), n_block_rows()));
@@ -1415,10 +1506,11 @@ BlockMatrixBase<MatrixType>::vmult (BlockVectorType  &dst,
 
 
 template <class MatrixType>
-template <typename number>
+template <class VectorType>
 void
-BlockMatrixBase<MatrixType>::vmult (Vector<number>       &dst,
-                                    const Vector<number> &src) const
+BlockMatrixBase<MatrixType>::
+vmult_nonblock_nonblock (VectorType       &dst,
+                         const VectorType &src) const
 {
   Assert (1 == n_block_rows(),
          ExcDimensionMismatch(1, n_block_rows()));
@@ -1457,8 +1549,9 @@ BlockMatrixBase<MatrixType>::vmult_add (BlockVectorType       &dst,
 template <class MatrixType>
 template <class BlockVectorType>
 void
-BlockMatrixBase<MatrixType>::Tvmult (BlockVectorType       &dst,
-                                     const BlockVectorType &src) const
+BlockMatrixBase<MatrixType>::
+Tvmult_block_block (BlockVectorType       &dst,
+                    const BlockVectorType &src) const
 {
   Assert (dst.n_blocks() == n_block_cols(),
          ExcDimensionMismatch(dst.n_blocks(), n_block_cols()));
@@ -1481,8 +1574,9 @@ template <class MatrixType>
 template <class BlockVectorType,
           class VectorType>
 void
-BlockMatrixBase<MatrixType>::Tvmult (BlockVectorType  &dst,
-                                     const VectorType &src) const
+BlockMatrixBase<MatrixType>::
+Tvmult_block_nonblock (BlockVectorType  &dst,
+                       const VectorType &src) const
 {
   Assert (dst.n_blocks() == n_block_cols(),
          ExcDimensionMismatch(dst.n_blocks(), n_block_cols()));
@@ -1501,8 +1595,9 @@ template <class MatrixType>
 template <class BlockVectorType,
           class VectorType>
 void
-BlockMatrixBase<MatrixType>::Tvmult (VectorType    &dst,
-                                     const BlockVectorType &src) const
+BlockMatrixBase<MatrixType>::
+Tvmult_nonblock_block (VectorType    &dst,
+                       const BlockVectorType &src) const
 {
   Assert (1 == n_block_cols(),
          ExcDimensionMismatch(1, n_block_cols()));
@@ -1518,10 +1613,11 @@ BlockMatrixBase<MatrixType>::Tvmult (VectorType    &dst,
 
 
 template <class MatrixType>
-template <typename number>
+template <class VectorType>
 void
-BlockMatrixBase<MatrixType>::Tvmult (Vector<number>       &dst,
-                                     const Vector<number> &src) const
+BlockMatrixBase<MatrixType>::
+Tvmult_nonblock_nonblock (VectorType       &dst,
+                          const VectorType &src) const
 {
   Assert (1 == n_block_cols(),
          ExcDimensionMismatch(1, n_block_cols()));
index a4d9869d8bdfe6ddbb1604072ae4786959034670..0f6fa0b19aed62ca6faa8513754474a0cdd7a73e 100644 (file)
@@ -17,6 +17,7 @@
 #include <base/config.h>
 #include <base/table.h>
 #include <lac/block_matrix_base.h>
+#include <lac/block_vector.h>
 #include <lac/sparse_matrix.h>
 #include <lac/block_sparsity_pattern.h>
 #include <cmath>
@@ -206,6 +207,97 @@ class BlockSparseMatrix : public BlockMatrixBase<SparseMatrix<number> >
                                      */
     unsigned int n_actually_nonzero_elements () const;    
 
+                                    /**
+                                     * Matrix-vector multiplication:
+                                     * let $dst = M*src$ with $M$
+                                     * being this matrix.
+                                     */
+    template <typename block_number>
+    void vmult (BlockVector<block_number>       &dst,
+                const BlockVector<block_number> &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block column.
+                                     */
+    template <typename block_number,
+              typename nonblock_number>
+    void vmult (BlockVector<block_number>          &dst,
+                const Vector<nonblock_number> &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block row.
+                                     */
+    template <typename block_number,
+              typename nonblock_number>
+    void vmult (Vector<nonblock_number>    &dst,
+                const BlockVector<block_number> &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block.
+                                     */
+    template <typename nonblock_number>
+    void vmult (Vector<nonblock_number>       &dst,
+                const Vector<nonblock_number> &src) const;
+    
+                                    /**
+                                     * Matrix-vector multiplication:
+                                     * let $dst = M^T*src$ with $M$
+                                     * being this matrix. This
+                                     * function does the same as
+                                     * vmult() but takes the
+                                     * transposed matrix.
+                                     */
+    template <typename block_number>
+    void Tvmult (BlockVector<block_number>       &dst,
+                 const BlockVector<block_number> &src) const;
+  
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block row.
+                                     */
+    template <typename block_number,
+              typename nonblock_number>
+    void Tvmult (BlockVector<block_number>  &dst,
+                 const Vector<nonblock_number> &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block column.
+                                     */
+    template <typename block_number,
+              typename nonblock_number>
+    void Tvmult (Vector<nonblock_number>    &dst,
+                 const BlockVector<block_number> &src) const;
+
+                                    /**
+                                     * Matrix-vector
+                                     * multiplication. Just like the
+                                     * previous function, but only
+                                     * applicable if the matrix has
+                                     * only one block.
+                                     */
+    template <typename nonblock_number>
+    void Tvmult (Vector<nonblock_number>       &dst,
+                 const Vector<nonblock_number> &src) const;
+    
                                     /**
                                      * Apply the Jacobi
                                      * preconditioner, which
@@ -333,6 +425,103 @@ class BlockSparseMatrix : public BlockMatrixBase<SparseMatrix<number> >
 
 
 
+template <typename number>
+template <typename block_number>
+inline
+void
+BlockSparseMatrix<number>::vmult (BlockVector<block_number>       &dst,
+                                  const BlockVector<block_number> &src) const
+{
+  BaseClass::vmult_block_block (dst, src);
+}
+  
+
+
+template <typename number>
+template <typename block_number,
+          typename nonblock_number>
+inline
+void
+BlockSparseMatrix<number>::vmult (BlockVector<block_number>     &dst,
+                                  const Vector<nonblock_number> &src) const
+{
+  BaseClass::vmult_block_nonblock (dst, src);
+}
+  
+
+
+template <typename number>
+template <typename block_number,
+          typename nonblock_number>
+inline
+void
+BlockSparseMatrix<number>::vmult (Vector<nonblock_number>         &dst,
+                                  const BlockVector<block_number> &src) const
+{
+  BaseClass::vmult_nonblock_block (dst, src);
+}
+  
+
+
+template <typename number>
+template <typename nonblock_number>
+inline
+void
+BlockSparseMatrix<number>::vmult (Vector<nonblock_number>       &dst,
+                                  const Vector<nonblock_number> &src) const
+{
+  BaseClass::vmult_nonblock_nonblock (dst, src);
+}
+
+
+template <typename number>
+template <typename block_number>
+inline
+void
+BlockSparseMatrix<number>::Tvmult (BlockVector<block_number>       &dst,
+                                   const BlockVector<block_number> &src) const
+{
+  BaseClass::Tvmult_block_block (dst, src);
+}
+  
+
+
+template <typename number>
+template <typename block_number,
+          typename nonblock_number>
+inline
+void
+BlockSparseMatrix<number>::Tvmult (BlockVector<block_number>     &dst,
+                                   const Vector<nonblock_number> &src) const
+{
+  BaseClass::Tvmult_block_nonblock (dst, src);
+}
+  
+
+
+template <typename number>
+template <typename block_number,
+          typename nonblock_number>
+inline
+void
+BlockSparseMatrix<number>::Tvmult (Vector<nonblock_number>         &dst,
+                                   const BlockVector<block_number> &src) const
+{
+  BaseClass::Tvmult_nonblock_block (dst, src);
+}
+  
+
+
+template <typename number>
+template <typename nonblock_number>
+inline
+void
+BlockSparseMatrix<number>::Tvmult (Vector<nonblock_number>       &dst,
+                                   const Vector<nonblock_number> &src) const
+{
+  BaseClass::Tvmult_nonblock_nonblock (dst, src);
+}
+
 
 template <typename number>
 template <class BlockVectorType>
index 8b296e457f0fc629c6383e2259dd4e0ee4724ddc..d12c1d5b0cd73ed197cebf336d9db7ee7d387a26 100644 (file)
@@ -18,6 +18,7 @@
 #include <base/table.h>
 #include <lac/block_matrix_base.h>
 #include <lac/petsc_sparse_matrix.h>
+#include <lac/petsc_block_vector.h>
 #include <cmath>
 
 
@@ -163,6 +164,84 @@ namespace PETScWrappers
       void reinit (const unsigned int n_block_rows,
                    const unsigned int n_block_columns);
       
+                                       /**
+                                        * Matrix-vector multiplication:
+                                        * let $dst = M*src$ with $M$
+                                        * being this matrix.
+                                        */
+      void vmult (BlockVector       &dst,
+                  const BlockVector &src) const;
+
+                                       /**
+                                        * Matrix-vector
+                                        * multiplication. Just like the
+                                        * previous function, but only
+                                        * applicable if the matrix has
+                                        * only one block column.
+                                        */
+      void vmult (BlockVector          &dst,
+                  const Vector &src) const;
+
+                                       /**
+                                        * Matrix-vector
+                                        * multiplication. Just like the
+                                        * previous function, but only
+                                        * applicable if the matrix has
+                                        * only one block row.
+                                        */
+      void vmult (Vector    &dst,
+                  const BlockVector &src) const;
+
+                                       /**
+                                        * Matrix-vector
+                                        * multiplication. Just like the
+                                        * previous function, but only
+                                        * applicable if the matrix has
+                                        * only one block.
+                                        */
+      void vmult (Vector       &dst,
+                  const Vector &src) const;
+    
+                                       /**
+                                        * Matrix-vector multiplication:
+                                        * let $dst = M^T*src$ with $M$
+                                        * being this matrix. This
+                                        * function does the same as
+                                        * vmult() but takes the
+                                        * transposed matrix.
+                                        */
+      void Tvmult (BlockVector       &dst,
+                   const BlockVector &src) const;
+  
+                                       /**
+                                        * Matrix-vector
+                                        * multiplication. Just like the
+                                        * previous function, but only
+                                        * applicable if the matrix has
+                                        * only one block row.
+                                        */
+      void Tvmult (BlockVector  &dst,
+                   const Vector &src) const;
+
+                                       /**
+                                        * Matrix-vector
+                                        * multiplication. Just like the
+                                        * previous function, but only
+                                        * applicable if the matrix has
+                                        * only one block column.
+                                        */
+      void Tvmult (Vector    &dst,
+                   const BlockVector &src) const;
+
+                                       /**
+                                        * Matrix-vector
+                                        * multiplication. Just like the
+                                        * previous function, but only
+                                        * applicable if the matrix has
+                                        * only one block.
+                                        */
+      void Tvmult (Vector       &dst,
+                   const Vector &src) const;    
 
                                        /**
                                         * This function collects the
@@ -204,6 +283,86 @@ namespace PETScWrappers
 
 
 /*@}*/
+
+// ------------- inline and template functions -----------------
+
+  inline
+  void
+  BlockSparseMatrix::vmult (BlockVector       &dst,
+                            const BlockVector &src) const
+  {
+    BaseClass::vmult_block_block (dst, src);
+  }
+  
+
+
+  inline
+  void
+  BlockSparseMatrix::vmult (BlockVector  &dst,
+                            const Vector &src) const
+  {
+    BaseClass::vmult_block_nonblock (dst, src);
+  }
+  
+
+
+  inline
+  void
+  BlockSparseMatrix::vmult (Vector            &dst,
+                            const BlockVector &src) const
+  {
+    BaseClass::vmult_nonblock_block (dst, src);
+  }
+  
+
+
+  inline
+  void
+  BlockSparseMatrix::vmult (Vector       &dst,
+                            const Vector &src) const
+  {
+    BaseClass::vmult_nonblock_nonblock (dst, src);
+  }
+
+
+  inline
+  void
+  BlockSparseMatrix::Tvmult (BlockVector       &dst,
+                            const BlockVector &src) const
+  {
+    BaseClass::Tvmult_block_block (dst, src);
+  }
+  
+
+
+  inline
+  void
+  BlockSparseMatrix::Tvmult (BlockVector  &dst,
+                            const Vector &src) const
+  {
+    BaseClass::Tvmult_block_nonblock (dst, src);
+  }
+  
+
+
+  inline
+  void
+  BlockSparseMatrix::Tvmult (Vector            &dst,
+                            const BlockVector &src) const
+  {
+    BaseClass::Tvmult_nonblock_block (dst, src);
+  }
+  
+
+
+  inline
+  void
+  BlockSparseMatrix::Tvmult (Vector       &dst,
+                            const Vector &src) const
+  {
+    BaseClass::Tvmult_nonblock_nonblock (dst, src);
+  }
+  
 }
 
 
index daf5c5168b9f220a154f0c78ab56cb4be0f8c451..4cea47c377b24cce9ac761005f9cadeb53629c0b 100644 (file)
@@ -18,6 +18,7 @@
 #include <base/table.h>
 #include <lac/block_matrix_base.h>
 #include <lac/petsc_parallel_sparse_matrix.h>
+#include <lac/petsc_parallel_block_vector.h>
 #include <cmath>
 
 #ifdef DEAL_II_USE_PETSC
@@ -166,6 +167,85 @@ namespace PETScWrappers
         void reinit (const unsigned int n_block_rows,
                      const unsigned int n_block_columns);      
 
+                                         /**
+                                          * Matrix-vector multiplication:
+                                          * let $dst = M*src$ with $M$
+                                          * being this matrix.
+                                          */
+        void vmult (BlockVector       &dst,
+                    const BlockVector &src) const;
+
+                                         /**
+                                          * Matrix-vector
+                                          * multiplication. Just like the
+                                          * previous function, but only
+                                          * applicable if the matrix has
+                                          * only one block column.
+                                          */
+        void vmult (BlockVector          &dst,
+                    const Vector &src) const;
+
+                                         /**
+                                          * Matrix-vector
+                                          * multiplication. Just like the
+                                          * previous function, but only
+                                          * applicable if the matrix has
+                                          * only one block row.
+                                          */
+        void vmult (Vector    &dst,
+                    const BlockVector &src) const;
+
+                                         /**
+                                          * Matrix-vector
+                                          * multiplication. Just like the
+                                          * previous function, but only
+                                          * applicable if the matrix has
+                                          * only one block.
+                                          */
+        void vmult (Vector       &dst,
+                    const Vector &src) const;
+    
+                                         /**
+                                          * Matrix-vector multiplication:
+                                          * let $dst = M^T*src$ with $M$
+                                          * being this matrix. This
+                                          * function does the same as
+                                          * vmult() but takes the
+                                          * transposed matrix.
+                                          */
+        void Tvmult (BlockVector       &dst,
+                     const BlockVector &src) const;
+  
+                                         /**
+                                          * Matrix-vector
+                                          * multiplication. Just like the
+                                          * previous function, but only
+                                          * applicable if the matrix has
+                                          * only one block row.
+                                          */
+        void Tvmult (BlockVector  &dst,
+                     const Vector &src) const;
+
+                                         /**
+                                          * Matrix-vector
+                                          * multiplication. Just like the
+                                          * previous function, but only
+                                          * applicable if the matrix has
+                                          * only one block column.
+                                          */
+        void Tvmult (Vector    &dst,
+                     const BlockVector &src) const;
+
+                                         /**
+                                          * Matrix-vector
+                                          * multiplication. Just like the
+                                          * previous function, but only
+                                          * applicable if the matrix has
+                                          * only one block.
+                                          */
+        void Tvmult (Vector       &dst,
+                     const Vector &src) const;    
+
                                          /**
                                           * This function collects the
                                           * sizes of the sub-objects and
@@ -198,6 +278,86 @@ namespace PETScWrappers
 
 
 /*@}*/
+
+// ------------- inline and template functions -----------------
+
+    inline
+    void
+    BlockSparseMatrix::vmult (BlockVector       &dst,
+                              const BlockVector &src) const
+    {
+      BaseClass::vmult_block_block (dst, src);
+    }
+  
+
+
+    inline
+    void
+    BlockSparseMatrix::vmult (BlockVector  &dst,
+                              const Vector &src) const
+    {
+      BaseClass::vmult_block_nonblock (dst, src);
+    }
+  
+
+
+    inline
+    void
+    BlockSparseMatrix::vmult (Vector            &dst,
+                              const BlockVector &src) const
+    {
+      BaseClass::vmult_nonblock_block (dst, src);
+    }
+  
+
+
+    inline
+    void
+    BlockSparseMatrix::vmult (Vector       &dst,
+                              const Vector &src) const
+    {
+      BaseClass::vmult_nonblock_nonblock (dst, src);
+    }
+
+
+    inline
+    void
+    BlockSparseMatrix::Tvmult (BlockVector       &dst,
+                               const BlockVector &src) const
+    {
+      BaseClass::Tvmult_block_block (dst, src);
+    }
+  
+
+
+    inline
+    void
+    BlockSparseMatrix::Tvmult (BlockVector  &dst,
+                               const Vector &src) const
+    {
+      BaseClass::Tvmult_block_nonblock (dst, src);
+    }
+  
+
+
+    inline
+    void
+    BlockSparseMatrix::Tvmult (Vector            &dst,
+                               const BlockVector &src) const
+    {
+      BaseClass::Tvmult_nonblock_block (dst, src);
+    }
+  
+
+
+    inline
+    void
+    BlockSparseMatrix::Tvmult (Vector       &dst,
+                               const Vector &src) const
+    {
+      BaseClass::Tvmult_nonblock_nonblock (dst, src);
+    }
+  
   }
   
 }

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.