Reworked Logging class.

Added Populations for individual Species.
This commit is contained in:
Christian
2019-05-06 13:14:03 +02:00
parent 67f6dcb633
commit 2f764c4812
17 changed files with 385 additions and 547 deletions
+50
View File
@@ -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 */