Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | List of all members
TriaActiveIterator< Accessor > Class Template Reference

#include <deal.II/grid/tria_iterator.h>

Inheritance diagram for TriaActiveIterator< Accessor >:
[legend]

Public Member Functions

 TriaActiveIterator ()
 
 TriaActiveIterator (const TriaActiveIterator< Accessor > &)
 
 TriaActiveIterator (const TriaRawIterator< Accessor > &)
 
 TriaActiveIterator (const TriaIterator< Accessor > &)
 
 TriaActiveIterator (const Triangulation< Accessor::dimension, Accessor::space_dimension > *parent, const int level, const int index, const typename Accessor::AccessorData *local_data=0)
 
template<typename OtherAccessor >
 TriaActiveIterator (const TriaActiveIterator< OtherAccessor > &i)
 
 TriaActiveIterator (const TriaAccessorBase< Accessor::structure_dimension, Accessor::dimension, Accessor::space_dimension > &tria_accessor, const typename Accessor::AccessorData *local_data)
 
template<typename OtherAccessor >
 TriaActiveIterator (const TriaRawIterator< OtherAccessor > &i)
 
TriaActiveIterator< Accessor > & operator= (const TriaActiveIterator< Accessor > &)
 
TriaActiveIterator< Accessor > & operator= (const TriaIterator< Accessor > &)
 
TriaActiveIterator< Accessor > & operator= (const TriaRawIterator< Accessor > &)
 
template<class OtherAccessor >
TriaActiveIterator< Accessor > & operator= (const TriaActiveIterator< OtherAccessor > &)
 
template<class OtherAccessor >
TriaActiveIterator< Accessor > & operator= (const TriaRawIterator< OtherAccessor > &)
 
template<class OtherAccessor >
TriaActiveIterator< Accessor > & operator= (const TriaIterator< OtherAccessor > &)
 
TriaActiveIterator< Accessor > & operator++ ()
 
- Public Member Functions inherited from TriaIterator< Accessor >
 TriaIterator ()
 
 TriaIterator (const TriaIterator< Accessor > &)
 
 TriaIterator (const TriaRawIterator< Accessor > &)
 
 TriaIterator (const Triangulation< Accessor::dimension, Accessor::space_dimension > *parent, const int level, const int index, const typename Accessor::AccessorData *local_data=nullptr)
 
template<typename OtherAccessor >
 TriaIterator (const OtherAccessor &a)
 
template<typename OtherAccessor >
 TriaIterator (const TriaIterator< OtherAccessor > &i)
 
 TriaIterator (const TriaAccessorBase< Accessor::structure_dimension, Accessor::dimension, Accessor::space_dimension > &tria_accessor, const typename Accessor::AccessorData *local_data)
 
template<typename OtherAccessor >
 TriaIterator (const TriaRawIterator< OtherAccessor > &i)
 
template<typename OtherAccessor >
 TriaIterator (const TriaActiveIterator< OtherAccessor > &i)
 
TriaIterator< Accessor > & operator= (const TriaIterator< Accessor > &)
 
TriaIterator< Accessor > & operator= (const TriaRawIterator< Accessor > &)
 
template<class OtherAccessor >
TriaIterator< Accessor > & operator= (const TriaIterator< OtherAccessor > &)
 
template<class OtherAccessor >
TriaIterator< Accessor > & operator= (const TriaRawIterator< OtherAccessor > &)
 
TriaIterator< Accessor > & operator++ ()
 
TriaIterator< Accessor > operator++ (int)
 
TriaIterator< Accessor > & operator-- ()
 
TriaIterator< Accessor > operator-- (int)
 
- Public Member Functions inherited from TriaRawIterator< Accessor >
 TriaRawIterator ()
 
 TriaRawIterator (const TriaRawIterator &)
 
 TriaRawIterator (const Accessor &a)
 
template<typename OtherAccessor >
 TriaRawIterator (const OtherAccessor &a)
 
 TriaRawIterator (const Triangulation< Accessor::dimension, Accessor::space_dimension > *parent, const int level, const int index, const typename AccessorType::AccessorData *local_data=nullptr)
 
template<typename OtherAccessor >
 TriaRawIterator (const TriaRawIterator< OtherAccessor > &i)
 
 TriaRawIterator (const TriaAccessorBase< Accessor::structure_dimension, Accessor::dimension, Accessor::space_dimension > &tria_accessor, const typename Accessor::AccessorData *local_data)
 
template<typename OtherAccessor >
 TriaRawIterator (const TriaIterator< OtherAccessor > &i)
 
template<typename OtherAccessor >
 TriaRawIterator (const TriaActiveIterator< OtherAccessor > &i)
 
const Accessor & operator* () const
 
Accessor & operator* ()
 
const Accessor * operator-> () const
 
Accessor * operator-> ()
 
const Accessor & access_any () const
 
TriaRawIteratoroperator= (const TriaRawIterator &)
 
bool operator== (const TriaRawIterator &) const
 
bool operator!= (const TriaRawIterator &) const
 
bool operator< (const TriaRawIterator &) const
 
bool operator> (const TriaRawIterator &) const
 
TriaRawIteratoroperator++ ()
 
TriaRawIterator operator++ (int)
 
TriaRawIteratoroperator-- ()
 
TriaRawIterator operator-- (int)
 
IteratorState::IteratorStates state () const
 
template<class StreamType >
void print (StreamType &out) const
 
std::size_t memory_consumption () const
 

Advancement of iterators

using iterator_category = typename TriaIterator< Accessor >::iterator_category
 
using value_type = typename TriaIterator< Accessor >::value_type
 
using pointer = typename TriaIterator< Accessor >::pointer
 
using reference = typename TriaIterator< Accessor >::reference
 
using difference_type = typename TriaIterator< Accessor >::difference_type
 
TriaActiveIterator< Accessor > operator++ (int)
 
TriaActiveIterator< Accessor > & operator-- ()
 
TriaActiveIterator< Accessor > operator-- (int)
 
static ::ExceptionBaseExcAssignmentOfInactiveObject ()
 

Additional Inherited Members

- Public Types inherited from TriaIterator< Accessor >
using iterator_category = typename TriaRawIterator< Accessor >::iterator_category
 
using value_type = typename TriaRawIterator< Accessor >::value_type
 
using pointer = typename TriaRawIterator< Accessor >::pointer
 
using reference = typename TriaRawIterator< Accessor >::reference
 
using difference_type = typename TriaRawIterator< Accessor >::difference_type
 
- Public Types inherited from TriaRawIterator< Accessor >
using AccessorType = Accessor
 
using iterator_category = std::bidirectional_iterator_tag
 
using value_type = Accessor
 
using difference_type = int
 
using pointer = Accessor *
 
using reference = Accessor &
 
- Static Public Member Functions inherited from TriaIterator< Accessor >
static ::ExceptionBaseExcAssignmentOfUnusedObject ()
 
- Static Public Member Functions inherited from TriaRawIterator< Accessor >
static ::ExceptionBaseExcDereferenceInvalidCell (Accessor arg1)
 
static ::ExceptionBaseExcDereferenceInvalidObject (Accessor arg1)
 
static ::ExceptionBaseExcAdvanceInvalidObject ()
 
static ::ExceptionBaseExcInvalidComparison ()
 
- Protected Attributes inherited from TriaRawIterator< Accessor >
Accessor accessor
 

Detailed Description

template<typename Accessor>
class TriaActiveIterator< Accessor >

This specialization of TriaIterator provides access only to the active lines, quads, cells, etc. An active cell is a cell which is not refined and thus a cell on which calculations on the finest level are done.

Definition at line 759 of file tria_iterator.h.

Member Typedef Documentation

◆ iterator_category

template<typename Accessor >
using TriaActiveIterator< Accessor >::iterator_category = typename TriaIterator<Accessor>::iterator_category

Declare some alias which are standard for iterators and are used by algorithms to enquire about the specifics of the iterators they work on.

Definition at line 936 of file tria_iterator.h.

◆ value_type

template<typename Accessor >
using TriaActiveIterator< Accessor >::value_type = typename TriaIterator<Accessor>::value_type

Definition at line 937 of file tria_iterator.h.

◆ pointer

template<typename Accessor >
using TriaActiveIterator< Accessor >::pointer = typename TriaIterator<Accessor>::pointer

Definition at line 938 of file tria_iterator.h.

◆ reference

template<typename Accessor >
using TriaActiveIterator< Accessor >::reference = typename TriaIterator<Accessor>::reference

Definition at line 939 of file tria_iterator.h.

◆ difference_type

template<typename Accessor >
using TriaActiveIterator< Accessor >::difference_type = typename TriaIterator<Accessor>::difference_type

Definition at line 940 of file tria_iterator.h.

Constructor & Destructor Documentation

◆ TriaActiveIterator() [1/8]

template<typename Accessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( )

Default constructor. This constructor creates an iterator pointing to an invalid object. The iterator is consequently not usable.

◆ TriaActiveIterator() [2/8]

template<typename Accessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( const TriaActiveIterator< Accessor > &  )

Copy constructor.

◆ TriaActiveIterator() [3/8]

template<typename Accessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( const TriaRawIterator< Accessor > &  )

Conversion constructor creating an active iterator from an iterators pointing to a potentially non-active object (or at least from which it is not apparent from the type alone that it is active).

Precondition
The argument passed to this constructor must either be (i) a past-the-end iterator; or (ii) it must point to an active object. All other cases will result in an exception.

◆ TriaActiveIterator() [4/8]

template<typename Accessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( const TriaIterator< Accessor > &  )

Conversion constructor creating an active iterator from an iterators pointing to a potentially non-active object (or at least from which it is not apparent from the type alone that it is active).

Precondition
The argument passed to this constructor must either be (i) a past-the-end iterator; or (ii) it must point to an active object. All other cases will result in an exception.

◆ TriaActiveIterator() [5/8]

template<typename Accessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( const Triangulation< Accessor::dimension, Accessor::space_dimension > *  parent,
const int  level,
const int  index,
const typename Accessor::AccessorData *  local_data = 0 
)

Constructor, initialized with the triangulation, the level and index of the object pointed to. The last parameter is of a type declared by the accessor class used by the current iterator.

Precondition
The argument passed to this constructor must either be (i) a past-the-end iterator; or (ii) it must point to an active object. All other cases will result in an exception.

◆ TriaActiveIterator() [6/8]

template<typename Accessor >
template<typename OtherAccessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( const TriaActiveIterator< OtherAccessor > &  i)
inline

This is a conversion operator (constructor) which takes another iterator type and copies the data; this conversion works, if there is a conversion path from the OtherAccessor class to the Accessor class of this object. One such path would be derived class to base class, which for example may be used to get a Triangulation::active_cell_iterator from a DoFHandler::active_cell_iterator, since the DoFAccessor class is derived from the TriaAccessorBase class.

Definition at line 1193 of file tria_iterator.h.

◆ TriaActiveIterator() [7/8]

template<typename Accessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( const TriaAccessorBase< Accessor::structure_dimension, Accessor::dimension, Accessor::space_dimension > &  tria_accessor,
const typename Accessor::AccessorData *  local_data 
)

Another conversion operator, where we use the pointers to the Triangulation from a TriaAccessorBase object, while the additional data is used according to the actual type of Accessor.

◆ TriaActiveIterator() [8/8]

template<typename Accessor >
template<typename OtherAccessor >
TriaActiveIterator< Accessor >::TriaActiveIterator ( const TriaRawIterator< OtherAccessor > &  i)
inline

Similar conversion operator to the above one, but does a check whether the iterator points to a used element, and is active, which is necessary for raw iterators. Since usual iterators are also raw iterators, this constructor works also for parameters of type TriaIterator<OtherAccessor>.

Precondition
The argument passed to this constructor must either be (i) a past-the-end iterator; or (ii) it must point to an active object. All other cases will result in an exception.

Definition at line 1202 of file tria_iterator.h.

Member Function Documentation

◆ operator=() [1/6]

template<typename Accessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator= ( const TriaActiveIterator< Accessor > &  )

Assignment operator.

◆ operator=() [2/6]

template<typename Accessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator= ( const TriaIterator< Accessor > &  )

Cross assignment operator. This assignment is only valid if the given iterator points to an active element.

◆ operator=() [3/6]

template<typename Accessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator= ( const TriaRawIterator< Accessor > &  )

Cross assignment operator. This assignment is only valid if the given iterator points to an active element or past the end.

◆ operator=() [4/6]

template<typename Accessor >
template<class OtherAccessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator= ( const TriaActiveIterator< OtherAccessor > &  )

Assignment operator. Requires, that Accessor can be copied from OtherAccessor.

◆ operator=() [5/6]

template<typename Accessor >
template<class OtherAccessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator= ( const TriaRawIterator< OtherAccessor > &  )

Cross assignment operator. This assignment is only valid if the given iterator points to an active element or past the end. Requires, that Accessor can be copied from OtherAccessor.

◆ operator=() [6/6]

template<typename Accessor >
template<class OtherAccessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator= ( const TriaIterator< OtherAccessor > &  )

Cross assignment operator. This assignment is only valid if the given iterator points to an active element. Requires, that Accessor can be copied from OtherAccessor.

◆ operator++() [1/2]

template<typename Accessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator++ ( )

Prefix ++ operator: ++i. This operator advances the iterator to the next active element and returns a reference to *this.

◆ operator++() [2/2]

template<typename Accessor >
TriaActiveIterator<Accessor> TriaActiveIterator< Accessor >::operator++ ( int  )

Postfix ++ operator: i++. This operator advances the iterator to the next active element, but returns an iterator to the element previously pointed to. Since this involves a temporary and a copy operation and since an active_iterator is quite a large object for a pointer, use the prefix operator ++i whenever possible, especially in the head of for loops (for (; i!=end; ++i)) since there you normally never need the returned value.

◆ operator--() [1/2]

template<typename Accessor >
TriaActiveIterator<Accessor>& TriaActiveIterator< Accessor >::operator-- ( )

Prefix -- operator: --i. This operator advances the iterator to the previous active element and returns a reference to *this.

◆ operator--() [2/2]

template<typename Accessor >
TriaActiveIterator<Accessor> TriaActiveIterator< Accessor >::operator-- ( int  )

Postfix -- operator: i--.


The documentation for this class was generated from the following file: