void read_temperature(VectorScalar &T0, VectorScalar &Tz, const std::string &file) { T0.clear(); Tz.clear(); std::string line; std::ifstream temp(file); getline(temp,line); while(!temp.eof()) { Scalar t,tz,dt,dtz; temp >> t >> tz >> dt >> dtz; T0.push_back(t); Tz.push_back(tz); } temp.close(); return; }
void read_crossSection(VectorScalar & lambda, VectorScalar & sigma, const std::string &file, unsigned int nbr) { lambda.clear(); sigma.clear(); std::string line; std::ifstream sig_f(file); getline(sig_f,line); while(!sig_f.eof()) { Scalar wv,sigt,sigbr; sig_f >> wv >> sigt; for(unsigned int i = 0; i < nbr; i++)sig_f >> sigbr; lambda.push_back(wv/10.);//A -> nm sigma.push_back(sigt*10.);//cm-2/A -> m-2/nm } sig_f.close(); return; }