Reworked Logging class.
Added Populations for individual Species.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// find_species.h
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 03.05.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef find_species_h
|
||||
#define find_species_h
|
||||
|
||||
#include <vector>
|
||||
#include "particle.hpp"
|
||||
|
||||
|
||||
template <typename T>
|
||||
inline typename std::vector<T*>::iterator find_SpeciesItr(std::vector<T*> Vec, species Species) {
|
||||
typename std::vector<T*>::iterator Itr;
|
||||
if (Vec.size() == 0) {
|
||||
Itr = Vec.end();
|
||||
} else {
|
||||
Itr = Vec.begin();
|
||||
while (Itr != Vec.end() ) {
|
||||
if ((*Itr)->get_Species() == Species) {
|
||||
break;
|
||||
}
|
||||
Itr++;
|
||||
}
|
||||
}
|
||||
return (Itr);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline typename std::vector<T*>::const_iterator find_SpeciesConstItr(const std::vector<T*> Vec, species Species) {
|
||||
typename std::vector<T*>::const_iterator Itr;
|
||||
if (Vec.size() == 0) {
|
||||
Itr = Vec.end();
|
||||
} else {
|
||||
Itr = Vec.cbegin();
|
||||
while (Itr != Vec.cend() ) {
|
||||
if ( (*Itr)->get_Species() == Species) {
|
||||
break;
|
||||
}
|
||||
Itr++;
|
||||
}
|
||||
}
|
||||
return (Itr);
|
||||
}
|
||||
|
||||
#endif /* find_species_h */
|
||||
Reference in New Issue
Block a user