#define NDEBUG #include #include #include #include #include "grid.h" #include "m3d.h" //------------------read---------------------------------------------- void read_sites(std::string site_file, std::vector& sites) { std::ifstream site_stream(site_file.c_str()); unsigned int n_sites=0; site_stream >> n_sites; assert(n_sites>0); sites.clear(); sites.resize(n_sites); for (unsigned int i=0; i> site_id >> xyz(0) // x-coordinate value >> xyz(1) // y-coordinate value >> xyz(2); // z-coordinate value sites[i]= xyz; } return; } //------------------write---------------------------------------------- void write_vector(std::string name, std::vector& sites, std::vector& v) { // Open the of stream std::ofstream out(name.c_str()); if(!out.good()) { std::cerr<<"Can not open file:\t"<& sites, std::vector& v) { // Open the of stream std::ofstream out(name.c_str()); if(!out.good()) { std::cerr<<"Can not open file:\t"<& sites, std::vector & TBx, std::vector & TBy, std::vector & TBz) { // Open the of stream std::ofstream out(name.c_str()); if(!out.good()) { std::cerr<<"Can not open file:\t"< sites(61*61); for (int i = 0; i < 61; i++) { for (int j = 0; j < 61; j++) { sites[i*61 + j](0) = -30 + j; sites[i*61 + j](1) = -30 + i; sites[i*61 + j](2) = 10; } } //read_sites(site_file, sites); //write_vector("xyz.dat", sites); // loop each site and tet pair const int n_sites = sites.size(); std::vector Vs; std::vector Bs; std::vector Tx, Ty, Tz; Vs.resize(n_sites); Bs.resize(n_sites); Tx.resize(n_sites); Ty.resize(n_sites); Tz.resize(n_sites); // closed-form solutions #pragma omp parallel for for(int i=0; i