Compile Error: no type named ‘active_cell_iterator’

41 views
Skip to first unread message

Matthew Rich

unread,
Jul 12, 2021, 5:40:40 AM7/12/21
to deal.II User Group

Hi all,

Once again perplexed by the c++ compiler. I am getting the following error when trying to compile a program from the code gallery.

prog1.cc:In instantiation of ‘typename dealii::DataOut<dim, DoFHandlerType>::cell_iterator Prog1::FilteredDataOut<dim, DH>::first_cell() [with int dim = 3; DH = dealii::DoFHandler<3, 3>; typename dealii::DataOut<dim, DoFHandlerType>::cell_iterator = dealii::TriaIterator<dealii::CellAccessor<3, 3> >]’:
prog1.cc:2668:5:   required from here
prog1.cc:2670:54: error: no type named ‘active_cell_iterator’ in ‘class dealii::DataOut<3, dealii::DoFHandler<3, 3> >’
      typename DataOut<dim, DH>::active_cell_iterator cell = this->dofs->begin_active();
                                                      ^~~~
prog1.cc:2670:54: error: no type named ‘active_cell_iterator’ in ‘class dealii::DataOut<3, dealii::DoFHandler<3, 3> >’
prog1.cc: In instantiation of ‘typename dealii::DataOut<dim, DoFHandlerType>::cell_iterator Cartilage::FilteredDataOut<dim, DH>::next_cell(const typename dealii::DataOut<dim, DoFHandlerType>::cell_iterator&) [with int dim = 3; DH = dealii::DoFHandler<3, 3>; typename dealii::DataOut<dim, DoFHandlerType>::cell_iterator = dealii::TriaIterator<dealii::CellAccessor<3, 3> >]’:
prog1.cc:2678:5:   required from here
prog1.cc:2684:10: error: no type named ‘active_cell_iterator’ in ‘class dealii::DataOut<3, dealii::DoFHandler<3, 3> >’
       ++(FilteredIterator<typename DataOut<dim, DH>::active_cell_iterator>
         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        (predicate,old_cell));


Looking in the manual I see the following which makes me think the code should work

using DataOut< dim, DoFHandlerType >::cell_iterator = typename DataOut_DoFData<DoFHandlerType, DoFHandlerType::dimension, DoFHandlerType::space_dimension>::cell_iterator

Should I just change active_cell_iterator to cell_iterator? I am worried that they wont work the same creating problems downstream.

Thanks in advance.

Bruno Turcksin

unread,
Jul 12, 2021, 8:01:37 AM7/12/21
to deal.II User Group
Hi,

On Monday, July 12, 2021 at 5:40:40 AM UTC-4 mjri...@gmail.com wrote:

Should I just change active_cell_iterator to cell_iterator? I am worried that they wont work the same creating problems downstream.
Only cell_iterator is accessible not active_cell_iterator. So yes, active_cell_iterator won't work but cell_iterator will. Like you expect, active_cell_iterator and cell_iterator do different things. You probably want to access the active_cell_iterator through the DoFHandler or the Triangulation.

Best,

Bruno

Matthew Rich

unread,
Jul 12, 2021, 9:28:50 AM7/12/21
to deal.II User Group
OK,

At one time did dataout have an active_cell_iterator property. The code gallery stuff may not get the same upkeep as the tutorials and maybe the library updated and broke this piece of the code. I see both
  typename DoFHandler<dim>::active_cell_iterator

and 

DataOut<dim, DH>::active_cell_iterator, which is with the outputting portion of the code. Is using the DoFHandler truly equivalent?




Bruno Turcksin

unread,
Jul 12, 2021, 9:49:34 AM7/12/21
to deal.II User Group
Yes, it looks like DataOut used to have DataOut<dim, DH>::active_cell_iterator. I looked back at an old version of deal.II and DataOut<dim, DH>::active_cell_iterator was just a typedef for Triangulation<dim, space_dim>::cell_iterator.

Bruno

Wolfgang Bangerth

unread,
Jul 12, 2021, 9:54:32 AM7/12/21
to dea...@googlegroups.com
On 7/12/21 7:28 AM, Matthew Rich wrote:
>
> At one time did dataout have an active_cell_iterator property. The code
> gallery stuff may not get the same upkeep as the tutorials and maybe the
> library updated and broke this piece of the code.

Yes, that seems to be the case. Would you be interested in submitting a patch?
The right approach is to simply use the corresponding DoFHandler iterator type.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Matthew Rich

unread,
Jul 14, 2021, 8:12:15 PM7/14/21
to deal.II User Group
If some one would guide me on how to submit the patch, I am willing to give it a go!

Wolfgang Bangerth

unread,
Jul 14, 2021, 10:20:28 PM7/14/21
to dea...@googlegroups.com
On 7/14/21 6:12 PM, Matthew Rich wrote:
> If some one would guide me on how to submit the patch, I am willing to give it
> a go!

That would be fantastic! An introduction is here:
https://github.com/dealii/dealii/wiki/Contributing

hussan zeb

unread,
Jul 17, 2021, 11:34:37 AM7/17/21
to dea...@googlegroups.com
--
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/5814a405-ff20-4e36-be7d-47d1bdba5160n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages