12 #ifndef CD_ItoIteratorImplem_H
13 #define CD_ItoIteratorImplem_H
20 #include <CD_NamespaceHeader.H>
25 CH_TIME(
"ItoIterator<T>::ItoIterator<T>");
29 m_numSolvers = m_solvers.size();
39 CH_TIME(
"ItoIterator<T>::~ItoIterator<T>");
46 CH_assert(m_isDefined);
55 CH_assert(m_isDefined);
64 CH_assert(m_isDefined);
73 return (m_isolver < m_numSolvers);
80 CH_assert(m_isDefined);
82 if (m_mode == SpeciesIteration::All) {
88 for (
int isolver = m_isolver; this->ok(); ++isolver) {
89 const RefCountedPtr<ItoSpecies>& species = m_species[isolver];
91 if (m_mode == SpeciesIteration::Charged) {
92 if (species->getChargeNumber() != 0) {
98 else if (m_mode == SpeciesIteration::Negative) {
99 if (species->getChargeNumber() < 0) {
105 else if (m_mode == SpeciesIteration::Positive) {
106 if (species->getChargeNumber() > 0) {
112 else if (m_mode == SpeciesIteration::Neutral) {
113 if (species->getChargeNumber() == 0) {
127 CH_assert(m_isDefined);
128 CH_assert(m_isolver < m_numSolvers);
130 return m_solvers[m_isolver];
134 RefCountedPtr<ItoSpecies>&
137 CH_assert(m_isDefined);
138 CH_assert(m_isolver < m_numSolvers);
140 return m_species[m_isolver];
143 #include <CD_NamespaceFooter.H>
Declaration of an iterator class for ItoLayout.
"Iterator" class for going through solvers in an ItoLayout.
Definition: CD_ItoIterator.H:24
virtual void operator++()
Increment. This is different for different iteration modes.
Definition: CD_ItoIteratorImplem.H:78
virtual bool ok()
Ok or not.
Definition: CD_ItoIteratorImplem.H:71
virtual RefCountedPtr< T > & operator()()
Get current solver.
Definition: CD_ItoIteratorImplem.H:125
virtual int index() const
Get current solver number.
Definition: CD_ItoIteratorImplem.H:53
virtual RefCountedPtr< ItoSpecies > & getSpecies()
Get current species.
Definition: CD_ItoIteratorImplem.H:135
virtual void reset()
Reset iterator to the first solver.
Definition: CD_ItoIteratorImplem.H:62
virtual int getNumberOfSolvers()
Get number of solvers.
Definition: CD_ItoIteratorImplem.H:44
ItoIterator()=delete
Disallowed constructor – use the full constructor.
SpeciesIteration
Enum which specifies which species to iterate through.
Definition: CD_ItoIterator.H:30
Class for holding a set of ItoSolvers.
Definition: CD_ItoLayout.H:30
virtual Vector< RefCountedPtr< ItoSpecies > > & getSpecies()
Get species.
Definition: CD_ItoLayoutImplem.H:335
virtual Vector< RefCountedPtr< T > > & getSolvers()
Get solvers all solvers.
Definition: CD_ItoLayoutImplem.H:328