chombo-discharge
Public Types | Public Member Functions | Protected Attributes | List of all members
ItoIterator< T > Class Template Reference

"Iterator" class for going through solvers in an ItoLayout. More...

#include <CD_ItoIterator.H>

Public Types

enum class  SpeciesIteration {
  All , Charged , Negative , Positive ,
  Neutral
}
 Enum which specifies which species to iterate through.
 

Public Member Functions

 ItoIterator ()=delete
 Disallowed constructor – use the full constructor.
 
 ItoIterator (ItoLayout< T > &a_layout, const SpeciesIteration a_mode=SpeciesIteration::All)
 Full constructor. Allows iteration through all solvers in the layout and restriction to a specific subset of solvers. More...
 
virtual ~ItoIterator ()
 Destructor (does nothing)
 
virtual int getNumberOfSolvers ()
 Get number of solvers. More...
 
virtual int index () const
 Get current solver number. More...
 
virtual void reset ()
 Reset iterator to the first solver.
 
virtual bool ok ()
 Ok or not. More...
 
virtual void operator++ ()
 Increment. This is different for different iteration modes.
 
virtual RefCountedPtr< T > & operator() ()
 Get current solver.
 
virtual RefCountedPtr< ItoSpecies > & getSpecies ()
 Get current species.
 

Protected Attributes

SpeciesIteration m_mode
 Which species to iterate over.
 
int m_isolver
 Current solver pointed to by the iterator.
 
int m_numSolvers
 Number of solvers.
 
bool m_isDefined
 Defined or not.
 
Vector< RefCountedPtr< T > > m_solvers
 Solvers.
 
Vector< RefCountedPtr< ItoSpecies > > m_species
 Solver species.
 

Detailed Description

template<class T>
class ItoIterator< T >

"Iterator" class for going through solvers in an ItoLayout.

This class does not have any fundamental usefulness – it simply cuts down on typing if one wants to iterate over a full set or a subset of solvers in an ItoLayout.

Constructor & Destructor Documentation

◆ ItoIterator()

template<class T >
ItoIterator< T >::ItoIterator ( ItoLayout< T > &  a_layout,
const SpeciesIteration  a_mode = SpeciesIteration::All 
)

Full constructor. Allows iteration through all solvers in the layout and restriction to a specific subset of solvers.

Parameters
[in,out]a_layoutThe layout to iterate through
[in]a_iterationModeIteration mode, e.g. all solvers, only charged species etc.

Member Function Documentation

◆ getNumberOfSolvers()

template<class T >
int ItoIterator< T >::getNumberOfSolvers
virtual

Get number of solvers.

Returns
Returns total number of solvers (ignoring subsets)

◆ index()

template<class T >
int ItoIterator< T >::index
virtual

Get current solver number.

Returns
This returns the index in the ItoLayout solvers (which stores solvers as Vector<RefCountedPtr<ItoSolver> >

◆ ok()

template<class T >
bool ItoIterator< T >::ok
virtual

Ok or not.

Returns
Returns true if there is a next solver and false otherwise.

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