@@ -109,18 +109,18 @@ static void read_force(
109109 }
110110 std::string atom_symbol (tokens[0 + species_offset]);
111111 structure.x [na] =
112- get_float_from_token (tokens[0 + pos_offset], xyz_filename.c_str (), line_number);
112+ get_double_from_token (tokens[0 + pos_offset], xyz_filename.c_str (), line_number);
113113 structure.y [na] =
114- get_float_from_token (tokens[1 + pos_offset], xyz_filename.c_str (), line_number);
114+ get_double_from_token (tokens[1 + pos_offset], xyz_filename.c_str (), line_number);
115115 structure.z [na] =
116- get_float_from_token (tokens[2 + pos_offset], xyz_filename.c_str (), line_number);
116+ get_double_from_token (tokens[2 + pos_offset], xyz_filename.c_str (), line_number);
117117 if (num_columns > 4 ) {
118118 structure.fx [na] =
119- get_float_from_token (tokens[0 + force_offset], xyz_filename.c_str (), line_number);
119+ get_double_from_token (tokens[0 + force_offset], xyz_filename.c_str (), line_number);
120120 structure.fy [na] =
121- get_float_from_token (tokens[1 + force_offset], xyz_filename.c_str (), line_number);
121+ get_double_from_token (tokens[1 + force_offset], xyz_filename.c_str (), line_number);
122122 structure.fz [na] =
123- get_float_from_token (tokens[2 + force_offset], xyz_filename.c_str (), line_number);
123+ get_double_from_token (tokens[2 + force_offset], xyz_filename.c_str (), line_number);
124124 }
125125
126126 bool is_allowed_element = false ;
@@ -160,7 +160,7 @@ static void read_one_structure(
160160 const std::string energy_string = " energy=" ;
161161 if (token.substr (0 , energy_string.length ()) == energy_string) {
162162 has_energy_in_exyz = true ;
163- structure.energy = get_float_from_token (
163+ structure.energy = get_double_from_token (
164164 token.substr (energy_string.length (), token.length ()), xyz_filename.c_str (), line_number);
165165 structure.energy /= structure.num_atom ;
166166 }
@@ -174,7 +174,7 @@ static void read_one_structure(
174174 const std::string temperature_string = " temperature=" ;
175175 if (token.substr (0 , temperature_string.length ()) == temperature_string) {
176176 structure.has_temperature = true ;
177- structure.temperature = get_float_from_token (
177+ structure.temperature = get_double_from_token (
178178 token.substr (temperature_string.length (), token.length ()),
179179 xyz_filename.c_str (),
180180 line_number);
@@ -191,7 +191,7 @@ static void read_one_structure(
191191 for (const auto & token : tokens) {
192192 const std::string weight_string = " weight=" ;
193193 if (token.substr (0 , weight_string.length ()) == weight_string) {
194- structure.weight = get_float_from_token (
194+ structure.weight = get_double_from_token (
195195 token.substr (weight_string.length (), token.length ()), xyz_filename.c_str (), line_number);
196196 if (structure.weight <= 0 .0f || structure.weight > 100 .0f ) {
197197 PRINT_INPUT_ERROR (" Configuration weight should > 0 and <= 100." );
@@ -206,7 +206,7 @@ static void read_one_structure(
206206 has_lattice_in_exyz = true ;
207207 const int transpose_index[9 ] = {0 , 3 , 6 , 1 , 4 , 7 , 2 , 5 , 8 };
208208 for (int m = 0 ; m < 9 ; ++m) {
209- structure.box_original [transpose_index[m]] = get_float_from_token (
209+ structure.box_original [transpose_index[m]] = get_double_from_token (
210210 tokens[n + m].substr (
211211 (m == 0 ) ? (lattice_string.length () + 1 ) : 0 ,
212212 (m == 8 ) ? (tokens[n + m].length () - 1 ) : tokens[n + m].length ()),
@@ -227,7 +227,7 @@ static void read_one_structure(
227227 structure.has_virial = true ;
228228 const int reduced_index[9 ] = {0 , 3 , 5 , 3 , 1 , 4 , 5 , 4 , 2 };
229229 for (int m = 0 ; m < 9 ; ++m) {
230- structure.virial [reduced_index[m]] = get_float_from_token (
230+ structure.virial [reduced_index[m]] = get_double_from_token (
231231 tokens[n + m].substr (
232232 (m == 0 ) ? (virial_string.length () + 1 ) : 0 ,
233233 (m == 8 ) ? (tokens[n + m].length () - 1 ) : tokens[n + m].length ()),
@@ -247,7 +247,7 @@ static void read_one_structure(
247247 float volume = abs (get_det (structure.box_original ));
248248 const int reduced_index[9 ] = {0 , 3 , 5 , 3 , 1 , 4 , 5 , 4 , 2 };
249249 for (int m = 0 ; m < 9 ; ++m) {
250- virials_from_stress[reduced_index[m]] = get_float_from_token (
250+ virials_from_stress[reduced_index[m]] = get_double_from_token (
251251 tokens[n + m].substr (
252252 (m == 0 ) ? (stress_string.length () + 1 ) : 0 ,
253253 (m == 8 ) ? (tokens[n + m].length () - 1 ) : tokens[n + m].length ()),
@@ -295,7 +295,7 @@ static void read_one_structure(
295295 structure.virial [m] = 0 .0f ;
296296 }
297297 for (int m = 0 ; m < 3 ; ++m) {
298- structure.virial [m] = get_float_from_token (
298+ structure.virial [m] = get_double_from_token (
299299 tokens[n + m].substr (
300300 (m == 0 ) ? (dipole_string.length () + 1 ) : 0 ,
301301 (m == 2 ) ? (tokens[n + m].length () - 1 ) : tokens[n + m].length ()),
@@ -325,7 +325,7 @@ static void read_one_structure(
325325 structure.has_virial = true ;
326326 const int reduced_index[9 ] = {0 , 3 , 5 , 3 , 1 , 4 , 5 , 4 , 2 };
327327 for (int m = 0 ; m < 9 ; ++m) {
328- structure.virial [reduced_index[m]] = get_float_from_token (
328+ structure.virial [reduced_index[m]] = get_double_from_token (
329329 tokens[n + m].substr (
330330 (m == 0 ) ? (pol_string.length () + 1 ) : 0 ,
331331 (m == 8 ) ? (tokens[n + m].length () - 1 ) : tokens[n + m].length ()),
0 commit comments