From: heister Date: Tue, 25 Sep 2012 15:58:31 +0000 (+0000) Subject: added BlockCompressedSimpleSparsityPattern::column_number() X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ec0205ab51611475769efc0427428187cdf27c0;p=dealii-svn.git added BlockCompressedSimpleSparsityPattern::column_number() git-svn-id: https://svn.dealii.org/trunk@26728 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index d935b2f623..0995a7e034 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -81,6 +81,10 @@ DoFHandler, in particular removal of specializations.

Specific improvements

    +
  1. New: Added BlockCompressedSimpleSparsityPattern::column_number(). +
    +(Timo Heister, 2012/09/25) +
  2. New: There is now a function hp::FECollection::n_blocks() in analogy to the existing function hp::FECollection::n_components().
    diff --git a/deal.II/include/deal.II/lac/block_sparsity_pattern.h b/deal.II/include/deal.II/lac/block_sparsity_pattern.h index bdd0d95d31..f20626e40d 100644 --- a/deal.II/include/deal.II/lac/block_sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/block_sparsity_pattern.h @@ -957,6 +957,14 @@ class BlockCompressedSimpleSparsityPattern : public BlockSparsityPatternBase & partitioning); + /** + * Access to column number field. + * Return the column number of + * the @p index th entry in row @p row. + */ + unsigned int column_number (const unsigned int row, + const unsigned int index) const; + /** * Allow the use of the reinit * functions of the base class as @@ -1325,6 +1333,31 @@ BlockSparsityPatternBase::n_block_rows () const } +inline +unsigned int +BlockCompressedSimpleSparsityPattern::column_number (const unsigned int row, + const unsigned int index) const +{ + // .first= ith block, .second = jth row in that block + const std::pair + row_index = row_indices.global_to_local (row); + + Assert(indexrow_length (row_index.second); + if (indexcolumn_number(row_index.second, index-c); + c += rowlen; + } + + Assert(false, ExcInternalError()); + return 0; +} + + inline void BlockSparsityPattern::reinit (