From: Guido Kanschat Date: Wed, 11 Jun 2003 16:46:59 +0000 (+0000) Subject: function for element access added X-Git-Tag: v8.0.0~16416 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3bf568c896a74d74b67c681bf3439a429f8e0dc;p=dealii.git function for element access added git-svn-id: https://svn.dealii.org/trunk@7793 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/precondition_block.h b/deal.II/lac/include/lac/precondition_block.h index 949b6ef8c0..9f18bdb88b 100644 --- a/deal.II/lac/include/lac/precondition_block.h +++ b/deal.II/lac/include/lac/precondition_block.h @@ -82,6 +82,11 @@ class PreconditionBlock : public virtual Subscriptor * Define number type of matrix. */ typedef typename MATRIX::value_type number; + + /** + * Value type for inverse matrices. + */ + typedef inverse_type value_type; public: /** @@ -165,6 +170,15 @@ class PreconditionBlock : public virtual Subscriptor */ bool empty () const; + /** + * Read-only access to entries. + * This function is only possible + * if the inverse diagonal blocks + * are stored. + */ + value_type el(unsigned int i, + unsigned int j) const; + /** * Use only the inverse of the * first diagonal block to save @@ -369,6 +383,11 @@ class PreconditionBlockJacobi : public virtual Subscriptor, */ PreconditionBlock::empty; + /** + * Make function of base class public again. + */ + PreconditionBlock::el; + /** * Make function of base class public again. */ @@ -474,6 +493,11 @@ class PreconditionBlockSOR : public virtual Subscriptor, * Make function of base class public again. */ PreconditionBlock::empty; + + /** + * Make function of base class public again. + */ + PreconditionBlock::el; /** * Make function of base class public again. @@ -630,6 +654,11 @@ class PreconditionBlockSSOR : public virtual Subscriptor, */ PreconditionBlockSOR::empty; + /** + * Make function of base class public again. + */ + PreconditionBlockSOR::el; + /** * Make function of base class public again. */ @@ -688,4 +717,27 @@ PreconditionBlock::empty () const return A->empty(); } + +template +inline inverse_type +PreconditionBlock::el ( + unsigned int i, + unsigned int j) const +{ + const unsigned int bs = blocksize; + const unsigned int nb = i/bs; + + const FullMatrix& B = inverse(nb); + + const unsigned int ib = i % bs; + const unsigned int jb = j % bs; + + if (jb +nb != j) + { + return 0.; + } + + return B(ib, jb); +} + #endif