]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make a BlockVector::print function available.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Feb 2010 02:41:21 +0000 (02:41 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Feb 2010 02:41:21 +0000 (02:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@20560 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/petsc_parallel_block_vector.h

index 90803f64de1744d23fe927fd4948f1b62dc5d37c..162294450f201c3b2de0f53253b39db534efbe61 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2004, 2005, 2006, 2007, 2009 by the deal.II authors
+//    Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -303,6 +303,14 @@ namespace PETScWrappers
                                           * to standard functions.
                                           */
         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;
     
                                          /**
                                           * Exception
@@ -452,7 +460,26 @@ namespace PETScWrappers
         this->components[i].swap (v.components[i]);
       ::dealii::swap (this->block_indices, v.block_indices);
     }
-  
+
+
+
+    inline
+    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.