[Dune-devel] [Dune-Commit] [Commit] dune-istl - 35b879c: [BCRSMatrix] Drop over-eager check in row access operator[]

Christian Engwer christian.engwer at uni-muenster.de
Thu Dec 18 21:21:11 CET 2014


Hi Steffen,

If I remember correctly, I didn't use DUNE_ISTL_WITH_CHECKING, and got an invalid access for empty off-diagonals. Did you test that it works?

Christian

Am 18. Dezember 2014 18:37:01 MEZ, schrieb "Steffen Müthing" <muething at dune-project.org>:
>New commit, appeared at Thu Dec 18 18:37:01 2014 +0100
>as part of the following ref changes:
>
>    branch refs/heads/master          updated from 714cd55 -> 35b879c
>
>Browsable version:
>http://cgit.dune-project.org/repositories/dune-istl/commit/?id=35b879c3f0d003dcbe743c7ca84f6142751c6b48
>
>======================================================================
>
>commit 35b879c3f0d003dcbe743c7ca84f6142751c6b48
>Author: Steffen Müthing <muething at dune-project.org>
>Date:   Thu Dec 18 18:32:01 2014 +0100
>
>    [BCRSMatrix] Drop over-eager check in row access operator[]
>    
>    When DUNE_ISTL_WITH_CHECKING is enabled, the BCRSMatrix throws an
>exception when trying to access a row that has no columns. This creates
>  a problem in PDELab when using nested BCRSMatrices (as some people do
>    for operator splitting in PDELab), where an off-diagonal BCRSMatrix
>block might be completely empty (i.e. have a correctly set up
>structure,
>   but every row in the off-diagonal BCRSMatrix is empty. If the PDELab
>assembler then attempts to set a Dirichlet constraint, it has to access
>    the row to set all columns in that row to zero, but the check in
>    operator[] prevents it from doing so.
>    
>    So this patch just drops that check.
>
> dune/istl/bcrsmatrix.hh | 1 -
> 1 file changed, 1 deletion(-)
>
>
>
>diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh
>index d1170bb..cd1b2fd 100644
>--- a/dune/istl/bcrsmatrix.hh
>+++ b/dune/istl/bcrsmatrix.hh
>@@ -502,7 +502,6 @@ namespace Dune {
>DUNE_THROW(BCRSMatrixError,"You cannot use operator[] in implicit build
>mode before calling compress()");
>       if (r==0) DUNE_THROW(BCRSMatrixError,"row not initialized yet");
>       if (i>=n) DUNE_THROW(BCRSMatrixError,"index out of range");
>-      if (r[i].getptr()==0) DUNE_THROW(BCRSMatrixError,"row not
>initialized yet");
> #endif
>       return r[i];
>     }
>
>_______________________________________________
>Dune-Commit mailing list
>Dune-Commit at dune-project.org
>http://lists.dune-project.org/mailman/listinfo/dune-commit





More information about the Dune-devel mailing list