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

Steffen Müthing steffen.muething at iwr.uni-heidelberg.de
Thu Dec 18 23:58:04 CET 2014


Hi Christian,

Am 18.12.2014 um 21:21 schrieb Christian Engwer <christian.engwer at uni-muenster.de>:

> 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?

yes, it works (now, after some last-minute fixes for the final example in my dissertation ;-) ). But it definitely
doesn’t work with the check - that’s what Jurgis and I discovered today. Removing that check fixed his problem,
and his program even returned sensible results…

Steffen

> 
> 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
> 
> 
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune-devel/attachments/20141218/7f9e0e9a/attachment.sig>


More information about the Dune-devel mailing list