Update force->inumeric to utils::inumeric

This commit is contained in:
Richard Berger
2020-09-01 12:57:47 -04:00
parent 9d3e3526a0
commit 40ea03234f
10 changed files with 20 additions and 20 deletions

View File

@ -15,7 +15,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -173,7 +173,7 @@ int DumpAtomGZ::modify_param(int narg, char **arg)
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int min_level = Z_DEFAULT_COMPRESSION; int min_level = Z_DEFAULT_COMPRESSION;
int max_level = Z_BEST_COMPRESSION; int max_level = Z_BEST_COMPRESSION;
compression_level = force->inumeric(FLERR,arg[1]); compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
if (compression_level < min_level || compression_level > max_level) if (compression_level < min_level || compression_level > max_level)
error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level));
return 2; return 2;

View File

@ -21,7 +21,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -181,7 +181,7 @@ int DumpAtomZstd::modify_param(int narg, char **arg)
return 2; return 2;
} else if (strcmp(arg[0],"compression_level") == 0) { } else if (strcmp(arg[0],"compression_level") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int compression_level = force->inumeric(FLERR,arg[1]); int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
writer.setCompressionLevel(compression_level); writer.setCompressionLevel(compression_level);
return 2; return 2;
} }

View File

@ -16,7 +16,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -181,7 +181,7 @@ int DumpCFGGZ::modify_param(int narg, char **arg)
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int min_level = Z_DEFAULT_COMPRESSION; int min_level = Z_DEFAULT_COMPRESSION;
int max_level = Z_BEST_COMPRESSION; int max_level = Z_BEST_COMPRESSION;
compression_level = force->inumeric(FLERR,arg[1]); compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
if (compression_level < min_level || compression_level > max_level) if (compression_level < min_level || compression_level > max_level)
error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level));
return 2; return 2;

View File

@ -21,7 +21,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -183,7 +183,7 @@ int DumpCFGZstd::modify_param(int narg, char **arg)
return 2; return 2;
} else if (strcmp(arg[0],"compression_level") == 0) { } else if (strcmp(arg[0],"compression_level") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int compression_level = force->inumeric(FLERR,arg[1]); int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
writer.setCompressionLevel(compression_level); writer.setCompressionLevel(compression_level);
return 2; return 2;
} }

View File

@ -15,7 +15,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -173,7 +173,7 @@ int DumpCustomGZ::modify_param(int narg, char **arg)
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int min_level = Z_DEFAULT_COMPRESSION; int min_level = Z_DEFAULT_COMPRESSION;
int max_level = Z_BEST_COMPRESSION; int max_level = Z_BEST_COMPRESSION;
compression_level = force->inumeric(FLERR,arg[1]); compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
if (compression_level < min_level || compression_level > max_level) if (compression_level < min_level || compression_level > max_level)
error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level));
return 2; return 2;

View File

@ -21,7 +21,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -181,7 +181,7 @@ int DumpCustomZstd::modify_param(int narg, char **arg)
return 2; return 2;
} else if (strcmp(arg[0],"compression_level") == 0) { } else if (strcmp(arg[0],"compression_level") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int compression_level = force->inumeric(FLERR,arg[1]); int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
writer.setCompressionLevel(compression_level); writer.setCompressionLevel(compression_level);
return 2; return 2;
} }

View File

@ -15,7 +15,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -188,7 +188,7 @@ int DumpLocalGZ::modify_param(int narg, char **arg)
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int min_level = Z_DEFAULT_COMPRESSION; int min_level = Z_DEFAULT_COMPRESSION;
int max_level = Z_BEST_COMPRESSION; int max_level = Z_BEST_COMPRESSION;
compression_level = force->inumeric(FLERR,arg[1]); compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
if (compression_level < min_level || compression_level > max_level) if (compression_level < min_level || compression_level > max_level)
error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level));
return 2; return 2;

View File

@ -21,7 +21,7 @@
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -181,7 +181,7 @@ int DumpLocalZstd::modify_param(int narg, char **arg)
return 2; return 2;
} else if (strcmp(arg[0],"compression_level") == 0) { } else if (strcmp(arg[0],"compression_level") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int compression_level = force->inumeric(FLERR,arg[1]); int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
writer.setCompressionLevel(compression_level); writer.setCompressionLevel(compression_level);
return 2; return 2;
} }

View File

@ -14,7 +14,7 @@
#include "dump_xyz_gz.h" #include "dump_xyz_gz.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -152,7 +152,7 @@ int DumpXYZGZ::modify_param(int narg, char **arg)
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int min_level = Z_DEFAULT_COMPRESSION; int min_level = Z_DEFAULT_COMPRESSION;
int max_level = Z_BEST_COMPRESSION; int max_level = Z_BEST_COMPRESSION;
compression_level = force->inumeric(FLERR,arg[1]); compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
if (compression_level < min_level || compression_level > max_level) if (compression_level < min_level || compression_level > max_level)
error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level));
return 2; return 2;

View File

@ -20,7 +20,7 @@
#include "dump_xyz_zstd.h" #include "dump_xyz_zstd.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
#include "force.h" #include "utils.h"
#include <cstring> #include <cstring>
#include "fmt/format.h" #include "fmt/format.h"
@ -156,7 +156,7 @@ int DumpXYZZstd::modify_param(int narg, char **arg)
return 2; return 2;
} else if (strcmp(arg[0],"compression_level") == 0) { } else if (strcmp(arg[0],"compression_level") == 0) {
if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
int compression_level = force->inumeric(FLERR,arg[1]); int compression_level = utils::inumeric(FLERR, arg[1], false, lmp);
writer.setCompressionLevel(compression_level); writer.setCompressionLevel(compression_level);
return 2; return 2;
} }