Reference documentation for deal.II version 9.5.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\}}\)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
Particles::ParticleIterator< dim, spacedim > Class Template Reference

#include <deal.II/particles/particle_iterator.h>

Public Types

using particle_container = typename ParticleAccessor< dim, spacedim >::particle_container
 
using iterator_category = std::bidirectional_iterator_tag
 
using value_type = ParticleAccessor< dim, spacedim >
 
using difference_type = std::ptrdiff_t
 
using pointer = ParticleAccessor< dim, spacedim > *
 
using reference = ParticleAccessor< dim, spacedim > &
 

Public Member Functions

 ParticleIterator ()=default
 
 ParticleIterator (const typename particle_container::iterator particles_in_cell, const PropertyPool< dim, spacedim > &property_pool, const unsigned int particle_index_within_cell)
 
const ParticleAccessor< dim, spacedim > & operator* () const
 
ParticleAccessor< dim, spacedim > & operator* ()
 
const ParticleAccessor< dim, spacedim > * operator-> () const
 
ParticleAccessor< dim, spacedim > * operator-> ()
 
bool operator== (const ParticleIterator< dim, spacedim > &) const
 
bool operator!= (const ParticleIterator< dim, spacedim > &) const
 
ParticleIteratoroperator++ ()
 
ParticleIterator operator++ (int)
 
ParticleIteratoroperator-- ()
 
ParticleIterator operator-- (int)
 
IteratorState::IteratorStates state () const
 

Private Attributes

ParticleAccessor< dim, spacedim > accessor
 

Detailed Description

template<int dim, int spacedim = dim>
class Particles::ParticleIterator< dim, spacedim >

A class that is used to iterate over particles. Together with the ParticleAccessor class this is used to hide the internal implementation of the particle class and the particle container.

Definition at line 39 of file particle_iterator.h.

Member Typedef Documentation

◆ particle_container

template<int dim, int spacedim = dim>
using Particles::ParticleIterator< dim, spacedim >::particle_container = typename ParticleAccessor<dim, spacedim>::particle_container

A type for the storage container for particles.

Definition at line 45 of file particle_iterator.h.

◆ iterator_category

template<int dim, int spacedim = dim>
using Particles::ParticleIterator< dim, spacedim >::iterator_category = std::bidirectional_iterator_tag

Mark the class as bidirectional iterator and 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 146 of file particle_iterator.h.

◆ value_type

template<int dim, int spacedim = dim>
using Particles::ParticleIterator< dim, spacedim >::value_type = ParticleAccessor<dim, spacedim>

Definition at line 147 of file particle_iterator.h.

◆ difference_type

template<int dim, int spacedim = dim>
using Particles::ParticleIterator< dim, spacedim >::difference_type = std::ptrdiff_t

Definition at line 148 of file particle_iterator.h.

◆ pointer

template<int dim, int spacedim = dim>
using Particles::ParticleIterator< dim, spacedim >::pointer = ParticleAccessor<dim, spacedim> *

Definition at line 149 of file particle_iterator.h.

◆ reference

template<int dim, int spacedim = dim>
using Particles::ParticleIterator< dim, spacedim >::reference = ParticleAccessor<dim, spacedim> &

Definition at line 150 of file particle_iterator.h.

Constructor & Destructor Documentation

◆ ParticleIterator() [1/2]

template<int dim, int spacedim = dim>
Particles::ParticleIterator< dim, spacedim >::ParticleIterator ( )
default

Empty constructor. Such an object is not usable!

◆ ParticleIterator() [2/2]

template<int dim, int spacedim>
Particles::ParticleIterator< dim, spacedim >::ParticleIterator ( const typename particle_container::iterator  particles_in_cell,
const PropertyPool< dim, spacedim > &  property_pool,
const unsigned int  particle_index_within_cell 
)
inline

Constructor of the iterator. Takes a reference to the particle container, an iterator to the cell, and the particle index within that cell.

Definition at line 164 of file particle_iterator.h.

Member Function Documentation

◆ operator*() [1/2]

template<int dim, int spacedim>
const ParticleAccessor< dim, spacedim > & Particles::ParticleIterator< dim, spacedim >::operator*
inline

Dereferencing operator, returns a reference to an accessor. Usage is thus like (*i).get_id ();

Definition at line 193 of file particle_iterator.h.

◆ operator*() [2/2]

template<int dim, int spacedim>
ParticleAccessor< dim, spacedim > & Particles::ParticleIterator< dim, spacedim >::operator*
inline

Dereferencing operator, non-const version.

Definition at line 175 of file particle_iterator.h.

◆ operator->() [1/2]

template<int dim, int spacedim>
const ParticleAccessor< dim, spacedim > * Particles::ParticleIterator< dim, spacedim >::operator->
inline

Dereferencing operator, returns a pointer of the particle pointed to. Usage is thus like i->get_id ();

There is a const and a non-const version.

Definition at line 202 of file particle_iterator.h.

◆ operator->() [2/2]

template<int dim, int spacedim>
ParticleAccessor< dim, spacedim > * Particles::ParticleIterator< dim, spacedim >::operator->
inline

Dereferencing operator, non-const version.

Definition at line 184 of file particle_iterator.h.

◆ operator==()

template<int dim, int spacedim>
bool Particles::ParticleIterator< dim, spacedim >::operator== ( const ParticleIterator< dim, spacedim > &  other) const
inline

Compare for equality.

Definition at line 221 of file particle_iterator.h.

◆ operator!=()

template<int dim, int spacedim>
bool Particles::ParticleIterator< dim, spacedim >::operator!= ( const ParticleIterator< dim, spacedim > &  other) const
inline

Compare for inequality.

Definition at line 211 of file particle_iterator.h.

◆ operator++() [1/2]

template<int dim, int spacedim>
ParticleIterator< dim, spacedim > & Particles::ParticleIterator< dim, spacedim >::operator++
inline

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

Definition at line 231 of file particle_iterator.h.

◆ operator++() [2/2]

template<int dim, int spacedim>
ParticleIterator< dim, spacedim > Particles::ParticleIterator< dim, spacedim >::operator++ ( int  )
inline

Postfix ++ operator: iterator++. This operator advances the iterator to the next element, but returns an iterator to the element previously pointed to.

Definition at line 241 of file particle_iterator.h.

◆ operator--() [1/2]

template<int dim, int spacedim>
ParticleIterator< dim, spacedim > & Particles::ParticleIterator< dim, spacedim >::operator--
inline

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

Definition at line 253 of file particle_iterator.h.

◆ operator--() [2/2]

template<int dim, int spacedim>
ParticleIterator< dim, spacedim > Particles::ParticleIterator< dim, spacedim >::operator-- ( int  )
inline

Postfix -- operator: iterator--. This operator moves the iterator to the previous element, but returns an iterator to the element previously pointed to.

Definition at line 263 of file particle_iterator.h.

◆ state()

template<int dim, int spacedim>
IteratorState::IteratorStates Particles::ParticleIterator< dim, spacedim >::state
inline

Return the state of the iterator.

Definition at line 275 of file particle_iterator.h.

Member Data Documentation

◆ accessor

template<int dim, int spacedim = dim>
ParticleAccessor<dim, spacedim> Particles::ParticleIterator< dim, spacedim >::accessor
private

The accessor to the actual particle.

Definition at line 156 of file particle_iterator.h.


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