"is protected within this context" error for BlockSparseMatrix iterators

39 views
Skip to first unread message

Simon

unread,
Oct 31, 2023, 6:08:28 AM10/31/23
to deal.II User Group
Dear all,

dealii::BlockSparseMatrix<double> systemMatrix;
auto systemMatrixIteratorEnd = systemMatrix.end(0);
auto systemMatrixIteratorBegin = systemMatrix.begin(0);
if (systemMatrixIteratorBegin != systemMatrixIteratorEnd) std::cout<<"Example"<<std::endl;

Using deal.ii 9.4.0, this results in the compilation error

include/deal.II/lac/matrix_iterator.h:184:20: error: ‘bool dealii::BlockMatrixIterators::Accessor<BlockMatrixType, false>::operator==(const dealii::BlockMatrixIterators::Accessor<BlockMatrixType, false>&) const [with BlockMatrixType = dealii::BlockMatrixBase<dealii::SparseMatrix<double> >]’ is protected within this context
  184 |   return (accessor == other.accessor);

include/deal.II/lac/block_matrix_base.h:1475:3: note: declared protected here
 1475 |   Accessor<BlockMatrixType, false>::operator==(const Accessor &a) const


Everything works if BlockSparseMatrix is replaced by SparseMatrix.

Is there anything I miss here?

Best
Simon


Wolfgang Bangerth

unread,
Oct 31, 2023, 3:17:49 PM10/31/23
to dea...@googlegroups.com
No, it's just an (interesting) bug. I have the fix here:
https://github.com/dealii/dealii/pull/16225
Thanks for pointing it out and providing a good testcase!

Best
W.

Simon Wiesheier

unread,
Oct 31, 2023, 3:34:38 PM10/31/23
to dea...@googlegroups.com
Thank you for the fix!

I have to stick to deal.ii 9.4.0 for a while which I installed via spack.  
Is there anything I can add to my user code or do I have to recompile the library with your changes? 

Best
Simon

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/28af670a-d40b-4a33-9585-bea821f6a254%40colostate.edu.

Wolfgang Bangerth

unread,
Oct 31, 2023, 3:49:36 PM10/31/23
to dea...@googlegroups.com

On 10/31/23 13:34, Simon Wiesheier wrote:
>
> I have to stick to deal.ii 9.4.0 for a while which I installed via spack.
> Is there anything I can add to my user code or do I have to recompile
> the library with your changes?

If you are able to edit the header files of your installation, you can
just make the same changes by hand that I made in the patch.

Best
W.
Reply all
Reply to author
Forward
0 new messages