deal.II version GIT relicensing-2238-gc05b561aad 2024-12-10 20:50:00+00:00
|
#include <deal.II/grid/tria_iterator.h>
Public Types | |
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 |
using | AccessorType = Accessor |
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=nullptr) | |
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++ () |
template<typename OtherAccessor = Accessor> | |
std::enable_if_t< std::is_convertible_v< OtherAccessor, Accessor >, bool > | operator== (const TriaRawIterator< OtherAccessor > &) const |
bool | operator!= (const TriaRawIterator &) const |
bool | operator< (const TriaRawIterator &) const |
bool | operator> (const TriaRawIterator &) const |
IteratorState::IteratorStates | state () const |
template<typename StreamType > | |
void | print (StreamType &out) const |
std::size_t | memory_consumption () const |
Advancement of iterators | |
TriaActiveIterator< Accessor > | operator++ (int) |
TriaActiveIterator< Accessor > & | operator-- () |
TriaActiveIterator< Accessor > | operator-- (int) |
Dereferencing | |
Accessor | operator* () const |
const Accessor * | operator-> () const |
Accessor * | operator-> () |
const Accessor & | access_any () const |
Static Public Member Functions | |
static ::ExceptionBase & | ExcAssignmentOfInactiveObject () |
static ::ExceptionBase & | ExcAssignmentOfUnusedObject () |
Exceptions | |
static ::ExceptionBase & | ExcDereferenceInvalidCell (Accessor arg1) |
static ::ExceptionBase & | ExcDereferenceInvalidObject (Accessor arg1) |
static ::ExceptionBase & | ExcAdvanceInvalidObject () |
static ::ExceptionBase & | ExcInvalidComparison () |
Protected Attributes | |
Accessor | 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 754 of file tria_iterator.h.
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 931 of file tria_iterator.h.
using TriaActiveIterator< Accessor >::value_type = typename TriaIterator<Accessor>::value_type |
Definition at line 932 of file tria_iterator.h.
using TriaActiveIterator< Accessor >::pointer = typename TriaIterator<Accessor>::pointer |
Definition at line 933 of file tria_iterator.h.
using TriaActiveIterator< Accessor >::reference = typename TriaIterator<Accessor>::reference |
Definition at line 934 of file tria_iterator.h.
using TriaActiveIterator< Accessor >::difference_type = typename TriaIterator<Accessor>::difference_type |
Definition at line 935 of file tria_iterator.h.
|
inherited |
Declare the type of the Accessor for use in the outside world. This way other functions can use the Accessor's type without knowledge of how the exact implementation actually is.
Definition at line 234 of file tria_iterator.h.
TriaActiveIterator< Accessor >::TriaActiveIterator | ( | ) |
Default constructor. This constructor creates an iterator pointing to an invalid object. The iterator is consequently not usable.
TriaActiveIterator< Accessor >::TriaActiveIterator | ( | const TriaActiveIterator< Accessor > & | ) |
Copy constructor.
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).
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).
TriaActiveIterator< Accessor >::TriaActiveIterator | ( | 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 used by the current iterator.
|
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 1176 of file tria_iterator.h.
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.
|
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>
.
Definition at line 1185 of file tria_iterator.h.
TriaActiveIterator< Accessor > & TriaActiveIterator< Accessor >::operator= | ( | const TriaActiveIterator< Accessor > & | ) |
Assignment operator.
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.
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.
TriaActiveIterator< Accessor > & TriaActiveIterator< Accessor >::operator= | ( | const TriaActiveIterator< OtherAccessor > & | ) |
Assignment operator. Requires, that Accessor can be copied from 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.
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.
TriaActiveIterator< Accessor > & TriaActiveIterator< Accessor >::operator++ | ( | ) |
Prefix ++
operator: ++i
. This operator advances the iterator to the next active element and returns a reference to *this
.
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.
TriaActiveIterator< Accessor > & TriaActiveIterator< Accessor >::operator-- | ( | ) |
Prefix --
operator: --i
. This operator advances the iterator to the previous active element and returns a reference to *this
.
TriaActiveIterator< Accessor > TriaActiveIterator< Accessor >::operator-- | ( | int | ) |
Postfix --
operator: i--
.
|
inlineinherited |
Dereferencing operator, returns a copy of the underlying accessor for the cell pointed to by the iterator. Usage is thus like (*i).index();
This function has to be specialized explicitly for the different Pointers
, to allow an iterator<1,TriangulationLevel<1>::LinesData>
to point to tria->lines.cells[index]
while for one dimension higher it has to point to tria->quads.cells[index]
.
You must not dereference invalid or past the end iterators.
Definition at line 991 of file tria_iterator.h.
|
inlineinherited |
Dereferencing operator, returns a reference of the internal accessor for the cell pointed to by the iterator. Usage is thus like i->index();
There is a const
and a non-const
version.
Definition at line 1016 of file tria_iterator.h.
|
inlineinherited |
Dereferencing operator, non-const
version.
Definition at line 1025 of file tria_iterator.h.
|
inlineinherited |
In order be able to assign end-iterators for different accessors to each other, we need an access function which returns the accessor regardless of its state.
Definition at line 1007 of file tria_iterator.h.
|
inherited |
Compare for equality.
|
inherited |
Compare for inequality.
|
inlineinherited |
Ordering relation for iterators.
This relation attempts a total ordering of cells.
The relation is defined as follows:
For objects of Accessor::structure_dimension < Accessor::dimension
, we simply compare the index of such an object. The ordering is lexicographic according to the following hierarchy (in the sense, that the next test is only applied if the previous was inconclusive):
The past-the-end iterator is always ordered last. Two past-the-end iterators rank the same, thus false is returned in that case.
Definition at line 1042 of file tria_iterator.h.
|
inlineinherited |
Another comparison operator, implementing with the same ordering as operator<.
Definition at line 1067 of file tria_iterator.h.
|
inlineinherited |
Return the state of the iterator.
Definition at line 1034 of file tria_iterator.h.
|
inlineinherited |
Print the iterator to a stream out
. The format is level.index
.
Definition at line 1102 of file tria_iterator.h.
|
inlineinherited |
Determine an estimate for the memory consumption (in bytes) of this object.
Definition at line 1114 of file tria_iterator.h.
|
protectedinherited |
Object holding the real data.
Definition at line 546 of file tria_iterator.h.