-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnalyseHoneycomb.cpp
42 lines (35 loc) · 1.2 KB
/
AnalyseHoneycomb.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "AnalyseHoneycomb.hpp"
AnalyseHoneycomb::AnalyseHoneycomb(std::string const& sim, unsigned int const& max_level, unsigned int const& bash_file):
Analyse(sim,max_level,bash_file,6)
{ do_analyse(); }
void AnalyseHoneycomb::open_files(){
if(level_>1){ jd_write_ = new IOFiles(sim_+path_+dir_.substr(0,dir_.size()-1)+".jdbin",true,false); }
if(level_ == 7){
data_write_ = new IOFiles(analyse_+path_+dir_.substr(0,dir_.size()-1)+".dat",true,false);
data_write_->precision(10);
}
}
void AnalyseHoneycomb::close_files(){
if(jd_write_){
if(level_==7){ list_rst_.last().figure(analyse_+path_+dir_.substr(0,dir_.size()-1)+".png","Honeycomb",RST::target(analyse_+path_+dir_.substr(0,dir_.size()-1)+".gp")+RST::width("1000")); }
list_rst_.last().text(jd_write_->get_header());
delete jd_write_;
jd_write_ = NULL;
}
if(data_write_){
delete data_write_;
data_write_ = NULL;
}
}
std::string AnalyseHoneycomb::extract_level_6(){
read_ = new IOFiles(sim_+path_+dir_+filename_+".jdbin",false,false);
Vector<double> tmp(*read_);
System s(*read_);
CreateSystem cs(&s);
cs.init(&tmp,NULL);
cs.set_IOSystem(this);
std::string link_name(cs.analyse(level_));
delete read_;
read_ = NULL;
return link_name;
}