Reworked Populations Loggers.
Added Save and Load Option for Population Data.
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "particle.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -34,6 +36,22 @@ std::string get_species_string(const species &spec) {
|
||||
return (res);
|
||||
}
|
||||
|
||||
species get_species_from_string(const std::string &species_string) {
|
||||
std::vector<species> all;
|
||||
all.push_back(electron);
|
||||
all.push_back(tritiumI);
|
||||
all.push_back(tritium2I);
|
||||
all.push_back(tritium2);
|
||||
for (std::vector<species>::iterator Itr = all.begin(); Itr!= all.end(); Itr++) {
|
||||
if (get_species_string(*Itr) == species_string) {
|
||||
return (*Itr);
|
||||
}
|
||||
}
|
||||
stringstream ss;
|
||||
ss<<"get_species_from_string: Species not defined\n";
|
||||
throw MyException(ss.str());
|
||||
}
|
||||
|
||||
double get_species_mass(const species &spec) {
|
||||
double res;
|
||||
switch (spec) {
|
||||
@@ -57,6 +75,7 @@ double get_species_mass(const species &spec) {
|
||||
return (res);
|
||||
}
|
||||
|
||||
|
||||
ostream& operator<<(ostream& os, const species& spec) {
|
||||
os<<get_species_string(spec);
|
||||
return (os);
|
||||
|
||||
Reference in New Issue
Block a user