]> https://gitweb.dealii.org/ - dealii.git/commitdiff
One more fix when PETSc is used.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 13 Jan 2010 16:27:48 +0000 (16:27 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 13 Jan 2010 16:27:48 +0000 (16:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@20364 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/petsc_block_vector.h

index c526cbf449d22d00a5e57c0cf169a9fb2008403e..94b6d2793e48d3932c7f7ea3b90a8d0385420d49 100644 (file)
@@ -291,6 +291,14 @@ namespace PETScWrappers
                                         */
       void swap (BlockVector &v);    
 
+                                    /**
+                                     * Print to a stream.
+                                     */
+      void print (std::ostream       &out,
+                 const unsigned int  precision = 3,
+                 const bool          scientific = true,
+                 const bool          across = true) const;
+
                                       /** @addtogroup Exceptions
                                        * @{ */
 
@@ -463,6 +471,23 @@ namespace PETScWrappers
   }
 
 
+
+  void BlockVector::print (std::ostream       &out,
+                          const unsigned int  precision,
+                          const bool          scientific,
+                          const bool          across) const
+  {
+    for (unsigned int i=0;i<this->n_blocks();++i)
+      {
+       if (across)
+         out << 'C' << i << ':';
+       else
+         out << "Component " << i << std::endl;
+       this->components[i].print(out, precision, scientific, across);
+      }
+  }
+
+
   
 
 /**

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.