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

Iterator class for CdrLayout. This allows iteration through solvers (or subsets of solvers). More...

#include <CD_CdrIterator.H>

Public Types

enum class  SpeciesIteration {
  All , Charged , Negative , Positive ,
  Neutral
}
 Enum class for iterating through subsets of species.
 

Public Member Functions

 CdrIterator ()=delete
 Disallowed weak construction. Always use the full constructor.
 
 CdrIterator (CdrLayout< T > &a_layout, const SpeciesIteration a_mode=SpeciesIteration::All)
 Full constructor. More...
 
virtual ~CdrIterator ()
 Destructor (does nothing).
 
virtual int getNumberOfSolvers ()
 Get number of solvers.
 
virtual int index () const
 Get current solver number (i.e. index in CdrLayouts solvers).
 
virtual void reset ()
 Reset iterator.
 
virtual bool ok () const
 Ok or not.
 
virtual void operator++ ()
 Increment. This is different for different iteration modes.
 
virtual RefCountedPtr< T > & operator() ()
 Return the current solver.
 
virtual RefCountedPtr< CdrSpecies > & getSpecies ()
 Return the current species.
 

Protected Attributes

SpeciesIteration m_mode
 Which species to iterate over.
 
int m_isolver
 
int m_numSolvers
 Number of solvers.
 
bool m_isDefined
 Defined or not.
 
Vector< RefCountedPtr< T > > m_solvers
 Cdr solvers.
 
Vector< RefCountedPtr< CdrSpecies > > m_species
 Cdr species.
 

Detailed Description

template<class T>
class CdrIterator< T >

Iterator class for CdrLayout. This allows iteration through solvers (or subsets of solvers).

Forward declare iterator.

CdrLayout is a class for holding sets of CdrSolvers on a realm and a phase. In the simplest case it is used as a container for keeping track of a single set of CdrSolvers, and it greatly cuts down on typing. This class allows iteration through one such layout. The user can specify to only iterate through subsets of CdrSolvers, e.g. only for charged species or neutral species, etc.

See also
CD_CdrIterator.H

Constructor & Destructor Documentation

◆ CdrIterator()

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

Full constructor.

Parameters
[in]a_layoutCdrLayout to iterate through.
[in]a_modeIteration mode.

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