From e9e0bb71b6aec7979af452ae8c5ceb755c9f1b11 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 25 Apr 2021 21:30:51 -0400 Subject: [PATCH] Use varargs version of Error:all() and Error::one() where applicable --- src/BODY/fix_wall_body_polygon.cpp | 2 +- src/BODY/fix_wall_body_polyhedron.cpp | 2 +- src/BODY/pair_body_rounded_polygon.cpp | 4 +- src/BODY/pair_body_rounded_polyhedron.cpp | 8 +- src/COMPRESS/dump_atom_gz.cpp | 2 +- src/COMPRESS/dump_atom_zstd.cpp | 2 +- src/COMPRESS/dump_cfg_gz.cpp | 2 +- src/COMPRESS/dump_custom_gz.cpp | 2 +- src/COMPRESS/dump_custom_zstd.cpp | 2 +- src/COMPRESS/dump_local_gz.cpp | 2 +- src/COMPRESS/dump_local_zstd.cpp | 2 +- src/COMPRESS/dump_xyz_gz.cpp | 2 +- src/COMPRESS/dump_xyz_zstd.cpp | 2 +- src/KIM/kim_command.cpp | 2 +- src/KIM/kim_init.cpp | 16 +- src/KIM/kim_interactions.cpp | 12 +- src/KIM/kim_param.cpp | 4 +- src/KIM/kim_query.cpp | 8 +- src/KIM/pair_kim.cpp | 28 +-- src/KOKKOS/fix_shake_kokkos.cpp | 4 +- src/KOKKOS/pppm_kokkos.cpp | 2 +- src/KSPACE/pppm.cpp | 2 +- src/KSPACE/pppm_dipole.cpp | 4 +- src/KSPACE/pppm_dipole_spin.cpp | 4 +- src/KSPACE/pppm_disp.cpp | 4 +- src/MANYBODY/pair_airebo.cpp | 4 +- src/MANYBODY/pair_bop.cpp | 4 +- src/MANYBODY/pair_eam_cd.cpp | 4 +- src/MANYBODY/pair_eim.cpp | 2 +- src/MISC/fix_ttm.cpp | 8 +- src/MLIAP/mliap_descriptor_snap.cpp | 4 +- src/MLIAP/mliap_model.cpp | 12 +- src/MLIAP/mliap_model_nn.cpp | 8 +- src/MOLECULE/fix_cmap.cpp | 10 +- src/PYTHON/pair_python.cpp | 4 +- src/PYTHON/python_impl.cpp | 8 +- src/QEQ/fix_qeq.cpp | 4 +- src/QEQ/fix_qeq_point.cpp | 4 +- src/QEQ/fix_qeq_shielded.cpp | 4 +- src/QEQ/fix_qeq_slater.cpp | 4 +- src/RIGID/fix_rigid.cpp | 8 +- src/RIGID/fix_rigid_small.cpp | 12 +- src/RIGID/fix_shake.cpp | 12 +- src/SNAP/pair_snap.cpp | 24 +-- src/USER-BOCS/compute_pressure_bocs.cpp | 2 +- src/USER-BOCS/fix_bocs.cpp | 4 +- src/USER-COLVARS/group_ndx.cpp | 4 +- src/USER-COLVARS/ndx_group.cpp | 4 +- src/USER-DIFFRACTION/fix_saed_vtk.cpp | 8 +- src/USER-DPD/pair_exp6_rx.cpp | 4 +- src/USER-MANIFOLD/fix_manifoldforce.cpp | 8 +- src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp | 6 +- src/USER-MEAMC/pair_meamc.cpp | 22 +-- src/USER-MESONT/pair_mesocnt.cpp | 14 +- src/USER-MISC/dihedral_table.cpp | 18 +- src/USER-MISC/dihedral_table_cut.cpp | 14 +- src/USER-MISC/fix_orient_eco.cpp | 4 +- src/USER-MISC/fix_ttm_mod.cpp | 8 +- src/USER-NETCDF/dump_netcdf.cpp | 4 +- src/USER-NETCDF/dump_netcdf_mpiio.cpp | 4 +- src/USER-OMP/reaxc_init_md_omp.cpp | 20 +- src/USER-PACE/pair_pace.cpp | 6 +- src/USER-PHONON/fix_phonon.cpp | 8 +- src/USER-QUIP/pair_quip.cpp | 4 +- src/USER-REAXC/reaxc_init_md.cpp | 20 +- src/atom_vec.cpp | 6 +- src/balance.cpp | 9 +- src/bond.cpp | 8 +- src/create_bonds.cpp | 4 +- src/dump_movie.cpp | 4 +- src/fix.cpp | 3 +- src/fix_ave_chunk.cpp | 4 +- src/fix_ave_correlate.cpp | 4 +- src/fix_ave_histo.cpp | 4 +- src/fix_ave_time.cpp | 4 +- src/fix_enforce2d.cpp | 4 +- src/fix_print.cpp | 4 +- src/fix_property_atom.cpp | 12 +- src/fix_restrain.cpp | 32 +-- src/fix_tmd.cpp | 8 +- src/force.cpp | 4 +- src/group.cpp | 4 +- src/input.cpp | 28 +-- src/lammps.cpp | 32 +-- src/library.cpp | 14 +- src/memory.cpp | 12 +- src/modify.cpp | 10 +- src/molecule.cpp | 182 +++++++++--------- src/ntopo_angle_all.cpp | 4 +- src/ntopo_angle_partial.cpp | 4 +- src/ntopo_angle_template.cpp | 4 +- src/ntopo_bond_all.cpp | 4 +- src/ntopo_bond_partial.cpp | 4 +- src/ntopo_bond_template.cpp | 4 +- src/ntopo_dihedral_all.cpp | 4 +- src/ntopo_dihedral_partial.cpp | 4 +- src/ntopo_dihedral_template.cpp | 4 +- src/ntopo_improper_all.cpp | 4 +- src/ntopo_improper_partial.cpp | 4 +- src/ntopo_improper_template.cpp | 4 +- src/pair.cpp | 8 +- src/pair_hybrid.cpp | 4 +- src/pair_hybrid_scaled.cpp | 12 +- src/pair_table.cpp | 18 +- src/potential_file_reader.cpp | 8 +- src/procmap.cpp | 8 +- src/read_data.cpp | 10 +- src/read_restart.cpp | 12 +- src/reader.cpp | 4 +- src/reset_atom_ids.cpp | 4 +- src/thermo.cpp | 4 +- src/universe.cpp | 8 +- src/utils.cpp | 8 +- src/variable.cpp | 24 +-- src/write_coeff.cpp | 8 +- src/write_data.cpp | 4 +- src/write_restart.cpp | 8 +- 117 files changed, 522 insertions(+), 524 deletions(-) diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 027c0dbd5a..574138fc67 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -97,7 +97,7 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : lo = hi = 0.0; cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } else error->all(FLERR,fmt::format("Unknown wall style {}",arg[iarg])); + } else error->all(FLERR,"Unknown wall style {}",arg[iarg]); // check for trailing keyword/values diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index acfafaefbe..2958a715ac 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -99,7 +99,7 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; - } else error->all(FLERR,fmt::format("Unknown wall style {}",arg[iarg])); + } else error->all(FLERR,"Unknown wall style {}",arg[iarg]); // check for trailing keyword/values diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index fa8f7fed3e..7185dc2b54 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -570,8 +570,8 @@ void PairBodyRoundedPolygon::body2space(int i) } if ((body_num_edges > 0) && (edge_ends == nullptr)) - error->one(FLERR,fmt::format("Inconsistent edge data for body of atom {}", - atom->tag[i])); + error->one(FLERR,"Inconsistent edge data for body of atom {}", + atom->tag[i]); for (int m = 0; m < body_num_edges; m++) { edge[nedge][0] = static_cast(edge_ends[2*m+0]); diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index 3dbca5be7a..d9d1350329 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -557,8 +557,8 @@ void PairBodyRoundedPolyhedron::body2space(int i) } if ((body_num_edges > 0) && (edge_ends == nullptr)) - error->one(FLERR,fmt::format("Inconsistent edge data for body of atom {}", - atom->tag[i])); + error->one(FLERR,"Inconsistent edge data for body of atom {}", + atom->tag[i]); for (int m = 0; m < body_num_edges; m++) { edge[nedge][0] = static_cast(edge_ends[2*m+0]); @@ -584,8 +584,8 @@ void PairBodyRoundedPolyhedron::body2space(int i) } if ((body_num_faces > 0) && (face_pts == nullptr)) - error->one(FLERR,fmt::format("Inconsistent face data for body of atom {}", - atom->tag[i])); + error->one(FLERR,"Inconsistent face data for body of atom {}", + atom->tag[i]); for (int m = 0; m < body_num_faces; m++) { for (int k = 0; k < MAX_FACE_SIZE; k++) diff --git a/src/COMPRESS/dump_atom_gz.cpp b/src/COMPRESS/dump_atom_gz.cpp index 7b54fd8e62..73f1ddf5a2 100644 --- a/src/COMPRESS/dump_atom_gz.cpp +++ b/src/COMPRESS/dump_atom_gz.cpp @@ -194,7 +194,7 @@ int DumpAtomGZ::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_atom_zstd.cpp b/src/COMPRESS/dump_atom_zstd.cpp index b53ebb2269..430deda177 100644 --- a/src/COMPRESS/dump_atom_zstd.cpp +++ b/src/COMPRESS/dump_atom_zstd.cpp @@ -208,7 +208,7 @@ int DumpAtomZstd::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index c5942c1fc5..25328797dd 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -234,7 +234,7 @@ int DumpCFGGZ::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index 9a3fc39d0a..9ed5a10b02 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -194,7 +194,7 @@ int DumpCustomGZ::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_custom_zstd.cpp b/src/COMPRESS/dump_custom_zstd.cpp index b3f0971bf5..073e39a87e 100644 --- a/src/COMPRESS/dump_custom_zstd.cpp +++ b/src/COMPRESS/dump_custom_zstd.cpp @@ -213,7 +213,7 @@ int DumpCustomZstd::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_local_gz.cpp b/src/COMPRESS/dump_local_gz.cpp index 7ffb8d80ff..9c6c06e65a 100644 --- a/src/COMPRESS/dump_local_gz.cpp +++ b/src/COMPRESS/dump_local_gz.cpp @@ -194,7 +194,7 @@ int DumpLocalGZ::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_local_zstd.cpp b/src/COMPRESS/dump_local_zstd.cpp index 4d7fe9361b..f20dc5016c 100644 --- a/src/COMPRESS/dump_local_zstd.cpp +++ b/src/COMPRESS/dump_local_zstd.cpp @@ -211,7 +211,7 @@ int DumpLocalZstd::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index abd6e7fa78..1a51432d83 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -159,7 +159,7 @@ int DumpXYZGZ::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/COMPRESS/dump_xyz_zstd.cpp b/src/COMPRESS/dump_xyz_zstd.cpp index 74e482717b..8866dcfffb 100644 --- a/src/COMPRESS/dump_xyz_zstd.cpp +++ b/src/COMPRESS/dump_xyz_zstd.cpp @@ -176,7 +176,7 @@ int DumpXYZZstd::modify_param(int narg, char **arg) return 2; } } catch (FileWriterException &e) { - error->one(FLERR, fmt::format("Illegal dump_modify command: {}", e.what())); + error->one(FLERR,"Illegal dump_modify command: {}", e.what()); } } return consumed; diff --git a/src/KIM/kim_command.cpp b/src/KIM/kim_command.cpp index 88072d1fda..2de86556b3 100644 --- a/src/KIM/kim_command.cpp +++ b/src/KIM/kim_command.cpp @@ -131,5 +131,5 @@ void KimCommand::command(int narg, char **arg) KimQuery *cmd = new KimQuery(lmp); cmd->command(narg, arg); delete cmd; - } else error->all(FLERR, fmt::format("Unknown kim subcommand {}", subcmd)); + } else error->all(FLERR,"Unknown kim subcommand {}", subcmd); } diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index 2703ce24e0..f22335b411 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -93,10 +93,10 @@ void KimInit::command(int narg, char **arg) auto arg_str = std::string(arg[2]); if (arg_str == "unit_conversion_mode") unit_conversion_mode = true; else { - error->all(FLERR, fmt::format("Illegal 'kim init' command.\nThe argument " + error->all(FLERR, "Illegal 'kim init' command.\nThe argument " "followed by unit_style {} is an optional " "argument and when is used must " - "be unit_conversion_mode", user_units)); + "be unit_conversion_mode", user_units); } } else unit_conversion_mode = false; @@ -159,8 +159,8 @@ void get_kim_unit_names( } else if ((system_str == "lj") || (system_str == "micro") || (system_str == "nano")) { - error->all(FLERR, fmt::format("LAMMPS unit_style {} not supported " - "by KIM models", system_str)); + error->all(FLERR, "LAMMPS unit_style {} not supported " + "by KIM models", system_str); } else { error->all(FLERR, "Unknown unit_style"); } @@ -279,8 +279,8 @@ void KimInit::determine_model_type_and_units(char * model_name, const std::string model_units_str(*model_units); const std::string user_units_str(user_units); if ((!unit_conversion_mode) && (model_units_str != user_units_str)) { - error->all(FLERR, fmt::format("Incompatible units for KIM Simulator Model" - ", required units = {}", model_units_str)); + error->all(FLERR, "Incompatible units for KIM Simulator Model" + ", required units = {}", model_units_str); } } } @@ -475,9 +475,9 @@ void KimInit::do_variables(const std::string &from, const std::string &to) ier = lammps_unit_conversion(units[i], from, to, conversion_factor); if (ier != 0) - error->all(FLERR, fmt::format("Unable to obtain conversion factor: " + error->all(FLERR, "Unable to obtain conversion factor: " "unit = {}; from = {}; to = {}", - units[i], from, to)); + units[i], from, to); variable->internal_set(v_unit, conversion_factor); input->write_echo(fmt::format("variable {:<15s} internal {:<15.12e}\n", diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index f12c1774d2..d1afd92a1f 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -102,11 +102,11 @@ void KimInteractions::do_setup(int narg, char **arg) if ((narg == 1) && (arg_str == "fixed_types")) { fixed_types = true; } else if (narg != atom->ntypes) { - error->all(FLERR, fmt::format("Illegal 'kim interactions' command.\nThe " + error->all(FLERR, "Illegal 'kim interactions' command.\nThe " "LAMMPS simulation has {} atom type(s), but " "{} chemical species passed to the " "'kim interactions' command", - atom->ntypes, narg)); + atom->ntypes, narg); } else { fixed_types = false; } @@ -164,8 +164,8 @@ void KimInteractions::do_setup(int narg, char **arg) if (atom_type_sym == sim_species) species_is_supported = true; } if (!species_is_supported) { - error->all(FLERR, fmt::format("Species '{}' is not supported by this " - "KIM Simulator Model", atom_type_sym)); + error->all(FLERR, "Species '{}' is not supported by this " + "KIM Simulator Model", atom_type_sym); } } } else { @@ -275,8 +275,8 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con const std::string key = words[1]; if (key != "pair" && key != "charge") - error->one(FLERR, fmt::format("Unrecognized KEY {} for " - "KIM_SET_TYPE_PARAMETERS command", key)); + error->one(FLERR, "Unrecognized KEY {} for " + "KIM_SET_TYPE_PARAMETERS command", key); std::string filename = words[2]; std::vector species(words.begin() + 3, words.end()); diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index b7e3f4148e..8d3921f30c 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -124,8 +124,8 @@ void get_kim_unit_names( } else if ((system_str == "lj") || (system_str == "micro") || (system_str == "nano")) { - error->all(FLERR, fmt::format("LAMMPS unit_style {} not supported " - "by KIM models", system_str)); + error->all(FLERR, "LAMMPS unit_style {} not supported " + "by KIM models", system_str); } else { error->all(FLERR, "Unknown unit_style"); } diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index 74b0179302..05381b8fab 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -126,20 +126,20 @@ void KimQuery::command(int narg, char **arg) std::string query_function(arg[1]); if (query_function == "split" || query_function == "list" || query_function == "index") - error->all(FLERR, fmt::format("Illegal 'kim query' command.\nThe '{}' " + error->all(FLERR, "Illegal 'kim query' command.\nThe '{}' " "keyword can not be used after '{}'", - query_function, format_arg)); + query_function, format_arg); std::string model_name; // check the query_args format (a series of keyword=value pairs) for (int i = 2; i < narg; ++i) { if (!utils::strmatch(arg[i], "[=][\\[].*[\\]]")) - error->all(FLERR, fmt::format("Illegal query format.\nInput argument " + error->all(FLERR, "Illegal query format.\nInput argument " "of `{}` to 'kim query' is wrong. The " "query format is the keyword=[value], " "where value is always an array of one or " - "more comma-separated items", arg[i])); + "more comma-separated items", arg[i]); } if (query_function != "get_available_models") { diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index cf6374ab2d..aafc83aeaf 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -434,8 +434,8 @@ void PairKIM::coeff(int narg, char **arg) if (supported) { kim_particle_codes[i] = code; } else { - error->all(FLERR,fmt::format("GetSpeciesSupportAndCode: symbol not " - "found: {}",lmps_unique_elements[i])); + error->all(FLERR,"GetSpeciesSupportAndCode: symbol not " + "found: {}",lmps_unique_elements[i]); } } // Set the new values for PM parameters @@ -478,9 +478,9 @@ void PairKIM::coeff(int narg, char **arg) } if (param_index >= numberOfParameters) - error->all(FLERR,fmt::format("Wrong argument for pair coefficients.\n" + error->all(FLERR,"Wrong argument for pair coefficients.\n" "This Model does not have the requested " - "'{}' parameter", paramname)); + "'{}' parameter", paramname); // Get the index_range for the requested parameter int nlbound(0); @@ -491,9 +491,9 @@ void PairKIM::coeff(int narg, char **arg) // Check to see if the indices range contains only integer numbers & : if (argtostr.find_first_not_of("0123456789:") != std::string::npos) - error->all(FLERR,fmt::format("Illegal index_range.\nExpected integer" + error->all(FLERR,"Illegal index_range.\nExpected integer" " parameter(s) instead of '{}' in " - "index_range", argtostr)); + "index_range", argtostr); std::string::size_type npos = argtostr.find(':'); if (npos != std::string::npos) { @@ -504,16 +504,16 @@ void PairKIM::coeff(int narg, char **arg) if (nubound < 1 || nubound > extent || nlbound < 1 || nlbound > nubound) - error->all(FLERR,fmt::format("Illegal index_range '{}-{}' for '{}' " + error->all(FLERR,"Illegal index_range '{}-{}' for '{}' " "parameter with the extent of '{}'", - nlbound, nubound, paramname, extent)); + nlbound, nubound, paramname, extent); } else { nlbound = atoi(argtostr.c_str()); if (nlbound < 1 || nlbound > extent) - error->all(FLERR,fmt::format("Illegal index '{}' for '{}' parameter " + error->all(FLERR,"Illegal index '{}' for '{}' parameter " "with the extent of '{}'", nlbound, - paramname, extent)); + paramname, extent); nubound = nlbound; } @@ -543,10 +543,10 @@ void PairKIM::coeff(int narg, char **arg) } else error->all(FLERR,"Wrong parameter type to update"); } else { - error->all(FLERR,fmt::format("Wrong number of variable values for pair " + error->all(FLERR,"Wrong number of variable values for pair " "coefficients.\n'{}' values are requested " "for '{}' parameter", nubound - nlbound + 1, - paramname)); + paramname); } } @@ -1052,8 +1052,8 @@ void PairKIM::set_lmps_flags() } else if ((unit_style_str == "lj") || (unit_style_str == "micro") || (unit_style_str == "nano")) { - error->all(FLERR,fmt::format("LAMMPS unit_style {} not supported " - "by KIM models", unit_style_str)); + error->all(FLERR,"LAMMPS unit_style {} not supported " + "by KIM models", unit_style_str); } else { error->all(FLERR,"Unknown unit_style"); } diff --git a/src/KOKKOS/fix_shake_kokkos.cpp b/src/KOKKOS/fix_shake_kokkos.cpp index 253c7ee7e0..fced6297f6 100644 --- a/src/KOKKOS/fix_shake_kokkos.cpp +++ b/src/KOKKOS/fix_shake_kokkos.cpp @@ -285,8 +285,8 @@ void FixShakeKokkos::pre_neighbor() nlist = h_nlist(); if (h_error_flag() == 1) { - error->one(FLERR,fmt::format("Shake atoms missing on proc " - "{} at step {}",me,update->ntimestep)); + error->one(FLERR,"Shake atoms missing on proc " + "{} at step {}",me,update->ntimestep); } } diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index 9dc2416dcc..e5bc3fa74b 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -199,7 +199,7 @@ void PPPMKokkos::init() } if (order < 2 || order > MAXORDER) - error->all(FLERR,fmt::format("PPPM order cannot be < 2 or > {}",MAXORDER)); + error->all(FLERR,"PPPM order cannot be < 2 or > {}",MAXORDER); // compute two charge force diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 2419627642..3a96731be4 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -216,7 +216,7 @@ void PPPM::init() } if (order < 2 || order > MAXORDER) - error->all(FLERR,fmt::format("PPPM order cannot be < 2 or > {}",MAXORDER)); + error->all(FLERR,"PPPM order cannot be < 2 or > {}",MAXORDER); // compute two charge force diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index 44c3862b2f..8078c24f90 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -136,8 +136,8 @@ void PPPMDipole::init() } if (order < 2 || order > MAXORDER) - error->all(FLERR,fmt::format("PPPMDipole order cannot be < 2 or > {}", - MAXORDER)); + error->all(FLERR,"PPPMDipole order cannot be < 2 or > {}", + MAXORDER); // compute two charge force diff --git a/src/KSPACE/pppm_dipole_spin.cpp b/src/KSPACE/pppm_dipole_spin.cpp index 9b3d15fc76..daaacc6bd4 100644 --- a/src/KSPACE/pppm_dipole_spin.cpp +++ b/src/KSPACE/pppm_dipole_spin.cpp @@ -121,8 +121,8 @@ void PPPMDipoleSpin::init() } if (order < 2 || order > MAXORDER) - error->all(FLERR,fmt::format("PPPMDipoleSpin order cannot be < 2 or > {}", - MAXORDER)); + error->all(FLERR,"PPPMDipoleSpin order cannot be < 2 or > {}", + MAXORDER); // compute two charge force diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index 1844301ac5..eba653e7d7 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -278,8 +278,8 @@ void PPPMDisp::init() } if (order > MAXORDER || order_6 > MAXORDER) - error->all(FLERR,fmt::format("PPPMDisp coulomb or dispersion order cannot" - " be greater than {}",MAXORDER)); + error->all(FLERR,"PPPMDisp coulomb or dispersion order cannot" + " be greater than {}",MAXORDER); // compute two charge force diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 7d94ef7cec..058a769b14 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -3379,7 +3379,7 @@ void PairAIREBO::read_file(char *filename) break; default: - error->one(FLERR, fmt::format("Unknown REBO style variant {}",variant)); + error->one(FLERR,"Unknown REBO style variant {}",variant); } PotentialFileReader reader(lmp, filename, potential_name); @@ -3391,7 +3391,7 @@ void PairAIREBO::read_file(char *filename) char * line = reader.next_line(); if (std::string(line).find(header) == std::string::npos) { - error->one(FLERR, fmt::format("Potential file does not match AIREBO/REBO style variant: {}: {}", header, line)); + error->one(FLERR,"Potential file does not match AIREBO/REBO style variant: {}: {}", header, line); } // skip remaining comments diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp index a8f64853bc..0802191c9f 100644 --- a/src/MANYBODY/pair_bop.cpp +++ b/src/MANYBODY/pair_bop.cpp @@ -685,8 +685,8 @@ void PairBOP::init_style() // check that user sets comm->cutghostuser to 3x the max BOP cutoff if (comm->cutghostuser < 3.0*cutmax - EPSILON) - error->all(FLERR,fmt::format("Pair style bop requires comm ghost cutoff " - "at least 3x larger than {}",cutmax)); + error->all(FLERR,"Pair style bop requires comm ghost cutoff " + "at least 3x larger than {}",cutmax); // need a full neighbor list and neighbors of ghosts diff --git a/src/MANYBODY/pair_eam_cd.cpp b/src/MANYBODY/pair_eam_cd.cpp index b56166424c..da4d2b2c65 100644 --- a/src/MANYBODY/pair_eam_cd.cpp +++ b/src/MANYBODY/pair_eam_cd.cpp @@ -506,8 +506,8 @@ void PairEAMCD::read_h_coeff(char *filename) int convert_flag = unit_convert_flag; fptr = utils::open_potential(filename, lmp, &convert_flag); if (fptr == nullptr) - error->one(FLERR,fmt::format("Cannot open EAMCD potential file {}", - filename)); + error->one(FLERR,"Cannot open EAMCD potential file {}", + filename); // h coefficients are stored at the end of the file. // Skip to last line of file. diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index eda1838a5a..a868ac2fc0 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -1013,7 +1013,7 @@ EIMPotentialFileReader::EIMPotentialFileReader(LAMMPS *lmp, conversion_factor = utils::get_conversion_factor(utils::ENERGY,unit_convert); if (fp == nullptr) { - error->one(FLERR, fmt::format("cannot open eim potential file {}", filename)); + error->one(FLERR,"cannot open eim potential file {}", filename); } parse(fp); diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index da71d736c2..87832bd0f9 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -75,8 +75,8 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : if (comm->me == 0) { fp = fopen(arg[15],"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open output file {}: {}", - arg[15], utils::getsyserror())); + error->one(FLERR,"Cannot open output file {}: {}", + arg[15], utils::getsyserror()); } } @@ -331,8 +331,8 @@ void FixTTM::read_initial_electron_temperatures(const char *filename) std::string name = utils::get_potential_file_path(filename); if (name.empty()) - error->one(FLERR,fmt::format("Cannot open input file: {}", - filename)); + error->one(FLERR,"Cannot open input file: {}", + filename); FILE *fpr = fopen(name.c_str(),"r"); // read initial electron temperature values from file diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 5c73cb64df..098d9ccbba 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -379,8 +379,8 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) if (comm->me == 0) { fpparam = utils::open_potential(paramfilename,lmp,nullptr); if (fpparam == nullptr) - error->one(FLERR,fmt::format("Cannot open SNAP parameter file {}: {}", - paramfilename, utils::getsyserror())); + error->one(FLERR,"Cannot open SNAP parameter file {}: {}", + paramfilename, utils::getsyserror()); } char line[MAXLINE],*ptr; diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index f993aeb725..214ac3358c 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -98,8 +98,8 @@ void MLIAPModelSimple::read_coeffs(char *coefffilename) if (comm->me == 0) { fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); if (fpcoeff == nullptr) - error->one(FLERR,fmt::format("Cannot open MLIAPModel coeff file {}: {}", - coefffilename,utils::getsyserror())); + error->one(FLERR,"Cannot open MLIAPModel coeff file {}: {}", + coefffilename,utils::getsyserror()); } char line[MAXLINE],*ptr; @@ -136,8 +136,8 @@ void MLIAPModelSimple::read_coeffs(char *coefffilename) nelements = coeffs.next_int(); nparams = coeffs.next_int(); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Incorrect format in MLIAPModel coefficient " - "file: {}",e.what())); + error->all(FLERR,"Incorrect format in MLIAPModel coefficient " + "file: {}",e.what()); } // set up coeff lists @@ -168,8 +168,8 @@ void MLIAPModelSimple::read_coeffs(char *coefffilename) throw TokenizerException("Wrong number of items",""); coeffelem[ielem][icoeff] = coeffs.next_double(); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Incorrect format in MLIAPModel " - "coefficient file: {}",e.what())); + error->all(FLERR,"Incorrect format in MLIAPModel " + "coefficient file: {}",e.what()); } } } diff --git a/src/MLIAP/mliap_model_nn.cpp b/src/MLIAP/mliap_model_nn.cpp index 3805a5761b..fcc62c3059 100644 --- a/src/MLIAP/mliap_model_nn.cpp +++ b/src/MLIAP/mliap_model_nn.cpp @@ -73,8 +73,8 @@ void MLIAPModelNN::read_coeffs(char *coefffilename) if (comm->me == 0) { fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); if (fpcoeff == nullptr) - error->one(FLERR,fmt::format("Cannot open MLIAPModel coeff file {}: {}", - coefffilename,utils::getsyserror())); + error->one(FLERR,"Cannot open MLIAPModel coeff file {}: {}", + coefffilename,utils::getsyserror()); } char line[MAXLINE], *ptr, *tstr; @@ -111,8 +111,8 @@ void MLIAPModelNN::read_coeffs(char *coefffilename) nelements = coeffs.next_int(); nparams = coeffs.next_int(); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Incorrect format in MLIAPModel coefficient " - "file: {}",e.what())); + error->all(FLERR,"Incorrect format in MLIAPModel coefficient " + "file: {}",e.what()); } // set up coeff lists diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index 1b58037eb7..9400da3389 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -260,11 +260,11 @@ void FixCMAP::pre_neighbor() if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1 || atom5 == -1) - error->one(FLERR,fmt::format("CMAP atoms {} {} {} {} {} missing on " + error->one(FLERR,"CMAP atoms {} {} {} {} {} missing on " "proc {} at step {}", crossterm_atom1[i][m],crossterm_atom2[i][m], crossterm_atom3[i][m],crossterm_atom4[i][m], - crossterm_atom5[i][m],me,update->ntimestep)); + crossterm_atom5[i][m],me,update->ntimestep); atom1 = domain->closest_image(i,atom1); atom2 = domain->closest_image(i,atom2); atom3 = domain->closest_image(i,atom3); @@ -640,8 +640,8 @@ void FixCMAP::read_grid_map(char *cmapfile) if (comm->me == 0) { fp = utils::open_potential(cmapfile,lmp,nullptr); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix cmap file {}: {}", - cmapfile, utils::getsyserror())); + error->one(FLERR,"Cannot open fix cmap file {}: {}", + cmapfile, utils::getsyserror()); } @@ -1071,7 +1071,7 @@ void FixCMAP::read_data_section(char *keyword, int n, char *buf, *next = '\n'; if (nwords != 7) - error->all(FLERR,fmt::format("Incorrect {} format in data file",keyword)); + error->all(FLERR,"Incorrect {} format in data file",keyword); // loop over lines of CMAP crossterms // tokenize the line into values diff --git a/src/PYTHON/pair_python.cpp b/src/PYTHON/pair_python.cpp index 5020119e0d..adf7e2bb49 100644 --- a/src/PYTHON/pair_python.cpp +++ b/src/PYTHON/pair_python.cpp @@ -382,11 +382,11 @@ void * PairPython::get_member_function(const char * name) PyObject * py_mfunc = PyObject_GetAttrString(py_pair_instance, name); if (!py_mfunc) { PyUtils::Print_Errors(); - error->all(FLERR, fmt::format("Could not find '{}' method'", name)); + error->all(FLERR,"Could not find '{}' method'", name); } if (!PyCallable_Check(py_mfunc)) { PyUtils::Print_Errors(); - error->all(FLERR, fmt::format("Python '{}' is not callable", name)); + error->all(FLERR,"Python '{}' is not callable", name); } return py_mfunc; } diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index c84d04b4b7..e2484f62f7 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -263,14 +263,14 @@ void PythonImpl::command(int narg, char **arg) if (!pFunc) { PyUtils::Print_Errors(); - error->all(FLERR,fmt::format("Could not find Python function {}", - pfuncs[ifunc].name)); + error->all(FLERR,"Could not find Python function {}", + pfuncs[ifunc].name); } if (!PyCallable_Check(pFunc)) { PyUtils::Print_Errors(); - error->all(FLERR,fmt::format("Python function {} is not callable", - pfuncs[ifunc].name)); + error->all(FLERR,"Python function {} is not callable", + pfuncs[ifunc].name); } pfuncs[ifunc].pFunc = (void *) pFunc; diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index e592ed2af4..fe6948c6a0 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -707,8 +707,8 @@ void FixQEq::read_file(char *file) if (comm->me == 0) { fp = utils::open_potential(file,lmp,nullptr); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix qeq parameter file {}: {}", - file,utils::getsyserror())); + error->one(FLERR,"Cannot open fix qeq parameter file {}: {}", + file,utils::getsyserror()); } // read each line out of file, skipping blank lines or leading '#' diff --git a/src/QEQ/fix_qeq_point.cpp b/src/QEQ/fix_qeq_point.cpp index ac31f906e0..9cea930de9 100644 --- a/src/QEQ/fix_qeq_point.cpp +++ b/src/QEQ/fix_qeq_point.cpp @@ -161,8 +161,8 @@ void FixQEqPoint::compute_H() } if (m_fill >= H.m) - error->all(FLERR,fmt::format("Fix qeq/point has insufficient H matrix " - "size: m_fill={} H.m={}\n",m_fill, H.m)); + error->all(FLERR,"Fix qeq/point has insufficient H matrix " + "size: m_fill={} H.m={}\n",m_fill, H.m); } /* ---------------------------------------------------------------------- */ diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index ad6202abd8..3c1cfb2919 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -226,8 +226,8 @@ void FixQEqShielded::compute_H() } if (m_fill >= H.m) - error->all(FLERR,fmt::format("Fix qeq/shielded has insufficient H matrix " - "size: m_fill={} H.m={}\n",m_fill,H.m)); + error->all(FLERR,"Fix qeq/shielded has insufficient H matrix " + "size: m_fill={} H.m={}\n",m_fill,H.m); } /* ---------------------------------------------------------------------- */ diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 326d71c93b..73f7cdf879 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -209,8 +209,8 @@ void FixQEqSlater::compute_H() } if (m_fill >= H.m) - error->all(FLERR,fmt::format(FLERR,"Fix qeq/slater has insufficient H " - "matrix size:m_fill={} H.m={}\n",m_fill,H.m)); + error->all(FLERR,FLERR,"Fix qeq/slater has insufficient H " + "matrix size:m_fill={} H.m={}\n",m_fill,H.m); } /* ---------------------------------------------------------------------- */ diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 91cb0ce82c..582d4ed3f5 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -2280,8 +2280,8 @@ void FixRigid::readfile(int which, double *vec, if (me == 0) { fp = fopen(inpfile,"r"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix rigid file {}: {}", - inpfile,utils::getsyserror())); + error->one(FLERR,"Cannot open fix rigid file {}: {}", + inpfile,utils::getsyserror()); while (1) { eof = fgets(line,MAXLINE,fp); if (eof == nullptr) error->one(FLERR,"Unexpected end of fix rigid file"); @@ -2389,8 +2389,8 @@ void FixRigid::write_restart_file(const char *file) auto outfile = std::string(file) + ".rigid"; FILE *fp = fopen(outfile.c_str(),"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", - outfile,utils::getsyserror())); + error->one(FLERR,"Cannot open fix rigid restart file {}: {}", + outfile,utils::getsyserror()); fmt::print(fp,"# fix rigid mass, COM, inertia tensor info for " "{} bodies on timestep {}\n\n",nbody,update->ntimestep); diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index c1c956f08e..8f2e855cea 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -2453,8 +2453,8 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) if (me == 0) { fp = fopen(inpfile,"r"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix rigid/small file {}: {}", - inpfile,utils::getsyserror())); + error->one(FLERR,"Cannot open fix rigid/small file {}: {}", + inpfile,utils::getsyserror()); while (1) { eof = fgets(line,MAXLINE,fp); if (eof == nullptr) @@ -2567,8 +2567,8 @@ void FixRigidSmall::write_restart_file(const char *file) auto outfile = std::string(file) + ".rigid"; fp = fopen(outfile.c_str(),"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", - outfile,utils::getsyserror())); + error->one(FLERR,"Cannot open fix rigid restart file {}: {}", + outfile,utils::getsyserror()); fmt::print(fp,"# fix rigid mass, COM, inertia tensor info for " "{} bodies on timestep {}\n\n",nbody,update->ntimestep); @@ -3311,9 +3311,9 @@ void FixRigidSmall::reset_atom2body() if (bodytag[i]) { iowner = atom->map(bodytag[i]); if (iowner == -1) - error->one(FLERR,fmt::format("Rigid body atoms {} {} missing on " + error->one(FLERR,"Rigid body atoms {} {} missing on " "proc {} at step {}",atom->tag[i], - bodytag[i],comm->me,update->ntimestep)); + bodytag[i],comm->me,update->ntimestep); atom2body[i] = bodyown[iowner]; } diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 957898d361..f8c6b661b4 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -524,19 +524,19 @@ void FixShake::pre_neighbor() atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); if (atom1 == -1 || atom2 == -1) - error->one(FLERR,fmt::format("Shake atoms {} {} missing on proc " + error->one(FLERR,"Shake atoms {} {} missing on proc " "{} at step {}",shake_atom[i][0], - shake_atom[i][1],me,update->ntimestep)); + shake_atom[i][1],me,update->ntimestep); if (i <= atom1 && i <= atom2) list[nlist++] = i; } else if (shake_flag[i] % 2 == 1) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); atom3 = atom->map(shake_atom[i][2]); if (atom1 == -1 || atom2 == -1 || atom3 == -1) - error->one(FLERR,fmt::format("Shake atoms {} {} {} missing on proc " + error->one(FLERR,"Shake atoms {} {} {} missing on proc " "{} at step {}",shake_atom[i][0], shake_atom[i][1],shake_atom[i][2], - me,update->ntimestep)); + me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i; } else { atom1 = atom->map(shake_atom[i][0]); @@ -544,10 +544,10 @@ void FixShake::pre_neighbor() atom3 = atom->map(shake_atom[i][2]); atom4 = atom->map(shake_atom[i][3]); if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) - error->one(FLERR,fmt::format("Shake atoms {} {} {} {} missing on " + error->one(FLERR,"Shake atoms {} {} {} {} missing on " "proc {} at step {}",shake_atom[i][0], shake_atom[i][1],shake_atom[i][2], - shake_atom[i][3],me,update->ntimestep)); + shake_atom[i][3],me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4) list[nlist++] = i; } diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index b4ee3c870a..b307da4947 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -456,8 +456,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) if (comm->me == 0) { fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); if (fpcoeff == nullptr) - error->one(FLERR,fmt::format("Cannot open SNAP coefficient file {}: ", - coefffilename, utils::getsyserror())); + error->one(FLERR,"Cannot open SNAP coefficient file {}: ", + coefffilename, utils::getsyserror()); } char line[MAXLINE],*ptr; @@ -490,8 +490,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) nelemtmp = words.next_int(); ncoeffall = words.next_int(); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Incorrect format in SNAP coefficient " - "file: {}", e.what())); + error->all(FLERR,"Incorrect format in SNAP coefficient " + "file: {}", e.what()); } // clean out old arrays and set up element lists @@ -589,8 +589,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) coeffelem[jelem][icoeff] = coeff.next_double(); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Incorrect format in SNAP coefficient " - "file: {}", e.what())); + error->all(FLERR,"Incorrect format in SNAP coefficient " + "file: {}", e.what()); } } } @@ -599,8 +599,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) for (int jelem = 0; jelem < nelements; jelem++) { if (elementflags[jelem] == 0) - error->all(FLERR,fmt::format("Element {} not found in SNAP coefficient " - "file", elements[jelem])); + error->all(FLERR,"Element {} not found in SNAP coefficient " + "file", elements[jelem]); } // set flags for required keywords @@ -626,8 +626,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) if (comm->me == 0) { fpparam = utils::open_potential(paramfilename,lmp,nullptr); if (fpparam == nullptr) - error->one(FLERR,fmt::format("Cannot open SNAP parameter file {}: {}", - paramfilename, utils::getsyserror())); + error->one(FLERR,"Cannot open SNAP parameter file {}: {}", + paramfilename, utils::getsyserror()); } eof = 0; @@ -687,8 +687,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) else if (keywd == "chunksize") chunksize = utils::inumeric(FLERR,keyval.c_str(),false,lmp); else - error->all(FLERR,fmt::format("Unknown parameter '{}' in SNAP " - "parameter file", keywd)); + error->all(FLERR,"Unknown parameter '{}' in SNAP " + "parameter file", keywd); } if (rcutfacflag == 0 || twojmaxflag == 0) diff --git a/src/USER-BOCS/compute_pressure_bocs.cpp b/src/USER-BOCS/compute_pressure_bocs.cpp index 43cf7efb8f..49c644be71 100644 --- a/src/USER-BOCS/compute_pressure_bocs.cpp +++ b/src/USER-BOCS/compute_pressure_bocs.cpp @@ -215,7 +215,7 @@ double ComputePressureBocs::find_index(double * grid, double value) if (value >= grid[i] && value <= (grid[i] + spacing)) { return i; } - error->all(FLERR, fmt::format("find_index could not find value in grid for value: {}", value)); + error->all(FLERR,"find_index could not find value in grid for value: {}", value); for (int i = 0; i < gridsize; ++i) { fprintf(stderr, "grid %d: %f\n",i,grid[i]); diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index bd217e60a8..20c2a9dfe8 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -725,7 +725,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type ) } } else { - error->all(FLERR,fmt::format("ERROR: Unable to open file: {}", filename)); + error->all(FLERR,"ERROR: Unable to open file: {}", filename); } if (badInput && comm->me == 0) { @@ -744,7 +744,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type ) } else { - error->all(FLERR,fmt::format("ERROR: invalid p_basis_type value of {} in read_F_table", p_basis_type)); + error->all(FLERR,"ERROR: invalid p_basis_type value of {} in read_F_table", p_basis_type); } memory->destroy(data); diff --git a/src/USER-COLVARS/group_ndx.cpp b/src/USER-COLVARS/group_ndx.cpp index 26711026e8..48d4157fc9 100644 --- a/src/USER-COLVARS/group_ndx.cpp +++ b/src/USER-COLVARS/group_ndx.cpp @@ -56,8 +56,8 @@ void Group2Ndx::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open index file for writing: {}", - utils::getsyserror())); + error->one(FLERR,"Cannot open index file for writing: {}", + utils::getsyserror()); utils::logmesg(lmp,"Writing groups to index file {}:\n",arg[0]); } diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index 6b9a69ccd3..452bd681b1 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -86,8 +86,8 @@ void Ndx2Group::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "r"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open index file for reading: {}", - utils::getsyserror())); + error->one(FLERR,"Cannot open index file for reading: {}", + utils::getsyserror()); utils::logmesg(lmp,"Reading groups from index file {}:\n",arg[0]); } diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 90eedb1127..39c0ddc9d1 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -390,8 +390,8 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) fp = fopen(nName.c_str(),"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix saed/vtk file {}: {}", - nName,utils::getsyserror())); + error->one(FLERR,"Cannot open fix saed/vtk file {}: {}", + nName,utils::getsyserror()); } fprintf(fp,"# vtk DataFile Version 3.0 c_%s\n",ids); @@ -512,8 +512,8 @@ void FixSAEDVTK::options(int narg, char **arg) fp = fopen(nName.c_str(),"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix saed/vtk file {}: {}", - nName,utils::getsyserror())); + error->one(FLERR,"Cannot open fix saed/vtk file {}: {}", + nName,utils::getsyserror()); } iarg += 2; } else if (strcmp(arg[iarg],"ave") == 0) { diff --git a/src/USER-DPD/pair_exp6_rx.cpp b/src/USER-DPD/pair_exp6_rx.cpp index 396047fca9..37013bcf48 100644 --- a/src/USER-DPD/pair_exp6_rx.cpp +++ b/src/USER-DPD/pair_exp6_rx.cpp @@ -832,8 +832,8 @@ void PairExp6rx::read_file2(char *file) if (comm->me == 0) { fp = fopen(file,"r"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open polynomial file {}: {}", - file,utils::getsyserror())); + error->one(FLERR,"Cannot open polynomial file {}: {}", + file,utils::getsyserror()); } // one set of params can span multiple lines diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index b48decddba..a5cc75f567 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -59,15 +59,15 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : // Construct manifold from factory: if (!ptr_m) - error->all(FLERR,fmt::format("Manifold pointer for manifold '{}' " - "was NULL for some reason", arg[3])); + error->all(FLERR,"Manifold pointer for manifold '{}' " + "was NULL for some reason", arg[3]); // After constructing the manifold, you can safely make // room for the parameters nvars = ptr_m->nparams(); if (narg < nvars+4) - error->all(FLERR,fmt::format("Manifold {} needs at least {} " - "argument(s)!", m_name, nvars)); + error->all(FLERR,"Manifold {} needs at least {} " + "argument(s)!", m_name, nvars); ptr_m->params = new double[nvars]; if (ptr_m->params == nullptr) { diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 4b141a3bd1..1e86fff77d 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -105,8 +105,8 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, // Check if you have enough args: if (6 + nvars > narg) - error->all(FLERR,fmt::format("Not enough args for manifold {}, {} expected " - "but got {}\n",ptr_m->id(),nvars, narg - 6)); + error->all(FLERR,"Not enough args for manifold {}, {} expected " + "but got {}\n",ptr_m->id(),nvars, narg - 6); // Loop over manifold args: for (int i = 0; i < nvars; ++i) { int len = 0, offset = 0; @@ -145,7 +145,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, } argi += 2; } else if (error_on_unknown_keyword) { - error->all(FLERR,fmt::format("Error parsing arg \"{}\".\n",arg[argi])); + error->all(FLERR,"Error parsing arg \"{}\".\n",arg[argi]); } else { argi += 1; } diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 67ab3522ad..f8a7713d77 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -143,7 +143,7 @@ void PairMEAMC::compute(int eflag, int vflag) meam_inst->meam_dens_final(nlocal,eflag_either,eflag_global,eflag_atom, &eng_vdwl,eatom,ntype,type,map,scale,errorflag); if (errorflag) - error->one(FLERR,fmt::format("MEAM library error {}",errorflag)); + error->one(FLERR,"MEAM library error {}",errorflag); comm->forward_comm_pair(this); @@ -213,7 +213,7 @@ void PairMEAMC::coeff(int narg, char **arg) std::string lib_file = utils::get_potential_file_path(arg[2]); if (lib_file.empty()) - error->all(FLERR,fmt::format("Cannot open MEAM library file {}",lib_file)); + error->all(FLERR,"Cannot open MEAM library file {}",lib_file); // find meam parameter file in arguments: // first word that is a file or "NULL" after the MEAM library file @@ -249,9 +249,9 @@ void PairMEAMC::coeff(int narg, char **arg) nlibelements = paridx - 3; if (nlibelements < 1) error->all(FLERR,"Incorrect args for pair coefficients"); if (nlibelements > maxelt) - error->all(FLERR,fmt::format("Too many elements extracted from MEAM " + error->all(FLERR,"Too many elements extracted from MEAM " "library (current limit: {}). Increase " - "'maxelt' in meam.h and recompile.", maxelt)); + "'maxelt' in meam.h and recompile.", maxelt); for (int i = 0; i < nlibelements; i++) { libelements.push_back(arg[i+3]); @@ -413,8 +413,8 @@ void PairMEAMC::read_global_meamc_file(const std::string &globalfile) std::string lattice_type = values.next_string(); if (!MEAM::str_to_lat(lattice_type.c_str(), true, lat[index])) - error->one(FLERR,fmt::format("Unrecognized lattice type in MEAM " - "library file: {}", lattice_type)); + error->one(FLERR,"Unrecognized lattice type in MEAM " + "library file: {}", lattice_type); // store parameters @@ -541,8 +541,8 @@ void PairMEAMC::read_user_meamc_file(const std::string &userfile) for (which = 0; which < nkeywords; which++) if (keyword == keywords[which]) break; if (which == nkeywords) - error->all(FLERR,fmt::format("Keyword {} in MEAM parameter file not " - "recognized", keyword)); + error->all(FLERR,"Keyword {} in MEAM parameter file not " + "recognized", keyword); nindex = nparams - 2; for (int i = 0; i < nindex; i++) index[i] = values.next_int() - 1; @@ -552,8 +552,8 @@ void PairMEAMC::read_user_meamc_file(const std::string &userfile) std::string lattice_type = values.next_string(); lattice_t latt; if (!MEAM::str_to_lat(lattice_type, false, latt)) - error->all(FLERR, fmt::format("Unrecognized lattice type in MEAM " - "parameter file: {}", lattice_type)); + error->all(FLERR, "Unrecognized lattice type in MEAM " + "parameter file: {}", lattice_type); value = latt; } else value = values.next_double(); @@ -568,7 +568,7 @@ void PairMEAMC::read_user_meamc_file(const std::string &userfile) "expected more indices", "has out of range element index"}; if ((errorflag < 0) || (errorflag > 3)) errorflag = 0; - error->all(FLERR, fmt::format("Error in MEAM parameter file: keyword {} {}", keyword, descr[errorflag])); + error->all(FLERR,"Error in MEAM parameter file: keyword {} {}", keyword, descr[errorflag]); } } } diff --git a/src/USER-MESONT/pair_mesocnt.cpp b/src/USER-MESONT/pair_mesocnt.cpp index f460e3aebb..3a56c69d2d 100644 --- a/src/USER-MESONT/pair_mesocnt.cpp +++ b/src/USER-MESONT/pair_mesocnt.cpp @@ -758,7 +758,7 @@ void PairMesoCNT::read_file() fp = utils::open_potential(file,lmp,nullptr); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open mesocnt file: {}",file)); + error->one(FLERR,"Cannot open mesocnt file: {}",file); utils::sfgets(FLERR,line,MAXLINE,fp,file,error); @@ -768,14 +768,14 @@ void PairMesoCNT::read_file() num = sscanf(line,"%d %d %d %d", &uinf_points,&gamma_points,&phi_points,&usemi_points); if (num != 4) - error->one(FLERR,fmt::format("Could not correctly parse line 2 in " - "mesocnt file: {}",file)); + error->one(FLERR,"Could not correctly parse line 2 in " + "mesocnt file: {}",file); utils::sfgets(FLERR,line,MAXLINE,fp,file,error); num = sscanf(line,"%lg %lg %lg %lg",&r_ang,&sig_ang,&delta1,&delta2); if (num != 4) - error->one(FLERR,fmt::format("Could not correctly parse line 3 in " - "mesocnt file: {}",file)); + error->one(FLERR,"Could not correctly parse line 3 in " + "mesocnt file: {}",file); } MPI_Bcast(&uinf_points,1,MPI_INT,0,world); @@ -844,7 +844,7 @@ void PairMesoCNT::read_data(FILE *fp, double *data, for (int i = 0; i < ninput; i++) { if (nullptr == fgets(line,MAXLINE,fp)) - error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); + error->one(FLERR,"Premature end of file in pair table: {}",file); if (i > 0) xtemp = x; if (2 != sscanf(line,"%lg %lg",&x,&data[i])) cerror++; @@ -897,7 +897,7 @@ void PairMesoCNT::read_data(FILE *fp, double **data, if (i > 0) xtemp = x; for (int j = 0; j < ninput; j++) { if (nullptr == fgets(line,MAXLINE,fp)) - error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); + error->one(FLERR,"Premature end of file in pair table: {}",file); if (j > 0) ytemp = y; if (3 != sscanf(line,"%lg %lg %lg",&x,&y,&data[i][j])) cerror++; diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index ffbc9aad31..8ea5c7e21e 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -784,10 +784,10 @@ void DihedralTable::coeff(int narg, char **arg) // --- and resolve issues with periodicity --- if (tb->ninput < 2) - error->all(FLERR,fmt::format("Invalid dihedral table length: {}",arg[2])); + error->all(FLERR,"Invalid dihedral table length: {}",arg[2]); else if ((tb->ninput == 2) && (tabstyle == SPLINE)) - error->all(FLERR,fmt::format("Invalid dihedral spline table length: {} " - "(Try linear)",arg[2])); + error->all(FLERR,"Invalid dihedral spline table length: {} " + "(Try linear)",arg[2]); // check for monotonicity for (int i=0; i < tb->ninput-1; i++) { @@ -805,12 +805,12 @@ void DihedralTable::coeff(int narg, char **arg) double phihi = tb->phifile[tb->ninput-1]; if (tb->use_degrees) { if ((phihi - philo) >= 360) - error->all(FLERR,fmt::format("Dihedral table angle range must be < 360 " - "degrees ({}).",arg[2])); + error->all(FLERR,"Dihedral table angle range must be < 360 " + "degrees ({}).",arg[2]); } else { if ((phihi - philo) >= MY_2PI) - error->all(FLERR,fmt::format("Dihedral table angle range must be < 2*PI " - "radians ({}).",arg[2])); + error->all(FLERR,"Dihedral table angle range must be < 2*PI " + "radians ({}).",arg[2]); } // convert phi from degrees to radians @@ -1268,8 +1268,8 @@ void DihedralTable::param_extract(Table *tb, char *line) //else if (word == "EQ") { // tb->theta0 = values.next_double(); //} - else error->one(FLERR,fmt::format("Invalid keyword in dihedral angle " - "table parameters ({})", word)); + else error->one(FLERR,"Invalid keyword in dihedral angle " + "table parameters ({})", word); } } catch (TokenizerException &e) { error->one(FLERR, e.what()); diff --git a/src/USER-MISC/dihedral_table_cut.cpp b/src/USER-MISC/dihedral_table_cut.cpp index 02e6d3e5da..bae402145d 100644 --- a/src/USER-MISC/dihedral_table_cut.cpp +++ b/src/USER-MISC/dihedral_table_cut.cpp @@ -508,10 +508,10 @@ void DihedralTableCut::coeff(int narg, char **arg) // --- and resolve issues with periodicity --- if (tb->ninput < 2) - error->all(FLERR,fmt::format("Invalid dihedral table length: {}",arg[5])); + error->all(FLERR,"Invalid dihedral table length: {}",arg[5]); else if ((tb->ninput == 2) && (tabstyle == SPLINE)) - error->all(FLERR,fmt::format("Invalid dihedral spline table length: {} " - "(Try linear)",arg[5])); + error->all(FLERR,"Invalid dihedral spline table length: {} " + "(Try linear)",arg[5]); // check for monotonicity for (int i=0; i < tb->ninput-1; i++) { @@ -529,12 +529,12 @@ void DihedralTableCut::coeff(int narg, char **arg) double phihi = tb->phifile[tb->ninput-1]; if (tb->use_degrees) { if ((phihi - philo) >= 360) - error->all(FLERR,fmt::format("Dihedral table angle range must be < 360 " - "degrees ({})",arg[5])); + error->all(FLERR,"Dihedral table angle range must be < 360 " + "degrees ({})",arg[5]); } else { if ((phihi - philo) >= MY_2PI) - error->all(FLERR,fmt::format("Dihedral table angle range must be < 2*PI " - "radians ({})",arg[5])); + error->all(FLERR,"Dihedral table angle range must be < 2*PI " + "radians ({})",arg[5]); } // convert phi from degrees to radians diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index b8b3a00354..e247d8601e 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -95,8 +95,8 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : FILE *infile = utils::open_potential(dir_filename,lmp,nullptr); if (infile == nullptr) - error->one(FLERR,fmt::format("Cannot open fix orient/eco file {}: {}", - dir_filename, utils::getsyserror())); + error->one(FLERR,"Cannot open fix orient/eco file {}: {}", + dir_filename, utils::getsyserror()); for (int i = 0; i < 6; ++i) { result = fgets(line, IMGMAX, infile); if (!result) error->one(FLERR, "Fix orient/eco file read failed"); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index d4023b6011..20f6853bf6 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -399,8 +399,8 @@ void FixTTMMod::read_parameters(const char *filename) char line[MAXLINE]; std::string name = utils::get_potential_file_path(filename); if (name.empty()) - error->one(FLERR,fmt::format("Cannot open input file: {}", - filename)); + error->one(FLERR,"Cannot open input file: {}", + filename); FILE *fpr = fopen(name.c_str(),"r"); // C0 (metal) @@ -550,8 +550,8 @@ void FixTTMMod::read_initial_electron_temperatures(const char *filename) std::string name = utils::get_potential_file_path(filename); if (name.empty()) - error->one(FLERR,fmt::format("Cannot open input file: {}", - filename)); + error->one(FLERR,"Cannot open input file: {}", + filename); FILE *fpr = fopen(name.c_str(),"r"); // read initial electron temperature values from file diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index 025fec3933..bdd79d0d05 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -288,8 +288,8 @@ void DumpNetCDF::openfile() // Fixme! Perform checks if dimensions and variables conform with // data structure standard. if (not utils::file_is_readable(filecurrent)) - error->all(FLERR, fmt::format("cannot append to non-existent file {}", - filecurrent)); + error->all(FLERR, "cannot append to non-existent file {}", + filecurrent); if (singlefile_opened) return; singlefile_opened = 1; diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.cpp b/src/USER-NETCDF/dump_netcdf_mpiio.cpp index 726b51ba3f..cd83d1cbff 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.cpp +++ b/src/USER-NETCDF/dump_netcdf_mpiio.cpp @@ -284,8 +284,8 @@ void DumpNetCDFMPIIO::openfile() // Fixme! Perform checks if dimensions and variables conform with // data structure standard. if (not utils::file_is_readable(filecurrent)) - error->all(FLERR, fmt::format("cannot append to non-existent file {}", - filecurrent)); + error->all(FLERR, "cannot append to non-existent file {}", + filecurrent); MPI_Offset index[NC_MAX_VAR_DIMS], count[NC_MAX_VAR_DIMS]; double d[1]; diff --git a/src/USER-OMP/reaxc_init_md_omp.cpp b/src/USER-OMP/reaxc_init_md_omp.cpp index 1312953180..7450470095 100644 --- a/src/USER-OMP/reaxc_init_md_omp.cpp +++ b/src/USER-OMP/reaxc_init_md_omp.cpp @@ -129,29 +129,29 @@ void InitializeOMP(reax_system *system, control_params *control, "Mpi_data could not be initialized! Terminating."); if (Init_System(system,control,msg) == FAILURE) - error->one(FLERR,fmt::format("Error on: {}. System could not be " - "initialized! Terminating.",msg)); + error->one(FLERR,"Error on: {}. System could not be " + "initialized! Terminating.",msg); if (Init_Simulation_Data(system,control,data,msg) == FAILURE) - error->one(FLERR,fmt::format("Error on: {}. Sim_data could not be " - "initialized! Terminating.",msg)); + error->one(FLERR,"Error on: {}. Sim_data could not be " + "initialized! Terminating.",msg); if (Init_Workspace(system,control,workspace,msg) == FAILURE) error->one(FLERR,"init_workspace: not enough memory. " "Workspace could not be initialized. Terminating."); if (Init_ListsOMP(system,control,data,workspace,lists,mpi_data,msg) == FAILURE) - error->one(FLERR,fmt::format("Error on: {}. System could not be " - "initialized. Terminating.",msg)); + error->one(FLERR,"Error on: {}. System could not be " + "initialized. Terminating.",msg); if (Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) - error->one(FLERR,fmt::format("Error on: {}. Could not open output files! " - "Terminating.",msg)); + error->one(FLERR,"Error on: {}. Could not open output files! " + "Terminating.",msg); if (control->tabulate) if (Init_Lookup_Tables(system,control,workspace,mpi_data,msg) == FAILURE) - error->one(FLERR,fmt::format("Error on: {}. Could not create lookup " - "table. Terminating.",msg)); + error->one(FLERR,"Error on: {}. Could not create lookup " + "table. Terminating.",msg); Init_Force_FunctionsOMP(control); } diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index ae13859968..d146cb91bd 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -156,7 +156,7 @@ void PairPACE::compute(int eflag, int vflag) { firstneigh = list->firstneigh; if (inum != nlocal) - error->all(FLERR,fmt::format("inum: {} nlocal: {} are different",inum, nlocal)); + error->all(FLERR,"inum: {} nlocal: {} are different",inum, nlocal); // Aidan Thompson told RD (26 July 2019) that practically always holds: // inum = nlocal @@ -329,7 +329,7 @@ void PairPACE::coeff(int narg, char **arg) { char *elemname = elemtypes[i - 1]; int atomic_number = AtomicNumberByName_pace(elemname); if (atomic_number == -1) - error->all(FLERR,fmt::format("'{}' is not a valid element\n", elemname)); + error->all(FLERR,"'{}' is not a valid element\n", elemname); SPECIES_TYPE mu = aceimpl->basis_set->get_species_index_by_name(elemname); if (mu != -1) { @@ -339,7 +339,7 @@ void PairPACE::coeff(int narg, char **arg) { map[i] = mu; aceimpl->ace->element_type_mapping(i) = mu; // set up LAMMPS atom type to ACE species mapping for ace evaluator } else { - error->all(FLERR, fmt::format("Element {} is not supported by ACE-potential from file {}", elemname,potential_file_name)); + error->all(FLERR,"Element {} is not supported by ACE-potential from file {}", elemname,potential_file_name); } } diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 222f3fa1d2..1f8fe1c9cb 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -180,8 +180,8 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (me == 0) { flog = fopen(logfile, "w"); if (flog == nullptr) - error->one(FLERR,fmt::format("Can not open output file {}: {}", - logfile,utils::getsyserror())); + error->one(FLERR,"Can not open output file {}: {}", + logfile,utils::getsyserror()); fprintf(flog,"############################################################\n"); fprintf(flog,"# group name of the atoms under study : %s\n", group->names[igroup]); fprintf(flog,"# total number of atoms in the group : %d\n", ngroup); @@ -555,8 +555,8 @@ void FixPhonon::readmap() char line[MAXLINE]; FILE *fp = fopen(mapfile, "r"); if (fp == nullptr) - error->all(FLERR,fmt::format("Cannot open input map file {}: {}", - mapfile, utils::getsyserror())); + error->all(FLERR,"Cannot open input map file {}: {}", + mapfile, utils::getsyserror()); if (fgets(line,MAXLINE,fp) == nullptr) error->all(FLERR,"Error while reading header of mapping file!"); diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 20a6c98cb8..365ab3b414 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -253,8 +253,8 @@ void PairQUIP::coeff(int narg, char **arg) int n = atom->ntypes; if (narg != (4+n)) - error->all(FLERR,fmt::format("Number of arguments {} is not correct, " - "it should be {}", narg, 4+n)); + error->all(FLERR,"Number of arguments {} is not correct, " + "it should be {}", narg, 4+n); // ensure I,J args are * * diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp index 9d10966d3b..7794a16ecd 100644 --- a/src/USER-REAXC/reaxc_init_md.cpp +++ b/src/USER-REAXC/reaxc_init_md.cpp @@ -231,29 +231,29 @@ void Initialize(reax_system *system, control_params *control, "Mpi_data could not be initialized! Terminating."); if (Init_System(system,control,msg) == FAILURE) - error->one(FLERR,fmt::format("Error on: {}. System could not be " - "initialized! Terminating.",msg)); + error->one(FLERR,"Error on: {}. System could not be " + "initialized! Terminating.",msg); if (Init_Simulation_Data( system,control,data,msg) == FAILURE) - error->one(FLERR,fmt::format("Error on: {}. Sim_data could not be " - "initialized! Terminating.",msg)); + error->one(FLERR,"Error on: {}. Sim_data could not be " + "initialized! Terminating.",msg); if (Init_Workspace( system,control,workspace,msg) == FAILURE) error->one(FLERR,"init_workspace: not enough memory. " "Workspace could not be initialized. Terminating."); if (Init_Lists(system, control, data, workspace, lists, mpi_data, msg) ==FAILURE) - error->one(FLERR,fmt::format("Error on: {}. System could not be " - "initialized. Terminating.",msg)); + error->one(FLERR,"Error on: {}. System could not be " + "initialized. Terminating.",msg); if (Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) - error->one(FLERR,fmt::format("Error on: {}. Could not open output files! " - "Terminating.",msg)); + error->one(FLERR,"Error on: {}. Could not open output files! " + "Terminating.",msg); if (control->tabulate) if (Init_Lookup_Tables(system,control,workspace,mpi_data,msg) == FAILURE) - error->one(FLERR,fmt::format("Error on: {}. Could not create lookup " - "table. Terminating.",msg)); + error->one(FLERR,"Error on: {}. Could not create lookup " + "table. Terminating.",msg); Init_Force_Functions(control); diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index eec09cf58a..9ae5a86039 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -2481,20 +2481,20 @@ int AtomVec::process_fields(char *str, const char *default_str, Method *method) for (match = 0; match < nperatom; match++) if (field == peratom[match].name) break; if (match == nperatom) - error->all(FLERR,fmt::format("Peratom field {} not recognized", field)); + error->all(FLERR,"Peratom field {} not recognized", field); index[i] = match; // error if field appears multiple times for (match = 0; match < i; match++) if (index[i] == index[match]) - error->all(FLERR,fmt::format("Peratom field {} is repeated", field)); + error->all(FLERR,"Peratom field {} is repeated", field); // error if field is in default str for (match = 0; match < ndef; match++) if (field == def_words[match]) - error->all(FLERR,fmt::format("Peratom field {} is a default", field)); + error->all(FLERR,"Peratom field {} is a default", field); } return nfield; diff --git a/src/balance.cpp b/src/balance.cpp index bf037e8f8f..8be98d4d19 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -371,9 +371,8 @@ void Balance::command(int narg, char **arg) bigint nblocal = atom->nlocal; MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); if (natoms != atom->natoms) - error->all(FLERR,fmt::format("Lost atoms via balance: " - "original {} current {}", - atom->natoms,natoms).c_str()); + error->all(FLERR,"Lost atoms via balance: original {} current {}", + atom->natoms,natoms); // imbfinal = final imbalance // set disable = 1, so weights no longer migrate with atoms @@ -478,8 +477,8 @@ void Balance::options(int iarg, int narg, char **arg) if (outflag && comm->me == 0) { fp = fopen(arg[outarg],"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open (fix) balance output file {}: {}", - arg[outarg], utils::getsyserror())); + error->one(FLERR,"Cannot open (fix) balance output file {}: {}", + arg[outarg], utils::getsyserror()); } } diff --git a/src/bond.cpp b/src/bond.cpp index 570d921abb..049d5da823 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -274,9 +274,9 @@ void Bond::write_file(int narg, char **arg) if (utils::file_is_readable(table_file)) { std::string units = utils::get_potential_units(table_file,"table"); if (!units.empty() && (units != update->unit_style)) { - error->one(FLERR,fmt::format("Trying to append to a table file " + error->one(FLERR,"Trying to append to a table file " "with UNITS: {} while units are {}", - units, update->unit_style)); + units, update->unit_style); } std::string date = utils::get_potential_date(table_file,"table"); utils::logmesg(lmp,"Appending to table file {} with " @@ -293,8 +293,8 @@ void Bond::write_file(int narg, char **arg) datebuf, update->unit_style); } if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open bond_write file {}: {}", - arg[4], utils::getsyserror())); + error->one(FLERR,"Cannot open bond_write file {}: {}", + arg[4], utils::getsyserror()); } // initialize potentials before evaluating bond potential diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index aba0178368..8598c1ca6e 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -298,8 +298,8 @@ void CreateBonds::many() if (!newton_bond || tag[i] < tag[j]) { if (num_bond[i] == atom->bond_per_atom) - error->one(FLERR,fmt::format("New bond exceeded bonds per atom limit " - " of {} in create_bonds",atom->bond_per_atom)); + error->one(FLERR,"New bond exceeded bonds per atom limit " + " of {} in create_bonds",atom->bond_per_atom); bond_type[i][num_bond[i]] = btype; bond_atom[i][num_bond[i]] = tag[j]; num_bond[i]++; diff --git a/src/dump_movie.cpp b/src/dump_movie.cpp index 828c20af30..c224b9d292 100644 --- a/src/dump_movie.cpp +++ b/src/dump_movie.cpp @@ -60,8 +60,8 @@ void DumpMovie::openfile() #endif if (fp == nullptr) - error->one(FLERR,fmt::format("Failed to open FFmpeg pipeline to " - "file {}",filename)); + error->one(FLERR,"Failed to open FFmpeg pipeline to " + "file {}",filename); } } /* ---------------------------------------------------------------------- */ diff --git a/src/fix.cpp b/src/fix.cpp index 14c04bf4b5..e3e2b12ed2 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -175,8 +175,7 @@ void Fix::modify_params(int narg, char **arg) void::Fix::set_molecule(int, tagint, int, double *, double *, double *) { - error->all(FLERR,fmt::format("Molecule update not implemented for " - "fix {}", style)); + error->all(FLERR,"Molecule update not implemented for fix {}", style); } /* ---------------------------------------------------------------------- diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index b0a99d332a..87f1bf8b4c 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -206,8 +206,8 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : if (comm->me == 0) { fp = fopen(arg[iarg+1],"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix ave/chunk file {}: {}", - arg[iarg+1], utils::getsyserror())); + error->one(FLERR,"Cannot open fix ave/chunk file {}: {}", + arg[iarg+1], utils::getsyserror()); } iarg += 2; } else if (strcmp(arg[iarg],"overwrite") == 0) { diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 81ca94cdc8..8793793682 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -129,8 +129,8 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): if (me == 0) { fp = fopen(arg[iarg+1],"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix ave/correlate file {}:"" {}", - arg[iarg+1], utils::getsyserror())); + error->one(FLERR,"Cannot open fix ave/correlate file {}:"" {}", + arg[iarg+1], utils::getsyserror()); } iarg += 2; } else if (strcmp(arg[iarg],"overwrite") == 0) { diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 0f6943ac31..7cacbda407 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -946,8 +946,8 @@ void FixAveHisto::options(int iarg, int narg, char **arg) if (me == 0) { fp = fopen(arg[iarg+1],"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix ave/histo file {}: {}", - arg[iarg+1], utils::getsyserror())); + error->one(FLERR,"Cannot open fix ave/histo file {}: {}", + arg[iarg+1], utils::getsyserror()); } iarg += 2; } else if (strcmp(arg[iarg],"kind") == 0) { diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 7ecb88ddab..2a6e769799 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -1029,8 +1029,8 @@ void FixAveTime::options(int iarg, int narg, char **arg) if (me == 0) { fp = fopen(arg[iarg+1],"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix ave/time file {}: {}", - arg[iarg+1], utils::getsyserror())); + error->one(FLERR,"Cannot open fix ave/time file {}: {}", + arg[iarg+1], utils::getsyserror()); } iarg += 2; } else if (strcmp(arg[iarg],"ave") == 0) { diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index 11e041fcf4..c27e523efe 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -77,8 +77,8 @@ void FixEnforce2D::init() if (myindex < 0) flist[nfixlist++] = modify->fix[i]; else - error->all(FLERR,fmt::format("Fix enforce2d must be defined after fix {}", - modify->fix[i]->style)); + error->all(FLERR,"Fix enforce2d must be defined after fix {}", + modify->fix[i]->style); } if (modify->fix[i] == this) myindex = i; } diff --git a/src/fix_print.cpp b/src/fix_print.cpp index c6747ee1ee..43bab3f848 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -62,8 +62,8 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix print file {}: {}", - arg[iarg+1], utils::getsyserror())); + error->one(FLERR,"Cannot open fix print file {}: {}", + arg[iarg+1], utils::getsyserror()); } iarg += 2; } else if (strcmp(arg[iarg],"screen") == 0) { diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 6ce5b6360b..82c15eea1b 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -228,13 +228,13 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, try { ValueTokenizer values(buf); if ((int)values.count() != nvalue+1) - error->all(FLERR,fmt::format("Incorrect format in {} section " - "of data file: {}",keyword,buf)); + error->all(FLERR,"Incorrect format in {} section " + "of data file: {}",keyword,buf); itag = values.next_tagint() + id_offset; if (itag <= 0 || itag > map_tag_max) - error->all(FLERR,fmt::format("Invalid atom ID {} in {} section of " - "data file",itag, keyword)); + error->all(FLERR,"Invalid atom ID {} in {} section of " + "data file",itag, keyword); // assign words in line to per-atom vectors @@ -254,8 +254,8 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, } } } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Invalid format in {} section of data " - "file '{}': {}",keyword, buf,e.what())); + error->all(FLERR,"Invalid format in {} section of data " + "file '{}': {}",keyword, buf,e.what()); } buf = next + 1; } diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index ff61703c1a..b7321dd530 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -272,15 +272,15 @@ void FixRestrain::restrain_bond(int m) if (newton_bond) { if (i2 == -1 || i2 >= nlocal) return; if (i1 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} missing on " "proc {} at step {}", ids[m][0],ids[m][1], - comm->me,update->ntimestep)); + comm->me,update->ntimestep); } else { if ((i1 == -1 || i1 >= nlocal) && (i2 == -1 || i2 >= nlocal)) return; if (i1 == -1 || i2 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} missing on " "proc {} at step {}", ids[m][0],ids[m][1], - comm->me,update->ntimestep)); + comm->me,update->ntimestep); } delx = x[i1][0] - x[i2][0]; @@ -345,15 +345,15 @@ void FixRestrain::restrain_lbound(int m) if (newton_bond) { if (i2 == -1 || i2 >= nlocal) return; if (i1 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} missing on " "proc {} at step {}",ids[m][0],ids[m][1], - comm->me,update->ntimestep)); + comm->me,update->ntimestep); } else { if ((i1 == -1 || i1 >= nlocal) && (i2 == -1 || i2 >= nlocal)) return; if (i1 == -1 || i2 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} missing on " "proc {} at step {}",ids[m][0],ids[m][1], - comm->me,update->ntimestep)); + comm->me,update->ntimestep); } delx = x[i1][0] - x[i2][0]; @@ -427,16 +427,16 @@ void FixRestrain::restrain_angle(int m) if (newton_bond) { if (i2 == -1 || i2 >= nlocal) return; if (i1 == -1 || i3 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} {} missing on " "proc {} at step {}",ids[m][0],ids[m][1], - ids[m][2],comm->me,update->ntimestep)); + ids[m][2],comm->me,update->ntimestep); } else { if ((i1 == -1 || i1 >= nlocal) && (i2 == -1 || i2 >= nlocal) && (i3 == -1 || i3 >= nlocal)) return; if (i1 == -1 || i2 == -1 || i3 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} {} missing on " "proc {} at step {}",ids[m][0],ids[m][1], - ids[m][2],comm->me,update->ntimestep)); + ids[m][2],comm->me,update->ntimestep); } // 1st bond @@ -547,18 +547,18 @@ void FixRestrain::restrain_dihedral(int m) if (newton_bond) { if (i2 == -1 || i2 >= nlocal) return; if (i1 == -1 || i3 == -1 || i4 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} {} {} missing on " "proc {} at step {}",ids[m][0],ids[m][1], ids[m][2],ids[m][3],comm->me, - update->ntimestep)); + update->ntimestep); } else { if ((i1 == -1 || i1 >= nlocal) && (i2 == -1 || i2 >= nlocal) && (i3 == -1 || i3 >= nlocal) && (i4 == -1 || i3 >= nlocal)) return; if (i1 == -1 || i2 == -1 || i3 == -1 || i4 == -1) - error->one(FLERR,fmt::format("Restrain atoms {} {} {} {} missing on " + error->one(FLERR,"Restrain atoms {} {} {} {} missing on " "proc {} at step {}",ids[m][0],ids[m][1], ids[m][2],ids[m][3],comm->me, - update->ntimestep)); + update->ntimestep); } // 1st bond diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index f462b0633b..ea76ca137b 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -74,8 +74,8 @@ nfileevery(0), fp(nullptr), xf(nullptr), xold(nullptr) if (me == 0) { fp = fopen(arg[6],"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open fix tmd file {}: {}", - arg[6], utils::getsyserror())); + error->one(FLERR,"Cannot open fix tmd file {}: {}", + arg[6], utils::getsyserror()); fprintf(fp,"%s %s\n","# Step rho_target rho_old gamma_back", "gamma_forward lambda work_lambda work_analytical"); } @@ -540,8 +540,8 @@ void FixTMD::open(char *file) } if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open file {}: {}", - file, utils::getsyserror())); + error->one(FLERR,"Cannot open file {}: {}", + file, utils::getsyserror()); } /* ---------------------------------------------------------------------- */ diff --git a/src/force.cpp b/src/force.cpp index 80f5ef22a7..aa93b0af7d 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -173,8 +173,8 @@ void Force::init() // check if pair style must be specified after restart if (pair_restart) { if (!pair) - error->all(FLERR,fmt::format("Must re-specify non-restarted pair style " - "({}) after read_restart", pair_restart)); + error->all(FLERR,"Must re-specify non-restarted pair style " + "({}) after read_restart", pair_restart); } if (kspace) kspace->init(); // kspace must come before pair diff --git a/src/group.cpp b/src/group.cpp index 997214cbc7..4a898106e5 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -321,8 +321,8 @@ void Group::assign(int narg, char **arg) delta = values.next_tagint(); } else throw TokenizerException("Syntax error",""); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Incorrect range string " - "'{}': {}",arg[iarg],e.what())); + error->all(FLERR,"Incorrect range string " + "'{}': {}",arg[iarg],e.what()); } if (delta < 1) error->all(FLERR,"Illegal range increment value"); diff --git a/src/input.cpp b/src/input.cpp index d3352b380a..04ff4c70da 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -270,7 +270,7 @@ void Input::file() // execute the command if (execute_command() && line) - error->all(FLERR,fmt::format("Unknown command: {}",line)); + error->all(FLERR,"Unknown command: {}",line); } } @@ -302,8 +302,8 @@ void Input::file(const char *filename) infile = fopen(filename,"r"); if (infile == nullptr) - error->one(FLERR,fmt::format("Cannot open input script {}: {}", - filename, utils::getsyserror())); + error->one(FLERR,"Cannot open input script {}: {}", + filename, utils::getsyserror()); infiles[nfile++] = infile; } @@ -359,7 +359,7 @@ char *Input::one(const std::string &single) // execute the command and return its name if (execute_command()) - error->all(FLERR,fmt::format("Unknown command: {}",line)); + error->all(FLERR,"Unknown command: {}",line); return command; } @@ -613,8 +613,8 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) } if (value == nullptr) - error->one(FLERR,fmt::format("Substitution for illegal " - "variable {}",var)); + error->one(FLERR,"Substitution for illegal " + "variable {}",var); // check if storage in str2 needs to be expanded // re-initialize ptr and ptr2 to the point beyond the variable. @@ -971,8 +971,8 @@ void Input::include() infile = fopen(arg[0],"r"); if (infile == nullptr) - error->one(FLERR,fmt::format("Cannot open input script {}: {}", - arg[0], utils::getsyserror())); + error->one(FLERR,"Cannot open input script {}: {}", + arg[0], utils::getsyserror()); infiles[nfile++] = infile; } @@ -1005,8 +1005,8 @@ void Input::jump() if (infile && infile != stdin) fclose(infile); infile = fopen(arg[0],"r"); if (infile == nullptr) - error->one(FLERR,fmt::format("Cannot open input script {}: {}", - arg[0], utils::getsyserror())); + error->one(FLERR,"Cannot open input script {}: {}", + arg[0], utils::getsyserror()); infiles[nfile-1] = infile; } @@ -1047,8 +1047,8 @@ void Input::log() else logfile = fopen(arg[0],"w"); if (logfile == nullptr) - error->one(FLERR,fmt::format("Cannot open logfile {}: {}", - arg[0], utils::getsyserror())); + error->one(FLERR,"Cannot open logfile {}: {}", + arg[0], utils::getsyserror()); } if (universe->nworlds == 1) universe->ulogfile = logfile; @@ -1123,8 +1123,8 @@ void Input::print() if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open print file {}: {}", - arg[iarg+1], utils::getsyserror())); + error->one(FLERR,"Cannot open print file {}: {}", + arg[iarg+1], utils::getsyserror()); } iarg += 2; } else if (strcmp(arg[iarg],"screen") == 0) { diff --git a/src/lammps.cpp b/src/lammps.cpp index 277ec4414f..cb7aaf9182 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -490,8 +490,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : else if (strcmp(arg[inflag], "none") == 0) infile = stdin; else infile = fopen(arg[inflag],"r"); if (infile == nullptr) - error->one(FLERR,fmt::format("Cannot open input script {}: {}", - arg[inflag], utils::getsyserror())); + error->one(FLERR,"Cannot open input script {}: {}", + arg[inflag], utils::getsyserror()); } if ((universe->me == 0) && !helpflag) @@ -515,16 +515,16 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : str = fmt::format("screen.{}",universe->iworld); screen = fopen(str.c_str(),"w"); if (screen == nullptr) - error->one(FLERR,fmt::format("Cannot open screen file {}: {}", - str,utils::getsyserror())); + error->one(FLERR,"Cannot open screen file {}: {}", + str,utils::getsyserror()); } else if (strcmp(arg[screenflag],"none") == 0) { screen = nullptr; } else { str = fmt::format("{}.{}",arg[screenflag],universe->iworld); screen = fopen(str.c_str(),"w"); if (screen == nullptr) - error->one(FLERR,fmt::format("Cannot open screen file {}: {}", - arg[screenflag],utils::getsyserror())); + error->one(FLERR,"Cannot open screen file {}: {}", + arg[screenflag],utils::getsyserror()); } } else if (strcmp(arg[partscreenflag],"none") == 0) { screen = nullptr; @@ -532,8 +532,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : str = fmt::format("{}.{}",arg[partscreenflag],universe->iworld); screen = fopen(str.c_str(),"w"); if (screen == nullptr) - error->one(FLERR,fmt::format("Cannot open screen file {}: {}", - str,utils::getsyserror())); + error->one(FLERR,"Cannot open screen file {}: {}", + str,utils::getsyserror()); } if (partlogflag == 0) { @@ -541,16 +541,16 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : str = fmt::format("log.lammps.{}",universe->iworld); logfile = fopen(str.c_str(),"w"); if (logfile == nullptr) - error->one(FLERR,fmt::format("Cannot open logfile {}: {}", - str, utils::getsyserror())); + error->one(FLERR,"Cannot open logfile {}: {}", + str, utils::getsyserror()); } else if (strcmp(arg[logflag],"none") == 0) { logfile = nullptr; } else { str = fmt::format("{}.{}",arg[logflag],universe->iworld); logfile = fopen(str.c_str(),"w"); if (logfile == nullptr) - error->one(FLERR,fmt::format("Cannot open logfile {}: {}", - str, utils::getsyserror())); + error->one(FLERR,"Cannot open logfile {}: {}", + str, utils::getsyserror()); } } else if (strcmp(arg[partlogflag],"none") == 0) { logfile = nullptr; @@ -558,15 +558,15 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : str = fmt::format("{}.{}",arg[partlogflag],universe->iworld); logfile = fopen(str.c_str(),"w"); if (logfile == nullptr) - error->one(FLERR,fmt::format("Cannot open logfile {}: {}", - str, utils::getsyserror())); + error->one(FLERR,"Cannot open logfile {}: {}", + str, utils::getsyserror()); } if (strcmp(arg[inflag], "none") != 0) { infile = fopen(arg[inflag],"r"); if (infile == nullptr) - error->one(FLERR,fmt::format("Cannot open input script {}: {}", - arg[inflag], utils::getsyserror())); + error->one(FLERR,"Cannot open input script {}: {}", + arg[inflag], utils::getsyserror()); } } diff --git a/src/library.cpp b/src/library.cpp index c51006f8d8..6565aa6630 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -4734,13 +4734,13 @@ void lammps_set_fix_external_callback(void *handle, char *id, FixExternalFnPtr c { int ifix = lmp->modify->find_fix(id); if (ifix < 0) - lmp->error->all(FLERR,fmt::format("Cannot find fix with ID '{}'!", id)); + lmp->error->all(FLERR,"Cannot find fix with ID '{}'!", id); Fix *fix = lmp->modify->fix[ifix]; if (strcmp("external",fix->style) != 0) - lmp->error->all(FLERR,fmt::format("Fix '{}' is not of style " - "external!", id)); + lmp->error->all(FLERR,"Fix '{}' is not of style " + "external!", id); FixExternal * fext = (FixExternal*) fix; fext->set_callback(callback, caller); @@ -4758,12 +4758,12 @@ void lammps_fix_external_set_energy_global(void *handle, char *id, { int ifix = lmp->modify->find_fix(id); if (ifix < 0) - lmp->error->all(FLERR,fmt::format("Can not find fix with ID '{}'!", id)); + lmp->error->all(FLERR,"Can not find fix with ID '{}'!", id); Fix *fix = lmp->modify->fix[ifix]; if (strcmp("external",fix->style) != 0) - lmp->error->all(FLERR,fmt::format("Fix '{}' is not of style external!", id)); + lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); FixExternal * fext = (FixExternal*) fix; fext->set_energy_global(energy); @@ -4781,12 +4781,12 @@ void lammps_fix_external_set_virial_global(void *handle, char *id, { int ifix = lmp->modify->find_fix(id); if (ifix < 0) - lmp->error->all(FLERR,fmt::format("Can not find fix with ID '{}'!", id)); + lmp->error->all(FLERR,"Can not find fix with ID '{}'!", id); Fix *fix = lmp->modify->fix[ifix]; if (strcmp("external",fix->style) != 0) - lmp->error->all(FLERR,fmt::format("Fix '{}' is not of style external!", id)); + lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); FixExternal * fext = (FixExternal*) fix; fext->set_virial_global(virial); diff --git a/src/memory.cpp b/src/memory.cpp index ef2d9c57a4..174932e35e 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -61,8 +61,8 @@ void *Memory::smalloc(bigint nbytes, const char *name) void *ptr = malloc(nbytes); #endif if (ptr == nullptr) - error->one(FLERR,fmt::format("Failed to allocate {} bytes for array {}", - nbytes,name)); + error->one(FLERR,"Failed to allocate {} bytes for array {}", + nbytes,name); return ptr; } @@ -100,8 +100,8 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) ptr = realloc(ptr,nbytes); #endif if (ptr == nullptr) - error->one(FLERR,fmt::format("Failed to reallocate {} bytes for array {}", - nbytes,name)); + error->one(FLERR,"Failed to reallocate {} bytes for array {}", + nbytes,name); return ptr; } @@ -125,6 +125,6 @@ void Memory::sfree(void *ptr) void Memory::fail(const char *name) { - error->one(FLERR,fmt::format("Cannot create/grow a vector/array of " - "pointers for {}",name)); + error->one(FLERR,"Cannot create/grow a vector/array of " + "pointers for {}",name); } diff --git a/src/modify.cpp b/src/modify.cpp index f8a75ca908..1d6a3d7178 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -250,14 +250,14 @@ void Modify::init() for (i = 0; i < nfix; i++) if (!fix[i]->dynamic_group_allow && group->dynamic[fix[i]->igroup]) - error->all(FLERR,fmt::format("Fix {} does not allow use with a " - "dynamic group",fix[i]->id)); + error->all(FLERR,"Fix {} does not allow use with a " + "dynamic group",fix[i]->id); for (i = 0; i < ncompute; i++) if (!compute[i]->dynamic_group_allow && group->dynamic[compute[i]->igroup]) - error->all(FLERR,fmt::format("Compute {} does not allow use with a " - "dynamic group",compute[i]->id)); + error->all(FLERR,"Compute {} does not allow use with a " + "dynamic group",compute[i]->id); // warn if any particle is time integrated more than once @@ -1221,7 +1221,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) for (int icompute = 0; icompute < ncompute; icompute++) if (strcmp(arg[0],compute[icompute]->id) == 0) - error->all(FLERR,fmt::format("Reuse of compute ID '{}'",arg[0])); + error->all(FLERR,"Reuse of compute ID '{}'",arg[0]); // extend Compute list if necessary diff --git a/src/molecule.cpp b/src/molecule.cpp index 9aca15820d..9961014a10 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -130,8 +130,8 @@ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) : if (me == 0) { fp = fopen(arg[ifile],"r"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open molecule file {}: {}", - arg[ifile], utils::getsyserror())); + error->one(FLERR,"Cannot open molecule file {}: {}", + arg[ifile], utils::getsyserror()); } read(0); if (me == 0) fclose(fp); @@ -488,14 +488,14 @@ void Molecule::read(int flag) if (utils::strmatch(text,"^\\d+\\s+\\S+")) { values.next_int(); auto keyword = values.next_string(); - error->one(FLERR,fmt::format("Invalid header keyword: {}",keyword)); + error->one(FLERR,"Invalid header keyword: {}",keyword); } else break; } if (nmatch != nwant) error->one(FLERR,"Invalid header line format in molecule file"); } catch (TokenizerException &e) { - error->one(FLERR, fmt::format("Invalid header in molecule file\n" - "{}", e.what())); + error->one(FLERR, "Invalid header in molecule file\n" + "{}", e.what()); } } @@ -616,11 +616,11 @@ void Molecule::read(int flag) // Error: Either a too long/short section or a typo in the keyword if (utils::strmatch(keyword,"^[A-Za-z ]+$")) - error->one(FLERR,fmt::format("Unknown section '{}' in molecule " - "file\n",keyword)); - else error->one(FLERR,fmt::format("Unexpected line in molecule file " + error->one(FLERR,"Unknown section '{}' in molecule " + "file\n",keyword); + else error->one(FLERR,"Unexpected line in molecule file " "while looking for the next " - "section:\n{}",line)); + "section:\n{}",line); } keyword = parse_keyword(1,line); } @@ -689,8 +689,8 @@ void Molecule::coords(char *line) ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 4) - error->all(FLERR,fmt::format("Invalid line in Coords section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Coords section of " + "molecule file: {}",line); int iatom = values.next_int() - 1; if (iatom < 0 || iatom >= natoms) @@ -705,19 +705,19 @@ void Molecule::coords(char *line) x[iatom][2] *= sizescale; } } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Invalid line in Coords section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR,"Invalid line in Coords section of " + "molecule file: {}\n{}",e.what(),line); } for (int i = 0; i < natoms; i++) - if (count[i] == 0) error->all(FLERR,fmt::format("Atom {} missing in Coords " - "section of molecule file",i+1)); + if (count[i] == 0) error->all(FLERR,"Atom {} missing in Coords " + "section of molecule file",i+1); if (domain->dimension == 2) { for (int i = 0; i < natoms; i++) if (x[i][2] != 0.0) - error->all(FLERR,fmt::format("Z coord in molecule file for atom {} " - "must be 0.0 for 2d-simulation.",i+1)); + error->all(FLERR,"Z coord in molecule file for atom {} " + "must be 0.0 for 2d-simulation.",i+1); } } @@ -735,8 +735,8 @@ void Molecule::types(char *line) ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 2) - error->all(FLERR,fmt::format("Invalid line in Types section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Types section of " + "molecule file: {}",line); int iatom = values.next_int() - 1; if (iatom < 0 || iatom >= natoms) @@ -746,17 +746,17 @@ void Molecule::types(char *line) type[iatom] += toffset; } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Types section of " - "molecule file: {}\n{}", e.what(),line)); + error->all(FLERR, "Invalid line in Types section of " + "molecule file: {}\n{}", e.what(),line); } for (int i = 0; i < natoms; i++) { - if (count[i] == 0) error->all(FLERR,fmt::format("Atom {} missing in Types " - "section of molecule file",i+1)); + if (count[i] == 0) error->all(FLERR,"Atom {} missing in Types " + "section of molecule file",i+1); if ((type[i] <= 0) || (domain->box_exist && (type[i] > atom->ntypes))) - error->all(FLERR,fmt::format("Invalid atom type {} for atom {} " - "in molecule file",type[i],i+1)); + error->all(FLERR,"Invalid atom type {} for atom {} " + "in molecule file",type[i],i+1); ntypes = MAX(ntypes,type[i]); } @@ -775,8 +775,8 @@ void Molecule::molecules(char *line) readline(line); ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 2) - error->all(FLERR,fmt::format("Invalid line in Molecules section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Molecules section of " + "molecule file: {}",line); int iatom = values.next_int() - 1; if (iatom < 0 || iatom >= natoms) @@ -786,18 +786,18 @@ void Molecule::molecules(char *line) // molecule[iatom] += moffset; // placeholder for possible molecule offset } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Molecules section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Molecules section of " + "molecule file: {}\n{}",e.what(),line); } for (int i = 0; i < natoms; i++) - if (count[i] == 0) error->all(FLERR,fmt::format("Atom {} missing in Molecules " - "section of molecule file",i+1)); + if (count[i] == 0) error->all(FLERR,"Atom {} missing in Molecules " + "section of molecule file",i+1); for (int i = 0; i < natoms; i++) if (molecule[i] < 0) - error->all(FLERR,fmt::format("Invalid molecule ID {} for atom {} " - "in molecule file",molecule[i],i+1)); + error->all(FLERR,"Invalid molecule ID {} for atom {} " + "in molecule file",molecule[i],i+1); for (int i = 0; i < natoms; i++) nmolecules = MAX(nmolecules,molecule[i]); @@ -824,15 +824,15 @@ void Molecule::fragments(char *line) while (values.has_next()) { int iatom = values.next_int()-1; if (iatom < 0 || iatom >= natoms) - error->all(FLERR,fmt::format("Invalid atom ID {} for fragment {} in " + error->all(FLERR,"Invalid atom ID {} for fragment {} in " "Fragments section of molecule file", - iatom+1, fragmentnames[i])); + iatom+1, fragmentnames[i]); fragmentmask[i][iatom] = 1; } } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid atom ID in Fragments section of " - "molecule file: {}\n{}", e.what(),line)); + error->all(FLERR, "Invalid atom ID in Fragments section of " + "molecule file: {}\n{}", e.what(),line); } } @@ -849,8 +849,8 @@ void Molecule::charges(char *line) ValueTokenizer values(utils::trim_comment(line)); if ((int)values.count() != 2) - error->all(FLERR,fmt::format("Invalid line in Charges section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Charges section of " + "molecule file: {}",line); int iatom = values.next_int() - 1; if (iatom < 0 || iatom >= natoms) @@ -860,13 +860,13 @@ void Molecule::charges(char *line) q[iatom] = values.next_double(); } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Charges section of " - "molecule file: {}.\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Charges section of " + "molecule file: {}.\n{}",e.what(),line); } for (int i = 0; i < natoms; i++) - if (count[i] == 0) error->all(FLERR,fmt::format("Atom {} missing in Charges " - "section of molecule file",i+1)); + if (count[i] == 0) error->all(FLERR,"Atom {} missing in Charges " + "section of molecule file",i+1); } /* ---------------------------------------------------------------------- @@ -883,8 +883,8 @@ void Molecule::diameters(char *line) ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 2) - error->all(FLERR,fmt::format("Invalid line in Diameters section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Diameters section of " + "molecule file: {}",line); int iatom = values.next_int() - 1; if (iatom < 0 || iatom >= natoms) error->all(FLERR,"Invalid atom index in Diameters section of molecule file"); @@ -895,16 +895,16 @@ void Molecule::diameters(char *line) maxradius = MAX(maxradius,radius[iatom]); } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Diameters section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Diameters section of " + "molecule file: {}\n{}",e.what(),line); } for (int i = 0; i < natoms; i++) { - if (count[i] == 0) error->all(FLERR,fmt::format("Atom {} missing in Diameters " - "section of molecule file",i+1)); + if (count[i] == 0) error->all(FLERR,"Atom {} missing in Diameters " + "section of molecule file",i+1); if (radius[i] < 0.0) - error->all(FLERR,fmt::format("Invalid atom diameter {} for atom {} " - "in molecule file", radius[i], i+1)); + error->all(FLERR,"Invalid atom diameter {} for atom {} " + "in molecule file", radius[i], i+1); } } @@ -921,8 +921,8 @@ void Molecule::masses(char *line) ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 2) - error->all(FLERR,fmt::format("Invalid line in Masses section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Masses section of " + "molecule file: {}",line); int iatom = values.next_int() - 1; if (iatom < 0 || iatom >= natoms) @@ -932,16 +932,16 @@ void Molecule::masses(char *line) rmass[iatom] *= sizescale*sizescale*sizescale; } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Masses section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Masses section of " + "molecule file: {}\n{}",e.what(),line); } for (int i = 0; i < natoms; i++) { - if (count[i] == 0) error->all(FLERR,fmt::format("Atom {} missing in Masses " - "section of molecule file",i+1)); + if (count[i] == 0) error->all(FLERR,"Atom {} missing in Masses " + "section of molecule file",i+1); if (rmass[i] <= 0.0) - error->all(FLERR,fmt::format("Invalid atom mass {} for atom {} " - "in molecule file", radius[i], i+1)); + error->all(FLERR,"Invalid atom mass {} for atom {} " + "in molecule file", radius[i], i+1); } } @@ -970,15 +970,15 @@ void Molecule::bonds(int flag, char *line) try { ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 4) - error->all(FLERR,fmt::format("Invalid line in Bonds section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Bonds section of " + "molecule file: {}",line); values.next_int(); itype = values.next_int(); atom1 = values.next_tagint(); atom2 = values.next_tagint(); } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Bonds section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Bonds section of " + "molecule file: {}\n{}",e.what(),line); } itype += boffset; @@ -1040,16 +1040,16 @@ void Molecule::angles(int flag, char *line) try { ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 5) - error->all(FLERR,fmt::format("Invalid line in Angles section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Angles section of " + "molecule file: {}",line); values.next_int(); itype = values.next_int(); atom1 = values.next_tagint(); atom2 = values.next_tagint(); atom3 = values.next_tagint(); } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Angles section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Angles section of " + "molecule file: {}\n{}",e.what(),line); } itype += aoffset; @@ -1126,8 +1126,8 @@ void Molecule::dihedrals(int flag, char *line) try { ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 6) - error->all(FLERR,fmt::format("Invalid line in Dihedrals section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Dihedrals section of " + "molecule file: {}",line); values.next_int(); itype = values.next_int(); @@ -1136,8 +1136,8 @@ void Molecule::dihedrals(int flag, char *line) atom3 = values.next_tagint(); atom4 = values.next_tagint(); } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Dihedrals section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Dihedrals section of " + "molecule file: {}\n{}",e.what(),line); } itype += doffset; @@ -1228,8 +1228,8 @@ void Molecule::impropers(int flag, char *line) try { ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 6) - error->all(FLERR,fmt::format("Invalid line in Impropers section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Impropers section of " + "molecule file: {}",line); values.next_int(); itype = values.next_int(); atom1 = values.next_tagint(); @@ -1237,8 +1237,8 @@ void Molecule::impropers(int flag, char *line) atom3 = values.next_tagint(); atom4 = values.next_tagint(); } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Impropers section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Impropers section of " + "molecule file: {}\n{}",e.what(),line); } itype += ioffset; @@ -1323,15 +1323,15 @@ void Molecule::nspecial_read(int flag, char *line) try { ValueTokenizer values(utils::trim_comment(line)); if (values.count() != 4) - error->all(FLERR,fmt::format("Invalid line in Special Bond Counts section of " - "molecule file: {}",line)); + error->all(FLERR,"Invalid line in Special Bond Counts section of " + "molecule file: {}",line); values.next_int(); c1 = values.next_tagint(); c2 = values.next_tagint(); c3 = values.next_tagint(); } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Special Bond Counts section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Special Bond Counts section of " + "molecule file: {}\n{}",e.what(),line); } if (flag) { @@ -1370,8 +1370,8 @@ void Molecule::special_read(char *line) } } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid line in Special Bonds section of " - "molecule file: {}\n{}",e.what(),line)); + error->all(FLERR, "Invalid line in Special Bonds section of " + "molecule file: {}\n{}",e.what(),line); } } @@ -1500,8 +1500,8 @@ void Molecule::shakeflag_read(char *line) shake_flag[i] = values.next_int(); } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid Shake Flags section in molecule file\n" - "{}", e.what())); + error->all(FLERR, "Invalid Shake Flags section in molecule file\n" + "{}", e.what()); } for (int i = 0; i < natoms; i++) @@ -1570,8 +1570,8 @@ void Molecule::shakeatom_read(char *line) } } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Invalid shake atom in molecule file\n" - "{}", e.what())); + error->all(FLERR,"Invalid shake atom in molecule file\n" + "{}", e.what()); } for (int i = 0; i < natoms; i++) { @@ -1640,8 +1640,8 @@ void Molecule::shaketype_read(char *line) error->all(FLERR,"Invalid shake type data in molecule file"); } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid shake type data in molecule file\n", - "{}", e.what())); + error->all(FLERR, "Invalid shake type data in molecule file\n", + "{}", e.what()); } for (int i = 0; i < natoms; i++) { @@ -1693,8 +1693,8 @@ void Molecule::body(int flag, int pflag, char *line) } else nword += ncount; } } catch (TokenizerException &e) { - error->all(FLERR, fmt::format("Invalid body params in molecule file\n", - "{}", e.what())); + error->all(FLERR, "Invalid body params in molecule file\n", + "{}", e.what()); } } @@ -2055,8 +2055,8 @@ void Molecule::skip_lines(int n, char *line, const std::string §ion) for (int i = 0; i < n; i++) { readline(line); if (utils::strmatch(utils::trim(utils::trim_comment(line)),"^[A-Za-z ]+$")) - error->one(FLERR,fmt::format("Unexpected line in molecule file while " - "skipping {} section:\n{}",section,line)); + error->one(FLERR,"Unexpected line in molecule file while " + "skipping {} section:\n{}",section,line); } } diff --git a/src/ntopo_angle_all.cpp b/src/ntopo_angle_all.cpp index b32d530a4c..b7811052df 100644 --- a/src/ntopo_angle_all.cpp +++ b/src/ntopo_angle_all.cpp @@ -60,10 +60,10 @@ void NTopoAngleAll::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Angle atoms {} {} {} missing on " + error->one(FLERR,"Angle atoms {} {} {} missing on " "proc {} at step {}",angle_atom1[i][m], angle_atom2[i][m],angle_atom3[i][m], - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_angle_partial.cpp b/src/ntopo_angle_partial.cpp index e793e0ee1d..543658f19f 100644 --- a/src/ntopo_angle_partial.cpp +++ b/src/ntopo_angle_partial.cpp @@ -61,10 +61,10 @@ void NTopoAnglePartial::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Angle atoms {} {} {} missing on " + error->one(FLERR,"Angle atoms {} {} {} missing on " "proc {} at step {}",angle_atom1[i][m], angle_atom2[i][m],angle_atom3[i][m], - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_angle_template.cpp b/src/ntopo_angle_template.cpp index d958f575b6..ad09979a7a 100644 --- a/src/ntopo_angle_template.cpp +++ b/src/ntopo_angle_template.cpp @@ -78,12 +78,12 @@ void NTopoAngleTemplate::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Angle atoms {} {} {} missing on " + error->one(FLERR,"Angle atoms {} {} {} missing on " "proc {} at step {}", angle_atom1[iatom][m]+tagprev, angle_atom2[iatom][m]+tagprev, angle_atom3[iatom][m]+tagprev, - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_bond_all.cpp b/src/ntopo_bond_all.cpp index 2ae9d35e59..578f98ec81 100644 --- a/src/ntopo_bond_all.cpp +++ b/src/ntopo_bond_all.cpp @@ -57,9 +57,9 @@ void NTopoBondAll::build() if (atom1 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Bond atoms {} {} missing on " + error->one(FLERR,"Bond atoms {} {} missing on " "proc {} at step {}",tag[i], - bond_atom[i][m],me,update->ntimestep)); + bond_atom[i][m],me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_bond_partial.cpp b/src/ntopo_bond_partial.cpp index 2339db3afd..8d077106db 100644 --- a/src/ntopo_bond_partial.cpp +++ b/src/ntopo_bond_partial.cpp @@ -58,9 +58,9 @@ void NTopoBondPartial::build() if (atom1 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Bond atoms {} {} missing on " + error->one(FLERR,"Bond atoms {} {} missing on " "proc {} at step {}",tag[i], - bond_atom[i][m],me,update->ntimestep)); + bond_atom[i][m],me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_bond_template.cpp b/src/ntopo_bond_template.cpp index 4a8ed6e069..887ac3aa81 100644 --- a/src/ntopo_bond_template.cpp +++ b/src/ntopo_bond_template.cpp @@ -74,10 +74,10 @@ void NTopoBondTemplate::build() if (atom1 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Bond atoms {} {} missing on " + error->one(FLERR,"Bond atoms {} {} missing on " "proc {} at step {}",tag[i], bond_atom[iatom][m]+tagprev, - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_dihedral_all.cpp b/src/ntopo_dihedral_all.cpp index 5cecad4f78..b77e0cc33f 100644 --- a/src/ntopo_dihedral_all.cpp +++ b/src/ntopo_dihedral_all.cpp @@ -62,11 +62,11 @@ void NTopoDihedralAll::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Dihedral atoms {} {} {} {} missing on " + error->one(FLERR,"Dihedral atoms {} {} {} {} missing on " "proc {} at step {}", dihedral_atom1[i][m],dihedral_atom2[i][m], dihedral_atom3[i][m],dihedral_atom4[i][m], - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_dihedral_partial.cpp b/src/ntopo_dihedral_partial.cpp index 9c7e1e0205..980f073b67 100644 --- a/src/ntopo_dihedral_partial.cpp +++ b/src/ntopo_dihedral_partial.cpp @@ -64,11 +64,11 @@ void NTopoDihedralPartial::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Dihedral atoms {} {} {} {} missing on " + error->one(FLERR,"Dihedral atoms {} {} {} {} missing on " "proc {} at step {}", dihedral_atom1[i][m],dihedral_atom2[i][m], dihedral_atom3[i][m],dihedral_atom4[i][m], - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_dihedral_template.cpp b/src/ntopo_dihedral_template.cpp index c30a3183b5..5c6f3d333f 100644 --- a/src/ntopo_dihedral_template.cpp +++ b/src/ntopo_dihedral_template.cpp @@ -80,13 +80,13 @@ void NTopoDihedralTemplate::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Dihedral atoms {} {} {} {} missing on " + error->one(FLERR,"Dihedral atoms {} {} {} {} missing on " "proc {} at step {}", dihedral_atom1[iatom][m]+tagprev, dihedral_atom2[iatom][m]+tagprev, dihedral_atom3[iatom][m]+tagprev, dihedral_atom4[iatom][m]+tagprev, - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_improper_all.cpp b/src/ntopo_improper_all.cpp index c36b02a300..936ed279d7 100644 --- a/src/ntopo_improper_all.cpp +++ b/src/ntopo_improper_all.cpp @@ -62,11 +62,11 @@ void NTopoImproperAll::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Improper atoms {} {} {} {} missing on " + error->one(FLERR,"Improper atoms {} {} {} {} missing on " "proc {} at step {}", improper_atom1[i][m],improper_atom2[i][m], improper_atom3[i][m],improper_atom4[i][m], - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_improper_partial.cpp b/src/ntopo_improper_partial.cpp index 7ff6cc864f..911e968326 100644 --- a/src/ntopo_improper_partial.cpp +++ b/src/ntopo_improper_partial.cpp @@ -64,13 +64,13 @@ void NTopoImproperPartial::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Improper atoms {} {} {} {}" + error->one(FLERR,"Improper atoms {} {} {} {}" " missing on proc {} at step {}", improper_atom1[i][m], improper_atom2[i][m], improper_atom3[i][m], improper_atom4[i][m], - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/ntopo_improper_template.cpp b/src/ntopo_improper_template.cpp index 43d8d2be38..d8294a7f23 100644 --- a/src/ntopo_improper_template.cpp +++ b/src/ntopo_improper_template.cpp @@ -80,13 +80,13 @@ void NTopoImproperTemplate::build() if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { nmissing++; if (lostbond == Thermo::ERROR) - error->one(FLERR,fmt::format("Improper atoms {} {} {} {}" + error->one(FLERR,"Improper atoms {} {} {} {}" " missing on proc {} at step {}", improper_atom1[iatom][m]+tagprev, improper_atom2[iatom][m]+tagprev, improper_atom3[iatom][m]+tagprev, improper_atom4[iatom][m]+tagprev, - me,update->ntimestep)); + me,update->ntimestep); continue; } atom1 = domain->closest_image(i,atom1); diff --git a/src/pair.cpp b/src/pair.cpp index 015129dc5d..42ec13374b 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -1729,9 +1729,9 @@ void Pair::write_file(int narg, char **arg) if (utils::file_is_readable(table_file)) { std::string units = utils::get_potential_units(table_file,"table"); if (!units.empty() && (units != update->unit_style)) { - error->one(FLERR,fmt::format("Trying to append to a table file " + error->one(FLERR,"Trying to append to a table file " "with UNITS: {} while units are {}", - units, update->unit_style)); + units, update->unit_style); } std::string date = utils::get_potential_date(table_file,"table"); utils::logmesg(lmp,"Appending to table file {} with DATE: {}\n", @@ -1748,8 +1748,8 @@ void Pair::write_file(int narg, char **arg) datebuf, update->unit_style); } if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open pair_write file {}: {}", - table_file, utils::getsyserror())); + error->one(FLERR,"Cannot open pair_write file {}: {}", + table_file, utils::getsyserror()); fprintf(fp,"# Pair potential %s for atom types %d %d: i,r,energy,force\n", force->pair_style,itype,jtype); if (style == RLINEAR) diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 002429e7b3..c96859a6a5 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -265,8 +265,8 @@ void PairHybrid::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal pair_style command"); if (lmp->kokkos && !utils::strmatch(force->pair_style,"^hybrid.*/kk$")) - error->all(FLERR,fmt::format("Must use pair_style {}/kk with Kokkos", - force->pair_style)); + error->all(FLERR,"Must use pair_style {}/kk with Kokkos", + force->pair_style); // delete old lists, since cannot just change settings diff --git a/src/pair_hybrid_scaled.cpp b/src/pair_hybrid_scaled.cpp index de8801fe24..b74515b083 100644 --- a/src/pair_hybrid_scaled.cpp +++ b/src/pair_hybrid_scaled.cpp @@ -72,8 +72,8 @@ void PairHybridScaled::compute(int eflag, int vflag) for (i = 0; i < nvars; ++i) { j = input->variable->find(scalevars[i].c_str()); if (j < 0) - error->all(FLERR,fmt::format("Variable '{}' not found when updating " - "scale factors",scalevars[i])); + error->all(FLERR,"Variable '{}' not found when updating " + "scale factors",scalevars[i]); vals[i] = input->variable->compute_equal(j); } for (i = 0; i < nstyles; ++i) { @@ -245,8 +245,8 @@ void PairHybridScaled::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal pair_style command"); if (lmp->kokkos && !utils::strmatch(force->pair_style,"^hybrid.*/kk$")) - error->all(FLERR,fmt::format("Must use pair_style {}/kk with Kokkos", - force->pair_style)); + error->all(FLERR,"Must use pair_style {}/kk with Kokkos", + force->pair_style); if (atom->avec->forceclearflag) error->all(FLERR,"Atom style is not compatible with pair_style hybrid/scaled"); @@ -397,8 +397,8 @@ double PairHybridScaled::single(int i, int j, int itype, int jtype, double rsq, for (i = 0; i < nvars; ++i) { j = input->variable->find(scalevars[i].c_str()); if (j < 0) - error->all(FLERR,fmt::format("Variable '{}' not found when updating " - "scale factors",scalevars[i])); + error->all(FLERR,"Variable '{}' not found when updating " + "scale factors",scalevars[i]); vals[i] = input->variable->compute_equal(j); } for (i = 0; i < nstyles; ++i) { diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 7e331a16a4..3c9b51e3f2 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -116,27 +116,27 @@ void PairTable::compute(int eflag, int vflag) if (rsq < cutsq[itype][jtype]) { tb = &tables[tabindex[itype][jtype]]; if (rsq < tb->innersq) - error->one(FLERR,fmt::format("Pair distance < table inner cutoff: " - "ijtype {} {} dist {}",itype,jtype,sqrt(rsq))); + error->one(FLERR,"Pair distance < table inner cutoff: " + "ijtype {} {} dist {}",itype,jtype,sqrt(rsq)); if (tabstyle == LOOKUP) { itable = static_cast ((rsq - tb->innersq) * tb->invdelta); if (itable >= tlm1) - error->one(FLERR,fmt::format("Pair distance > table outer cutoff: " - "ijtype {} {} dist {}",itype,jtype,sqrt(rsq))); + error->one(FLERR,"Pair distance > table outer cutoff: " + "ijtype {} {} dist {}",itype,jtype,sqrt(rsq)); fpair = factor_lj * tb->f[itable]; } else if (tabstyle == LINEAR) { itable = static_cast ((rsq - tb->innersq) * tb->invdelta); if (itable >= tlm1) - error->one(FLERR,fmt::format("Pair distance > table outer cutoff: " - "ijtype {} {} dist {}",itype,jtype,sqrt(rsq))); + error->one(FLERR,"Pair distance > table outer cutoff: " + "ijtype {} {} dist {}",itype,jtype,sqrt(rsq)); fraction = (rsq - tb->rsq[itable]) * tb->invdelta; value = tb->f[itable] + fraction*tb->df[itable]; fpair = factor_lj * value; } else if (tabstyle == SPLINE) { itable = static_cast ((rsq - tb->innersq) * tb->invdelta); if (itable >= tlm1) - error->one(FLERR,fmt::format("Pair distance > table outer cutoff: " - "ijtype {} {} dist {}",itype,jtype,sqrt(rsq))); + error->one(FLERR,"Pair distance > table outer cutoff: " + "ijtype {} {} dist {}",itype,jtype,sqrt(rsq)); b = (rsq - tb->rsq[itable]) * tb->invdelta; a = 1.0 - b; value = a * tb->f[itable] + b * tb->f[itable+1] + @@ -568,7 +568,7 @@ void PairTable::param_extract(Table *tb, char *line) tb->fplo = values.next_double(); tb->fphi = values.next_double(); } else { - error->one(FLERR,fmt::format("Invalid keyword {} in pair table parameters", word).c_str()); + error->one(FLERR,"Invalid keyword {} in pair table parameters", word); } } } catch (TokenizerException &e) { diff --git a/src/potential_file_reader.cpp b/src/potential_file_reader.cpp index ce369253cf..3d357771c7 100644 --- a/src/potential_file_reader.cpp +++ b/src/potential_file_reader.cpp @@ -62,8 +62,8 @@ PotentialFileReader::PotentialFileReader(LAMMPS *lmp, try { reader = open_potential(filename); if (!reader) { - error->one(FLERR, fmt::format("cannot open {} potential file {}: {}", - potential_name, filename, utils::getsyserror())); + error->one(FLERR, "cannot open {} potential file {}: {}", + potential_name, filename, utils::getsyserror()); } } catch (FileReaderException &e) { error->one(FLERR, e.what()); @@ -268,9 +268,9 @@ TextFileReader *PotentialFileReader::open_potential(const std::string &path) { } else if ((units == "real") && (unit_style == "metal") && (unit_convert & utils::REAL2METAL)) { unit_convert = utils::REAL2METAL; } else { - lmp->error->one(FLERR, fmt::format("{} file {} requires {} units " + lmp->error->one(FLERR, "{} file {} requires {} units " "but {} units are in use", filetype, - filename, units, unit_style)); + filename, units, unit_style); } } } diff --git a/src/procmap.cpp b/src/procmap.cpp index 87ab415e5e..03a605c0d9 100644 --- a/src/procmap.cpp +++ b/src/procmap.cpp @@ -308,8 +308,8 @@ void ProcMap::custom_grid(char *cfile, int nprocs, procgrid[1] = procs.next_int(); procgrid[2] = procs.next_int(); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Processors custom grid file " - "is inconsistent: {}", e.what())); + error->all(FLERR,"Processors custom grid file " + "is inconsistent: {}", e.what()); } int flag = 0; @@ -337,8 +337,8 @@ void ProcMap::custom_grid(char *cfile, int nprocs, cmap[i][2] = pmap.next_int(); cmap[i][3] = pmap.next_int(); } catch (TokenizerException &e) { - error->one(FLERR,fmt::format("Processors custom grid file is " - "inconsistent: {}", e.what())); + error->one(FLERR,"Processors custom grid file is " + "inconsistent: {}", e.what()); } } fclose(fp); diff --git a/src/read_data.cpp b/src/read_data.cpp index 57d5d898a9..01de7ab3a9 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -720,8 +720,8 @@ void ReadData::command(int narg, char **arg) if (firstpass) impropercoeffs(1); else skip_lines(nimpropertypes); - } else error->all(FLERR,fmt::format("Unknown identifier in data file: {}", - keyword)); + } else error->all(FLERR,"Unknown identifier in data file: {}", + keyword); parse_keyword(0); } @@ -1178,7 +1178,7 @@ void ReadData::header(int firstpass) for (n = 0; n < NSECTIONS; n++) if (strcmp(keyword,section_keywords[n]) == 0) break; if (n == NSECTIONS) - error->all(FLERR,fmt::format("Unknown identifier in data file: {}",keyword)); + error->all(FLERR,"Unknown identifier in data file: {}",keyword); // error checks on header values // must be consistent with atom style and other header values @@ -1970,8 +1970,8 @@ void ReadData::open(char *file) } if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open file {}: {}", - file, utils::getsyserror())); + error->one(FLERR,"Cannot open file {}: {}", + file, utils::getsyserror()); } /* ---------------------------------------------------------------------- diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 40e4414543..456839dc61 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -109,8 +109,8 @@ void ReadRestart::command(int narg, char **arg) } fp = fopen(hfile.c_str(),"rb"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open restart file {}: {}", - hfile, utils::getsyserror())); + error->one(FLERR,"Cannot open restart file {}: {}", + hfile, utils::getsyserror()); } // read magic string, endian flag, format revision @@ -271,8 +271,8 @@ void ReadRestart::command(int narg, char **arg) procfile.replace(procfile.find("%"),1,fmt::format("{}",iproc)); fp = fopen(procfile.c_str(),"rb"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open restart file {}: {}", - procfile, utils::getsyserror())); + error->one(FLERR,"Cannot open restart file {}: {}", + procfile, utils::getsyserror()); utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PROCSPERFILE) error->one(FLERR,"Invalid flag in peratom section of restart file"); @@ -335,8 +335,8 @@ void ReadRestart::command(int narg, char **arg) procfile.replace(procfile.find("%"),1,fmt::format("{}",icluster)); fp = fopen(procfile.c_str(),"rb"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open restart file {}: {}", - procfile, utils::getsyserror())); + error->one(FLERR,"Cannot open restart file {}: {}", + procfile, utils::getsyserror()); } int flag,procsperfile; diff --git a/src/reader.cpp b/src/reader.cpp index ba172f58ee..ae6f7f5329 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -56,8 +56,8 @@ void Reader::open_file(const char *file) } if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open file {}: {}", - file, utils::getsyserror())); + error->one(FLERR,"Cannot open file {}: {}", + file, utils::getsyserror()); } /* ---------------------------------------------------------------------- diff --git a/src/reset_atom_ids.cpp b/src/reset_atom_ids.cpp index 47dae3cb56..cc9a05d11e 100644 --- a/src/reset_atom_ids.cpp +++ b/src/reset_atom_ids.cpp @@ -253,8 +253,8 @@ void ResetIDs::command(int narg, char **arg) int all; MPI_Allreduce(&badcount,&all,1,MPI_INT,MPI_SUM,world); if (all) - error->all(FLERR,fmt::format("Reset_ids missing {} bond topology atom IDs - " - "use comm_modify cutoff",all)); + error->all(FLERR,"Reset_ids missing {} bond topology atom IDs - " + "use comm_modify cutoff",all); // reset IDs and atom map for owned atoms diff --git a/src/thermo.cpp b/src/thermo.cpp index 6cd5abd9de..2229b2efbd 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -422,8 +422,8 @@ bigint Thermo::lost_check() // error message if (lostflag == Thermo::ERROR) - error->all(FLERR,fmt::format("Lost atoms: original {} current {}", - atom->natoms,ntotal)); + error->all(FLERR,"Lost atoms: original {} current {}", + atom->natoms,ntotal); // warning message diff --git a/src/universe.cpp b/src/universe.cpp index 79de6948df..6dac83745c 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -111,8 +111,8 @@ void Universe::reorder(char *style, char *arg) rv = sscanf(line,"%d %d",&me_orig,&me_new); if (me_orig < 0 || me_orig >= nprocs || me_new < 0 || me_new >= nprocs || rv != 2) - error->one(FLERR,fmt::format("Invalid entry '{} {}' in -reorder " - "file", me_orig, me_new)); + error->one(FLERR,"Invalid entry '{} {}' in -reorder " + "file", me_orig, me_new); uni2orig[me_new] = me_orig; for (int i = 1; i < nprocs; i++) { @@ -121,8 +121,8 @@ void Universe::reorder(char *style, char *arg) rv = sscanf(line,"%d %d",&me_orig,&me_new); if (me_orig < 0 || me_orig >= nprocs || me_new < 0 || me_new >= nprocs || rv != 2) - error->one(FLERR,fmt::format("Invalid entry '{} {}' in -reorder " - "file", me_orig, me_new)); + error->one(FLERR,"Invalid entry '{} {}' in -reorder " + "file", me_orig, me_new); uni2orig[me_new] = me_orig; } fclose(fp); diff --git a/src/utils.cpp b/src/utils.cpp index 2dcf77eacd..aa13950620 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1107,9 +1107,9 @@ FILE *utils::open_potential(const std::string &name, LAMMPS *lmp, if (auto_convert == nullptr) { if (!units.empty() && (units != unit_style) && (me == 0)) { - error->one(FLERR, fmt::format("Potential file {} requires {} units " + error->one(FLERR, "Potential file {} requires {} units " "but {} units are in use", name, units, - unit_style)); + unit_style); return nullptr; } } else { @@ -1123,9 +1123,9 @@ FILE *utils::open_potential(const std::string &name, LAMMPS *lmp, && (*auto_convert & REAL2METAL)) { *auto_convert = REAL2METAL; } else { - error->one(FLERR, fmt::format("Potential file {} requires {} units " + error->one(FLERR, "Potential file {} requires {} units " "but {} units are in use", name, - units, unit_style)); + units, unit_style); return nullptr; } } diff --git a/src/variable.cpp b/src/variable.cpp index 3e93a33797..dfe5494c3f 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -534,8 +534,8 @@ void Variable::set(int narg, char **arg) if (replaceflag) return; if (!utils::is_id(arg[0])) - error->all(FLERR,fmt::format("Variable name '{}' must have only alphanu" - "meric characters or underscores",arg[0])); + error->all(FLERR,"Variable name '{}' must have only alphanu" + "meric characters or underscores",arg[0]); names[nvar] = utils::strdup(arg[0]); nvar++; } @@ -606,8 +606,8 @@ int Variable::next(int narg, char **arg) for (int iarg = 0; iarg < narg; iarg++) { ivar = find(arg[iarg]); if (ivar < 0) - error->all(FLERR,fmt::format("Invalid variable '{}' in next command", - arg[iarg])); + error->all(FLERR,"Invalid variable '{}' in next command", + arg[iarg]); if (style[ivar] == ULOOP && style[find(arg[0])] == UNIVERSE) continue; else if (style[ivar] == UNIVERSE && style[find(arg[0])] == ULOOP) continue; else if (style[ivar] != style[find(arg[0])]) @@ -925,8 +925,8 @@ char *Variable::retrieve(const char *name) } else if (style[ivar] == PYTHON) { int ifunc = python->variable_match(data[ivar][0],name,0); if (ifunc < 0) - error->all(FLERR,fmt::format("Python variable {} does not match " - "Python function {}", name, data[ivar][0])); + error->all(FLERR,"Python variable {} does not match " + "Python function {}", name, data[ivar][0]); python->invoke_function(ifunc,data[ivar][1]); str = data[ivar][1]; // if Python func returns a string longer than VALUELENGTH @@ -5050,8 +5050,8 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : if (me == 0) { fp = fopen(file,"r"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open file variable file {}: {}", - file, utils::getsyserror())); + error->one(FLERR,"Cannot open file variable file {}: {}", + file, utils::getsyserror()); } // if atomfile-style variable, must store per-atom values read from file @@ -5188,12 +5188,12 @@ int VarReader::read_peratom() tag = words.next_bigint(); value = words.next_double(); } catch (TokenizerException &e) { - error->all(FLERR,fmt::format("Invalid atomfile line '{}': {}", - buf,e.what())); + error->all(FLERR,"Invalid atomfile line '{}': {}", + buf,e.what()); } if ((tag <= 0) || (tag > map_tag_max)) - error->all(FLERR,fmt::format("Invalid atom ID {} in variable " - "file", tag)); + error->all(FLERR,"Invalid atom ID {} in variable " + "file", tag); if ((m = atom->map(tag)) >= 0) vstore[m] = value; buf = next + 1; } diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index 79a99502a6..b0c547a7d6 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -52,8 +52,8 @@ void WriteCoeff::command(int narg, char **arg) FILE *one = fopen(file,"wb+"); if (one == nullptr) - error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", - file, utils::getsyserror())); + error->one(FLERR,"Cannot open coeff file {}: {}", + file, utils::getsyserror()); if (force->pair && force->pair->writedata) { fprintf(one,"# pair_style %s\npair_coeff\n",force->pair_style); @@ -86,8 +86,8 @@ void WriteCoeff::command(int narg, char **arg) FILE *two = fopen(file+4,"w"); if (two == nullptr) - error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", - file+4, utils::getsyserror())); + error->one(FLERR,"Cannot open coeff file {}: {}", + file+4, utils::getsyserror()); fprintf(two,"# LAMMPS coeff file via write_coeff, version %s\n", lmp->version); diff --git a/src/write_data.cpp b/src/write_data.cpp index 388fab1183..3db35190b5 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -175,8 +175,8 @@ void WriteData::write(const std::string &file) if (me == 0) { fp = fopen(file.c_str(),"w"); if (fp == nullptr) - error->one(FLERR,fmt::format("Cannot open data file {}: {}", - file, utils::getsyserror())); + error->one(FLERR,"Cannot open data file {}: {}", + file, utils::getsyserror()); } // proc 0 writes header, ntype-length arrays, force fields diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 350f083be2..45a0267d19 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -231,8 +231,8 @@ void WriteRestart::write(std::string file) fp = fopen(base.c_str(),"wb"); if (fp == nullptr) - error->one(FLERR, fmt::format("Cannot open restart file {}: {}", - base, utils::getsyserror())); + error->one(FLERR, "Cannot open restart file {}: {}", + base, utils::getsyserror()); } // proc 0 writes magic string, endian flag, numeric version @@ -294,8 +294,8 @@ void WriteRestart::write(std::string file) if (filewriter) { fp = fopen(multiname.c_str(),"wb"); if (fp == nullptr) - error->one(FLERR, fmt::format("Cannot open restart file {}: {}", - multiname, utils::getsyserror())); + error->one(FLERR, "Cannot open restart file {}: {}", + multiname, utils::getsyserror()); write_int(PROCSPERFILE,nclusterprocs); } }