more error reporting updates

This commit is contained in:
Axel Kohlmeyer
2025-03-20 12:05:50 -04:00
parent e4c96459e5
commit 3b61bcf890
6 changed files with 110 additions and 86 deletions

View File

@ -1010,8 +1010,8 @@ void ComputeChunkAtom::assign_chunk_ids()
} else if (which == ArgInfo::FIX) {
if (update->ntimestep % fchunk->peratom_freq)
error->all(FLERR, Error::NOLASTLINE,
"Fix used in compute chunk/atom not computed at compatible time" +
utils::errorurl(7));
"Fix {} used in compute chunk/atom not computed at compatible time{}",
fchunk->id, utils::errorurl(7));
if (argindex == 0) {
double *vec = fchunk->vector_atom;

View File

@ -170,8 +170,8 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR, val.iarg, "Fix ID {} for compute global/atom compute does not "
"calculate a global array", val.id);
if (val.argindex > val.val.f->size_array_cols)
error->all(FLERR, val.iarg, "Compute global/atom fix {} array is accessed out-of-range{}",
val.id, utils::errorurl(20));
error->all(FLERR, val.iarg, "Compute global/atom fix {} array is accessed "
"out-of-range{}", val.id, utils::errorurl(20));
}
} else if (val.which == ArgInfo::VARIABLE) {

View File

@ -34,7 +34,7 @@ ComputeReduceRegion::ComputeReduceRegion(LAMMPS *lmp, int narg, char **arg) :
ComputeReduce(lmp, narg, arg)
{
if (input_mode == LOCAL)
error->all(FLERR, "Compute reduce/region cannot use local data as input");
error->all(FLERR, Error::NOPOINTER, "Compute reduce/region cannot use local data as input");
}
/* ----------------------------------------------------------------------
@ -129,7 +129,8 @@ double ComputeReduceRegion::compute_one(int m, int flag)
} else if (val.which == ArgInfo::FIX) {
if (update->ntimestep % val.val.f->peratom_freq)
error->all(FLERR, "Fix {} used in compute {} not computed at compatible time", val.id, style);
error->all(FLERR, Error::NOLASTLINE, "Fix {} used in compute {} not computed at compatible"
" time{}", val.id, style, utils::errorurl(7));
if (aidx == 0) {
double *fix_vector = val.val.f->vector_atom;

View File

@ -223,14 +223,15 @@ void Dump::init()
if (sort_flag) {
if (multiproc > 1)
error->all(FLERR,
error->all(FLERR, Error::NOLASTLINE,
"Cannot sort dump when 'nfile' or 'fileper' keywords have non-default values");
if (sortcol == 0 && atom->tag_enable == 0)
error->all(FLERR,"Cannot sort dump on atom IDs with no atom IDs defined");
error->all(FLERR, Error::NOLASTLINE,
"Cannot sort dump on atom IDs with no atom IDs defined");
if (sortcol && sortcol > size_one)
error->all(FLERR,"Dump sort column index {} is invalid", sortcol);
error->all(FLERR, Error::NOLASTLINE, "Dump sort column index {} is invalid", sortcol);
if ((sortcol != 0) && (has_id == 0) && (me == 0))
error->warning(FLERR,"Dump {} includes no atom IDs and is not sorted by ID. "
error->warning(FLERR, "Dump {} includes no atom IDs and is not sorted by ID. "
"This may complicate post-processing tasks or visualization", id);
if (nprocs > 1 && irregular == nullptr)
irregular = new Irregular(lmp);
@ -290,16 +291,18 @@ void Dump::init()
if (refreshflag) {
irefresh = modify->get_compute_by_id(idrefresh);
if (!irefresh) error->all(FLERR,"Dump could not find refresh compute ID {}", idrefresh);
if (!irefresh)
error->all(FLERR, Error::NOLASTLINE, "Dump could not find refresh compute ID {}", idrefresh);
}
// if skipflag, check skip variable
if (skipflag) {
skipindex = input->variable->find(skipvar);
if (skipindex < 0) error->all(FLERR,"Dump skip variable not found");
if (skipindex < 0)
error->all(FLERR, Error::NOLASTLINE, "Dump skip variable {} not found", skipvar);
if (!input->variable->equalstyle(skipindex))
error->all(FLERR,"Variable for dump skip is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable {} for dump skip is invalid style", skipvar);
}
// preallocation for PBC copies if requested
@ -389,7 +392,7 @@ void Dump::write()
if (nmax*size_one > maxbuf) {
if ((bigint) nmax * size_one > MAXSMALLINT)
error->all(FLERR,"Too much per-proc info for dump");
error->all(FLERR, Error::NOLASTLINE, "Too much per-proc data for dump");
maxbuf = nmax * size_one;
memory->destroy(buf);
memory->create(buf,maxbuf,"dump:buf");
@ -457,7 +460,8 @@ void Dump::write()
nsme = convert_string(nme,buf);
int nsmin,nsmax;
MPI_Allreduce(&nsme,&nsmin,1,MPI_INT,MPI_MIN,world);
if (nsmin < 0) error->all(FLERR,"Too much buffered per-proc info for dump");
if (nsmin < 0)
error->all(FLERR, Error::NOLASTLINE, "Too much buffered per-proc data for dump");
if (multiproc != nprocs)
MPI_Allreduce(&nsme,&nsmax,1,MPI_INT,MPI_MAX,world);
else nsmax = nsme;
@ -534,7 +538,8 @@ void Dump::write()
if (filewriter && fp != nullptr) write_footer();
if (fp && ferror(fp)) error->one(FLERR,"Error writing dump {}: {}", id, utils::getsyserror());
if (fp && ferror(fp))
error->one(FLERR, Error::NOLASTLINE, "Error writing dump {}: {}", id, utils::getsyserror());
// if file per timestep, close file if I am filewriter
@ -596,7 +601,9 @@ void Dump::openfile()
fp = fopen(filecurrent,"w");
}
if (fp == nullptr) error->one(FLERR,"Cannot open dump file");
if (fp == nullptr)
error->one(FLERR, Error::NOLASTLINE, "Cannot open dump file {}:{}",
filecurrent, utils::getsyserror());
} else fp = nullptr;
// delete string with timestep replaced
@ -1068,7 +1075,7 @@ void Dump::modify_params(int narg, char **arg)
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify buffer", error);
buffer_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
if (buffer_flag && buffer_allow == 0)
error->all(FLERR,"Dump_modify buffer yes not allowed for this style");
error->all(FLERR, iarg + 2, "Dump_modify buffer yes not allowed for this style");
iarg += 2;
} else if (strcmp(arg[iarg],"colname") == 0) {
@ -1091,7 +1098,7 @@ void Dump::modify_params(int narg, char **arg)
}
}
if ((icol < 0) || (icol >= (int)keyword_user.size()))
error->all(FLERR, "Incorrect dump_modify arguments: {} {} {}",
error->all(FLERR, Error::NOPOINTER, "Incorrect dump_modify arguments: {} {} {}",
arg[iarg], arg[iarg+1], arg[iarg+2]);
keyword_user[icol] = arg[iarg+2];
iarg += 3;
@ -1136,7 +1143,8 @@ void Dump::modify_params(int narg, char **arg)
delta = 0.0;
} else {
delta = utils::numeric(FLERR,arg[iarg+1],false,lmp);
if (delta <= 0.0) error->all(FLERR, "Invalid dump_modify every/time argument: {}", delta);
if (delta <= 0.0)
error->all(FLERR, iarg + 1, "Invalid dump_modify every/time argument: {}", delta);
}
output->mode_dump[idump] = 1;
output->every_time_dump[idump] = delta;
@ -1146,9 +1154,9 @@ void Dump::modify_params(int narg, char **arg)
} else if (strcmp(arg[iarg],"fileper") == 0) {
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify fileper", error);
if (!multiproc)
error->all(FLERR,"Cannot use dump_modify fileper without % in dump file name");
error->all(FLERR, iarg, "Cannot use dump_modify fileper without % in dump file name");
int nper = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
if (nper <= 0) error->all(FLERR, "Invalid dump_modify fileper argument: {}", nper);
if (nper <= 0) error->all(FLERR, iarg + 1, "Invalid dump_modify fileper argument: {}", nper);
multiproc = nprocs/nper;
if (nprocs % nper) multiproc++;
@ -1206,7 +1214,8 @@ void Dump::modify_params(int narg, char **arg)
iarg += 3;
} else { // pass other format options to child classes
int n = modify_param(narg-iarg,&arg[iarg]);
if (n == 0) error->all(FLERR,"Unknown dump_modify format keyword: {}", arg[iarg+1]);
if (n == 0)
error->all(FLERR, iarg + 1, "Unknown dump_modify format keyword: {}", arg[iarg+1]);
iarg += n;
}
@ -1218,7 +1227,7 @@ void Dump::modify_params(int narg, char **arg)
} else if (strcmp(arg[iarg],"maxfiles") == 0) {
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "dump_modify maxfiles", error);
if (!multifile)
error->all(FLERR,"Cannot use dump_modify maxfiles without * in dump file name");
error->all(FLERR, "Cannot use dump_modify maxfiles without * in dump file name");
// wipe out existing storage
if (maxfiles > 0) {
for (int idx=0; idx < numfiles; ++idx)

View File

@ -67,7 +67,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
gbuf(nullptr), avec_line(nullptr), avec_tri(nullptr), avec_body(nullptr), fixptr(nullptr),
image(nullptr), chooseghost(nullptr), bufcopy(nullptr)
{
if (binary || multiproc) error->all(FLERR, "Invalid dump image filename");
if (binary || multiproc)
error->all(FLERR, 4, "Invalid dump image filename {}", filename);
// force binary flag on to avoid corrupted output on Windows
@ -89,16 +90,18 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
#ifndef LAMMPS_JPEG
if (filetype == JPG)
error->all(FLERR,"Support for writing images in JPEG format not included");
error->all(FLERR, Error::NOLASTLINE, "Support for writing images in JPEG format not included");
#endif
#ifndef LAMMPS_PNG
if (filetype == PNG)
error->all(FLERR,"Support for writing images in PNG format not included");
error->all(FLERR, Error::NOLASTLINE, "Support for writing images in PNG format not included");
#endif
// atom color,diameter settings
if (nfield != 2) error->all(FLERR,"Illegal dump image command");
if (nfield != 2)
error->all(FLERR, Error::NOPOINTER,
"Dump image command is missing attributes for color and size");
acolor = ATTRIBUTE;
if (strcmp(arg[5],"type") == 0) acolor = TYPE;
@ -147,45 +150,48 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
int iarg = ioptional;
while (iarg < narg) {
if (strcmp(arg[iarg],"atom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+2 > narg) utils::missing_cmd_args(FLERR,"dump image atom", error);
atomflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
iarg += 2;
} else if (strcmp(arg[iarg],"adiam") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+2 > narg) utils::missing_cmd_args(FLERR,"dump image adiam", error);
adiam = NUMERIC;
adiamvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp);
if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
if (adiamvalue <= 0.0)
error->all(FLERR, iarg+1, "Illegal dump image adiam value {}", adiamvalue);
iarg += 2;
} else if (strcmp(arg[iarg],"bond") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+3 > narg) utils::missing_cmd_args(FLERR,"dump image bond", error);
if (atom->nbondtypes == 0)
error->all(FLERR,"Dump image bond not allowed with no bond types");
error->all(FLERR, iarg, "Dump image bond not allowed with no bond types defined");
bondflag = YES;
if (strcmp(arg[iarg+1],"none") == 0) bondflag = NO;
else if (strcmp(arg[iarg+1],"atom") == 0) bcolor = ATOM;
else if (strcmp(arg[iarg+1],"type") == 0) bcolor = TYPE;
else error->all(FLERR,"Illegal dump image command");
else error->all(FLERR, iarg + 1, "Unknown dump image bond color setting {}", arg[iarg + 1]);
if (!islower(arg[iarg+2][0])) {
bdiam = NUMERIC;
bdiamvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp);
if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
if (bdiamvalue <= 0.0)
error->all(FLERR, iarg + 2,"Illegal dump image bond diameter value {}", bdiamvalue);
} else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM;
else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE;
else if (strcmp(arg[iarg+2],"none") == 0) bondflag = NO;
else error->all(FLERR,"Illegal dump image command");
else error->all(FLERR, iarg + 2, "Unknown dump image bond diameter setting {}", arg[iarg+2]);
iarg += 3;
} else if (strcmp(arg[iarg],"grid") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+2 > narg) utils::missing_cmd_args(FLERR,"dump image grid", error);
gridflag = YES;
char *id;
int igrid,idata,index;
int iflag = utils::check_grid_reference((char *) "Dump image", arg[iarg+1], nevery, id,
igrid,idata,index,lmp);
if (iflag < 0) error->all(FLERR,"Invalid grid reference in dump image command");
if (iflag < 0)
error->all(FLERR, iarg+1, "Invalid grid reference {} in dump image command", arg[iarg+1]);
if (iflag == ArgInfo::COMPUTE) {
delete[] id_grid_compute;
@ -201,7 +207,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"line") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+3 > narg) utils::missing_cmd_args(FLERR,"dump image line", error);
lineflag = YES;
if (strcmp(arg[iarg+1],"type") == 0) lcolor = TYPE;
else error->all(FLERR,"Illegal dump image command");
@ -210,7 +216,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 3;
} else if (strcmp(arg[iarg],"tri") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+4 > narg) utils::missing_cmd_args(FLERR,"dump image tri", error);
triflag = YES;
if (strcmp(arg[iarg+1],"type") == 0) tcolor = TYPE;
else error->all(FLERR,"Illegal dump image command");
@ -219,7 +225,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 4;
} else if (strcmp(arg[iarg],"body") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+4 > narg) utils::missing_cmd_args(FLERR,"dump image body", error);
bodyflag = YES;
if (strcmp(arg[iarg+1],"type") == 0) bodycolor = TYPE;
else error->all(FLERR,"Illegal dump image command");
@ -228,7 +234,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 4;
} else if (strcmp(arg[iarg],"fix") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+5 > narg) utils::missing_cmd_args(FLERR,"dump image fix", error);
fixflag = YES;
fixID = arg[iarg+1];
if (strcmp(arg[iarg+2],"type") == 0) fixcolor = TYPE;
@ -238,7 +244,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 5;
} else if (strcmp(arg[iarg],"size") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+3 > narg) utils::missing_cmd_args(FLERR,"dump image size", error);
int width = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
int height = utils::inumeric(FLERR,arg[iarg+2],false,lmp);
if (width <= 0 || height <= 0) error->all(FLERR,"Illegal dump image command");
@ -252,7 +258,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 3;
} else if (strcmp(arg[iarg],"view") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+3 > narg) utils::missing_cmd_args(FLERR,"dump image view", error);
if (utils::strmatch(arg[iarg+1],"^v_")) {
delete[] thetastr;
thetastr = utils::strdup(arg[iarg+1]+2);
@ -271,7 +277,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 3;
} else if (strcmp(arg[iarg],"center") == 0) {
if (iarg+5 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+5 > narg) utils::missing_cmd_args(FLERR,"dump image center", error);
if (strcmp(arg[iarg+1],"s") == 0) cflag = STATIC;
else if (strcmp(arg[iarg+1],"d") == 0) cflag = DYNAMIC;
else error->all(FLERR,"Illegal dump image command");
@ -293,7 +299,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 5;
} else if (strcmp(arg[iarg],"up") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+4 > narg) utils::missing_cmd_args(FLERR,"dump image up", error);
if (utils::strmatch(arg[iarg+1],"^v_")) {
delete[] upxstr;
upxstr = utils::strdup(arg[iarg+1]+2);
@ -309,7 +315,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 4;
} else if (strcmp(arg[iarg],"zoom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+2 > narg) utils::missing_cmd_args(FLERR,"dump image zoom", error);
if (utils::strmatch(arg[iarg+1],"^v_")) {
delete[] zoomstr;
zoomstr = utils::strdup(arg[iarg+1]+2);
@ -321,14 +327,14 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"box") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+3 > narg) utils::missing_cmd_args(FLERR,"dump image box", error);
boxflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
boxdiam = utils::numeric(FLERR,arg[iarg+2],false,lmp);
if (boxdiam < 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 3;
} else if (strcmp(arg[iarg],"axes") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+3 > narg) utils::missing_cmd_args(FLERR,"dump image axes", error);
axesflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
axeslen = utils::numeric(FLERR,arg[iarg+2],false,lmp);
axesdiam = utils::numeric(FLERR,arg[iarg+3],false,lmp);
@ -337,14 +343,14 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 4;
} else if (strcmp(arg[iarg],"subbox") == 0) {
if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+3 > narg) utils::missing_cmd_args(FLERR,"dump image subbox", error);
subboxflag = utils::logical(FLERR,arg[iarg+1],false,lmp);
subboxdiam = utils::numeric(FLERR,arg[iarg+2],false,lmp);
if (subboxdiam < 0.0) error->all(FLERR,"Illegal dump image command");
iarg += 3;
} else if (strcmp(arg[iarg],"shiny") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+2 > narg) utils::missing_cmd_args(FLERR,"dump image shiny", error);
double shiny = utils::numeric(FLERR,arg[iarg+1],false,lmp);
if (shiny < 0.0 || shiny > 1.0)
error->all(FLERR,"Illegal dump image command");
@ -352,7 +358,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"fsaa") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
if (iarg+2 > narg) utils::missing_cmd_args(FLERR,"dump image fsaa", error);
int aa = utils::logical(FLERR, arg[iarg+1], false, lmp);
if (aa) {
if (!image->fsaa) {
@ -369,10 +375,10 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"ssao") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
if (iarg+4 > narg) utils::missing_cmd_args(FLERR,"dump image ssao", error);
image->ssao = utils::logical(FLERR,arg[iarg+1],false,lmp);
int seed = utils::inumeric(FLERR,arg[iarg+2],false,lmp);
if (seed <= 0) error->all(FLERR,"Illegal dump image command");
if (seed <= 0) error->all(FLERR, iarg + 2, "Illegal dump image ssao seed {}", seed);
image->seed = seed;
double ssaoint = utils::numeric(FLERR,arg[iarg+3],false,lmp);
if (ssaoint < 0.0 || ssaoint > 1.0)
@ -388,17 +394,17 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
if (lineflag) {
avec_line = dynamic_cast<AtomVecLine *>(atom->style_match("line"));
if (!avec_line)
error->all(FLERR,"Dump image line requires atom style line");
error->all(FLERR, Error::NOLASTLINE, "Dump image line requires atom style line");
}
if (triflag) {
avec_tri = dynamic_cast<AtomVecTri *>(atom->style_match("tri"));
if (!avec_tri)
error->all(FLERR,"Dump image tri requires atom style tri");
error->all(FLERR, Error::NOLASTLINE, "Dump image tri requires atom style tri");
}
if (bodyflag) {
avec_body = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
if (!avec_body)
error->all(FLERR,"Dump image body yes requires atom style body");
error->all(FLERR, Error::NOLASTLINE, "Dump image body yes requires atom style body");
}
extraflag = 0;
@ -406,7 +412,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
if (fixflag) {
fixptr = modify->get_fix_by_id(fixID);
if (!fixptr) error->all(FLERR,"Fix ID {} for dump image does not exist", fixID);
if (!fixptr)
error->all(FLERR, Error::NOLASTLINE, "Fix ID {} for dump image does not exist", fixID);
}
@ -507,8 +514,9 @@ DumpImage::~DumpImage()
void DumpImage::init_style()
{
if (multifile == 0 && !multifile_override)
error->all(FLERR,"Dump image requires one snapshot per file");
if (sort_flag) error->all(FLERR,"Dump image cannot perform sorting");
error->all(FLERR, Error::NOLASTLINE,
"Dump image requires file name with '*' requesting one snapshot per file");
if (sort_flag) error->all(FLERR, Error::NOLASTLINE, "Dump image cannot perform sorting");
DumpCustom::init_style();
@ -519,12 +527,15 @@ void DumpImage::init_style()
if (id_grid_compute) {
grid_compute = modify->get_compute_by_id(id_grid_compute);
if (!grid_compute)
error->all(FLERR,"Could not find dump image grid compute ID {}",id_grid_compute);
error->all(FLERR, Error::NOLASTLINE,
"Could not find dump image grid compute ID {}", id_grid_compute);
} else if (id_grid_fix) {
grid_fix = modify->get_fix_by_id(id_grid_fix);
if (!grid_fix) error->all(FLERR,"Could not find dump image fix ID {}",id_grid_fix);
if (!grid_fix)
error->all(FLERR, Error::NOLASTLINE, "Could not find dump image fix ID {}",id_grid_fix);
if (nevery % grid_fix->peratom_freq)
error->all(FLERR,"Dump image and grid fix not computed at compatible times");
error->all(FLERR, Error::NOLASTLINE, "Dump image and grid fix {} not computed at "
"compatible times{}", id_grid_fix, utils::errorurl(7));
}
}
@ -533,65 +544,65 @@ void DumpImage::init_style()
if (thetastr) {
thetavar = input->variable->find(thetastr);
if (thetavar < 0)
error->all(FLERR,"Variable name for dump image theta does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image theta does not exist");
if (!input->variable->equalstyle(thetavar))
error->all(FLERR,"Variable for dump image theta is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image theta is invalid style");
}
if (phistr) {
phivar = input->variable->find(phistr);
if (phivar < 0)
error->all(FLERR,"Variable name for dump image phi does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image phi does not exist");
if (!input->variable->equalstyle(phivar))
error->all(FLERR,"Variable for dump image phi is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image phi is invalid style");
}
if (cxstr) {
cxvar = input->variable->find(cxstr);
if (cxvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image center does not exist");
if (!input->variable->equalstyle(cxvar))
error->all(FLERR,"Variable for dump image center is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image center is invalid style");
}
if (cystr) {
cyvar = input->variable->find(cystr);
if (cyvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image center does not exist");
if (!input->variable->equalstyle(cyvar))
error->all(FLERR,"Variable for dump image center is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image center is invalid style");
}
if (czstr) {
czvar = input->variable->find(czstr);
if (czvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image center does not exist");
if (!input->variable->equalstyle(czvar))
error->all(FLERR,"Variable for dump image center is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image center is invalid style");
}
if (upxstr) {
upxvar = input->variable->find(upxstr);
if (upxvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upxvar))
error->all(FLERR,"Variable for dump image center is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image center is invalid style");
}
if (upystr) {
upyvar = input->variable->find(upystr);
if (upyvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upyvar))
error->all(FLERR,"Variable for dump image center is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image center is invalid style");
}
if (upzstr) {
upzvar = input->variable->find(upzstr);
if (upzvar < 0)
error->all(FLERR,"Variable name for dump image center does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image center does not exist");
if (!input->variable->equalstyle(upzvar))
error->all(FLERR,"Variable for dump image center is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image center is invalid style");
}
if (zoomstr) {
zoomvar = input->variable->find(zoomstr);
if (zoomvar < 0)
error->all(FLERR,"Variable name for dump image zoom does not exist");
error->all(FLERR, Error::NOLASTLINE, "Variable name for dump image zoom does not exist");
if (!input->variable->equalstyle(zoomvar))
error->all(FLERR,"Variable for dump image zoom is invalid style");
error->all(FLERR, Error::NOLASTLINE, "Variable for dump image zoom is invalid style");
}
// set up type -> element mapping
@ -600,7 +611,7 @@ void DumpImage::init_style()
for (int i = 1; i <= ntypes; i++) {
colorelement[i] = image->element2color(typenames[i]);
if (colorelement[i] == nullptr)
error->all(FLERR,"Invalid dump image element name");
error->all(FLERR, Error::NOLASTLINE, "Invalid dump image element name");
}
}
@ -608,7 +619,7 @@ void DumpImage::init_style()
for (int i = 1; i <= ntypes; i++) {
diamelement[i] = image->element2diam(typenames[i]);
if (diamelement[i] == 0.0)
error->all(FLERR,"Invalid dump image element name");
error->all(FLERR, Error::NOLASTLINE, "Invalid dump image element name");
}
}
}

View File

@ -187,7 +187,8 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS *lmp, int narg, char **arg) :
if (val.argindex && val.val.c->vector_flag == 0)
error->all(FLERR, val.iarg, "Fix ave/correlate compute {} does not calculate a vector", val.id);
if (val.argindex && val.argindex > val.val.c->size_vector)
error->all(FLERR, val.iarg, "Fix ave/correlate compute {} vector is accessed out-of-range", val.id);
error->all(FLERR, val.iarg, "Fix ave/correlate compute {} vector is accessed "
"out-of-range{}", val.id, utils::errorurl(20));
} else if (val.which == ArgInfo::FIX) {
val.val.f = modify->get_fix_by_id(val.id);
@ -197,9 +198,11 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS *lmp, int narg, char **arg) :
if (val.argindex && val.val.f->vector_flag == 0)
error->all(FLERR, val.iarg, "Fix ave/correlate fix {} does not calculate a vector", val.id);
if (val.argindex && val.argindex > val.val.f->size_vector)
error->all(FLERR, val.iarg, "Fix ave/correlate fix {} vector is accessed out-of-range", val.id);
error->all(FLERR, val.iarg, "Fix ave/correlate fix {} vector is accessed out-of-range{}",
val.id, utils::errorurl(20));
if (nevery % val.val.f->global_freq)
error->all(FLERR, val.iarg, "Fix {} for fix ave/correlate not computed at compatible time", val.id);
error->all(FLERR, val.iarg, "Fix {} for fix ave/correlate not computed at compatible "
"time{}", val.id, utils::errorurl(7));
} else if (val.which == ArgInfo::VARIABLE) {
val.val.v = input->variable->find(val.id.c_str());