]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Piesewise multiplication of PETSc vectors and redocument.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Jul 2012 11:35:08 +0000 (11:35 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Jul 2012 11:35:08 +0000 (11:35 +0000)
git-svn-id: https://svn.dealii.org/trunk@25727 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/petsc_vector_base.h
deal.II/source/lac/petsc_vector_base.cc

index e62b926d173bc7bda249464e11485f6a6c594f99..a5df5e3d60b4e5710ec9af748dbc466dbb28b2bb 100644 (file)
@@ -551,19 +551,32 @@ namespace PETScWrappers
 
                                        /**
                                         * A collective piecewise
-                                        * multiply operation. TODO:
-                                        * The model for this function
-                                        * should be similer to add ().
+                                        * multiply operation on
+                                        * <code>this</code> vector
+                                        * with itself. TODO: The model
+                                        * for this function should be
+                                        * similer to add ().
                                         */
       VectorBase & mult ();
 
                                        /**
-                                        * A collective piecewise
-                                        * multiply operation of two
-                                        * vectors.
+                                        * Same as above, but a
+                                        * collective piecewise
+                                        * multiply operation of
+                                        * <code>this</code> vector
+                                        * with \f$v\f$.
                                         */
       VectorBase & mult (const VectorBase &v);
 
+                                       /**
+                                        * Same as above, but a
+                                        * collective piecewise
+                                        * multiply operation of
+                                        * \f$u\f$ with \f$v\f$.
+                                        */
+      VectorBase & mult (const VectorBase &u,
+                        const VectorBase &v);
+
                                        /**
                                         * Return whether the vector contains
                                         * only elements with value zero. This
index ba8fa63d23fefe794e64f36cbb4b6bc62c8a655d..20dcc6fd0ec9c68d936184481ff969495821855d 100644 (file)
@@ -646,6 +646,7 @@ namespace PETScWrappers
     return *this;
   }
 
+
   VectorBase &
   VectorBase::mult (const VectorBase &v)
   {
@@ -656,6 +657,15 @@ namespace PETScWrappers
   }
 
 
+  VectorBase &
+  VectorBase::mult (const VectorBase &u,
+                   const VectorBase &v)
+  {
+    const int ierr = VecPointwiseMult (vector,u,v);
+    AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+    return *this;
+  }
 
   bool
   VectorBase::all_zero () const

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.