From: Martin Kronbichler Date: Tue, 26 Feb 2008 17:56:25 +0000 (+0000) Subject: Added functionality print_gnuplot to BlockSparsityPatternBase X-Git-Tag: v8.0.0~9364 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=387f1635e4bbbc1d7c078656ff33893265eb0370;p=dealii.git Added functionality print_gnuplot to BlockSparsityPatternBase git-svn-id: https://svn.dealii.org/trunk@15794 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 59fa1e3806..e91eb26e05 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -215,6 +215,13 @@ an integer id of the current thread.
    +
  1. New: The functionality print_gnuplot is now also available for sparsity +patterns derived from the class BlockSparsityPatternBase, e.g. for +BlockSparsityPattern in the same way as for general sparsity patterns. +
    +(Martin Kronbichler 2008/2/26) +
  2. +
  3. Fixed: The PETScWrappers::MatrixBase::clear_row and PETScWrappers::MatrixBase::clear_rows functions had a memory leak that made PETSc become progressively slower over time. This is now fixed. diff --git a/deal.II/lac/include/lac/block_sparsity_pattern.h b/deal.II/lac/include/lac/block_sparsity_pattern.h index d5ae50f4d9..2b75d2deb1 100644 --- a/deal.II/lac/include/lac/block_sparsity_pattern.h +++ b/deal.II/lac/include/lac/block_sparsity_pattern.h @@ -338,6 +338,17 @@ class BlockSparsityPatternBase : public Subscriptor */ void print (std::ostream &out) const; + /** + * Print the sparsity of the matrix + * in a format that gnuplot understands + * and which can be used to plot the + * sparsity pattern in a graphical + * way. This is the same functionality + * implemented for usual Sparsity + * patterns, see @ref SparsityPattern. + */ + void print_gnuplot (std::ostream &out) const; + /** @addtogroup Exceptions * @{ */ diff --git a/deal.II/lac/source/block_sparsity_pattern.cc b/deal.II/lac/source/block_sparsity_pattern.cc index 17e03f2e6b..1789835f05 100644 --- a/deal.II/lac/source/block_sparsity_pattern.cc +++ b/deal.II/lac/source/block_sparsity_pattern.cc @@ -265,6 +265,31 @@ BlockSparsityPatternBase::print(std::ostream& out) const } +template +void +BlockSparsityPatternBase::print_gnuplot(std::ostream &out) const +{ + unsigned int k=0; + for (unsigned int ib=0;ib(i+k) << std::endl;; + l += b.n_cols(); + } + } + k += block(ib,0).n_rows(); + } +} + + + // Remark: The following explicit instantiations needed to be moved to // this place here to work around a problem with gcc3.3 on Apple MacOSX.