From: kanschat Date: Mon, 26 Sep 2011 15:06:23 +0000 (+0000) Subject: add SparsityPattern::row_position X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4098052a2bf24de6ee359302df21e5736d4ae5ad;p=dealii-svn.git add SparsityPattern::row_position git-svn-id: https://svn.dealii.org/trunk@24428 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 6ddd79ea74..de6bdb9ecc 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -324,6 +324,14 @@ and DoF handlers embedded in higher dimensional space have been added.

Specific improvements

    + +
  1. New: SparsityPattern::row_position() finds a column index in a row and returns +its "local" index or numbers::invalid_unsigned_int. +
    +(Guido Kanschat, 2011/09/26) + +
  2. New: There is now a function GridTools::volume() computing the volume +
  3. New: The function Utilities::MPI::sum function can be used to compute the sum of values over a number of MPI processes without having to deal with the underlying MPI functions. diff --git a/deal.II/include/deal.II/lac/sparsity_pattern.h b/deal.II/include/deal.II/lac/sparsity_pattern.h index 16b404d949..79310ada6f 100644 --- a/deal.II/include/deal.II/lac/sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/sparsity_pattern.h @@ -366,8 +366,8 @@ class SparsityPattern : public Subscriptor static const unsigned int invalid_entry = numbers::invalid_unsigned_int; /** - * @name Functions generating and - * filling a SparsityPattern. + * @name Construction and setup + * Constructors, destructor; functions initializing, copying and filling an object. */ // @{ /** @@ -1124,6 +1124,19 @@ class SparsityPattern : public Subscriptor bool exists (const unsigned int i, const unsigned int j) const; + /** + * The index of a global matrix + * entry in its row. + * + * This function is analogous to + * operator(), but it computes + * the index not with respect to + * the total field, but only with + * respect to the row j. + */ + unsigned int row_position(const unsigned int i, + const unsigned int j) const; + /** * Access to column number field. * Return the column number of @@ -1256,7 +1269,6 @@ class SparsityPattern : public Subscriptor // @{ /** * @deprecated - * * This function is deprecated. Use * SparsityTools::partition instead. * @@ -1320,7 +1332,7 @@ class SparsityPattern : public Subscriptor /** - * This is kind of an expert mode. Get + * @deprecated This is kind of an expert mode. Get * access to the rowstart array, but * read-only. * @@ -1377,8 +1389,8 @@ class SparsityPattern : public Subscriptor inline const unsigned int * get_column_numbers () const; BOOST_SERIALIZATION_SPLIT_MEMBER() - /** @addtogroup Exceptions + * @name Exceptions * @{ */ /** * You tried to add an element to diff --git a/deal.II/source/lac/sparsity_pattern.cc b/deal.II/source/lac/sparsity_pattern.cc index d1d09ed4a9..5a113cd699 100644 --- a/deal.II/source/lac/sparsity_pattern.cc +++ b/deal.II/source/lac/sparsity_pattern.cc @@ -794,8 +794,7 @@ SparsityPattern::add_entries (const unsigned int row, bool -SparsityPattern::exists (const unsigned int i, - const unsigned int j) const +SparsityPattern::exists (const unsigned int i, const unsigned int j) const { Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject()); Assert (i SparsityPattern::matrix_position (const unsigned int global_index) const {