From: Wolfgang Bangerth Date: Fri, 12 Feb 2010 02:41:21 +0000 (+0000) Subject: Make a BlockVector::print function available. X-Git-Tag: v8.0.0~6496 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be6341c92289aa422c7d0ac1c6e1887b393a4d81;p=dealii.git Make a BlockVector::print function available. git-svn-id: https://svn.dealii.org/trunk@20560 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/petsc_parallel_block_vector.h b/deal.II/lac/include/lac/petsc_parallel_block_vector.h index 90803f64de..162294450f 100644 --- a/deal.II/lac/include/lac/petsc_parallel_block_vector.h +++ b/deal.II/lac/include/lac/petsc_parallel_block_vector.h @@ -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;in_blocks();++i) + { + if (across) + out << 'C' << i << ':'; + else + out << "Component " << i << std::endl; + this->components[i].print(out, precision, scientific, across); + } + } + /**