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
TriaIterator< Accessor > Class Template Reference

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

Inheritance diagram for TriaIterator< Accessor >:
[legend]

Public Member Functions

 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 > &)
 
- 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 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
 
TriaIterator< Accessor > & operator++ ()
 
TriaIterator< Accessor > operator++ (int)
 
TriaIterator< Accessor > & operator-- ()
 
TriaIterator< Accessor > operator-- (int)
 
static ::ExceptionBaseExcAssignmentOfUnusedObject ()
 

Additional Inherited Members

- 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 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 TriaIterator< Accessor >

This specialization of TriaRawIterator provides access only to the used lines, quads, cells, etc.

Definition at line 578 of file tria_iterator.h.

Member Typedef Documentation

◆ iterator_category

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

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

Definition at line 736 of file tria_iterator.h.

◆ value_type

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

Definition at line 737 of file tria_iterator.h.

◆ pointer

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

Definition at line 738 of file tria_iterator.h.

◆ reference

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

Definition at line 739 of file tria_iterator.h.

◆ difference_type

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

Definition at line 740 of file tria_iterator.h.

Constructor & Destructor Documentation

◆ TriaIterator() [1/9]

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

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

◆ TriaIterator() [2/9]

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

Copy constructor.

◆ TriaIterator() [3/9]

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

Conversion constructor from iterators potentially pointing to non-active objects (i.e., for objects for which we can't tell that the object is used just by looking at its type).

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

◆ TriaIterator() [4/9]

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

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.

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

◆ TriaIterator() [5/9]

template<typename Accessor >
template<typename OtherAccessor >
TriaIterator< Accessor >::TriaIterator ( const OtherAccessor &  a)
explicit

Construct from an accessor of type OtherAccessor that is convertible to the type Accessor.

Definition at line 1176 of file tria_iterator.h.

◆ TriaIterator() [6/9]

template<typename Accessor >
template<typename OtherAccessor >
TriaIterator< Accessor >::TriaIterator ( const TriaIterator< 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::cell_iterator from a DoFHandler::cell_iterator, since the DoFAccessor class is derived from the TriaAccessorBase class.

Definition at line 1140 of file tria_iterator.h.

◆ TriaIterator() [7/9]

template<typename Accessor >
TriaIterator< Accessor >::TriaIterator ( 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.

◆ TriaIterator() [8/9]

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

Similar conversion operator to the above one, but does a check whether the iterator points to a used element, which is necessary for raw iterators.

Definition at line 1158 of file tria_iterator.h.

◆ TriaIterator() [9/9]

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

Similar conversion operator to the above one, but for conversion from active iterators.

Definition at line 1149 of file tria_iterator.h.

Member Function Documentation

◆ operator=() [1/4]

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

Assignment operator.

◆ operator=() [2/4]

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

Cross assignment operator. This assignment is only valid if the given iterator points to a used element.

◆ operator=() [3/4]

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

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

◆ operator=() [4/4]

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

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

◆ operator++() [1/2]

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

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

◆ operator++() [2/2]

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

Postfix ++ operator: i++. This operator advances the iterator to the next used 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 >
TriaIterator<Accessor>& TriaIterator< Accessor >::operator-- ( )

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

◆ operator--() [2/2]

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

Postfix -- operator: i--.


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