Reworked Populations Loggers.
Added Save and Load Option for Population Data.
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// population_load_saver.hpp
|
||||
// mc_electron
|
||||
//
|
||||
// Created by Christian Reiling on 11.06.19.
|
||||
// Copyright © 2019 Christian Reiling. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef population_load_saver_hpp
|
||||
#define population_load_saver_hpp
|
||||
|
||||
#include "population_builder.hpp"
|
||||
|
||||
class Population_Load_Saver {
|
||||
std::vector <species> all_species;
|
||||
Population_Manager *populations;
|
||||
Timer *timer;
|
||||
|
||||
public:
|
||||
Population_Load_Saver() {};
|
||||
Population_Load_Saver(Population_Manager *populations, Timer *timer) {
|
||||
this->populations = populations;
|
||||
this->timer = timer;
|
||||
|
||||
all_species.push_back(electron);
|
||||
all_species.push_back(tritiumI);
|
||||
all_species.push_back(tritium2I);
|
||||
}
|
||||
|
||||
void save();
|
||||
private:
|
||||
std::string get_save_path();
|
||||
void write_overhead(std::ofstream *save_stream);
|
||||
void write_species(std::ofstream *save_stream, species this_species);
|
||||
|
||||
|
||||
public:
|
||||
void load();
|
||||
private:
|
||||
void goto_nextline(std::ifstream *load_stream);
|
||||
int get_num_populations_line(std::ifstream *load_stream);
|
||||
double get_offset_time_line(std::ifstream *load_stream);
|
||||
void check_katrin_geo_line(std::ifstream *load_stream);
|
||||
void check_katrin_T2_line(std::ifstream *load_stream);
|
||||
species get_species_line(std::ifstream *load_stream);
|
||||
void append_check_vector(std::vector<species> *check_vector, species add_species);
|
||||
void load_species(std::ifstream *load_stream, species add_species);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* population_load_saver_hpp */
|
||||
Reference in New Issue
Block a user