error messages

This commit is contained in:
Jacob Gissinger
2021-12-07 23:32:14 -05:00
parent de635cc68d
commit 83a978d69b
8 changed files with 91 additions and 42 deletions

View File

@ -329,6 +329,11 @@ E: KSpace style has not yet been set
Cannot use kspace_modify command until a kspace style is set.
E: Labelmap command before simulation box is defined
The labelmap command cannot be used before a read_data, read_restart,
or create_box command.
E: Mass command before simulation box is defined
The mass command cannot be used before a read_data, read_restart, or

View File

@ -107,7 +107,7 @@ void LabelMap::modify_lmap(int narg, char **arg)
if (isdigit(slabel[0]))
error->all(FLERR,"Type labels cannot start with a number");
if (search(slabel,(*labels_map)) != -1)
error->all(FLERR,"Type label already exists: types labels must be unique");
error->all(FLERR,"Type label already exists: type labels must be unique");
std::string &str = (*labels)[itype-1];
if (!str.empty()) (*labels_map).erase(str);
str = slabel;

View File

@ -79,4 +79,13 @@ E: Topology type exceeds system topology type
The number of bond, angle, etc types exceeds the system setting. See
the create_box or read_data command for how to specify these values.
E: Type label already exists: type labels must be unique
For a given type-kind (atom types, bond types, etc.), a given type
label can be assigned to only one numeric type.
E: Type labels cannot start with a number
Self-explanatory.
*/

View File

@ -1305,8 +1305,8 @@ void ReadData::atoms()
eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world);
if (eof) error->all(FLERR,"Unexpected end of data file");
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
atom->data_atoms(nchunk,buffer,id_offset,mol_offset,toffset,
shiftflag,shift,tlabelflag,lmap->lmap2lmap.atom);
nread += nchunk;
@ -1423,8 +1423,8 @@ void ReadData::bonds(int firstpass)
eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world);
if (eof) error->all(FLERR,"Unexpected end of data file");
if (blabelflag && !lmap->is_complete(Atom::BOND))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
atom->data_bonds(nchunk,buffer,count,id_offset,boffset,
blabelflag,lmap->lmap2lmap.bond);
nread += nchunk;
@ -1501,8 +1501,8 @@ void ReadData::angles(int firstpass)
eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world);
if (eof) error->all(FLERR,"Unexpected end of data file");
if (alabelflag && !lmap->is_complete(Atom::ANGLE))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
atom->data_angles(nchunk,buffer,count,id_offset,aoffset,
alabelflag,lmap->lmap2lmap.angle);
nread += nchunk;
@ -1579,8 +1579,8 @@ void ReadData::dihedrals(int firstpass)
eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world);
if (eof) error->all(FLERR,"Unexpected end of data file");
if (dlabelflag && !lmap->is_complete(Atom::DIHEDRAL))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
atom->data_dihedrals(nchunk,buffer,count,id_offset,doffset,
dlabelflag,lmap->lmap2lmap.dihedral);
nread += nchunk;
@ -1657,8 +1657,8 @@ void ReadData::impropers(int firstpass)
eof = utils::read_lines_from_file(fp,nchunk,MAXLINE,buffer,me,world);
if (eof) error->all(FLERR,"Unexpected end of data file");
if (ilabelflag && !lmap->is_complete(Atom::IMPROPER))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
atom->data_impropers(nchunk,buffer,count,id_offset,ioffset,
ilabelflag,lmap->lmap2lmap.improper);
nread += nchunk;
@ -1854,8 +1854,8 @@ void ReadData::mass()
int eof = utils::read_lines_from_file(fp,ntypes,MAXLINE,buf,me,world);
if (eof) error->all(FLERR,"Unexpected end of data file");
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
char *original = buf;
for (int i = 0; i < ntypes; i++) {
@ -1878,8 +1878,8 @@ void ReadData::paircoeffs()
if (eof) error->all(FLERR,"Unexpected end of data file");
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
char *original = buf;
for (int i = 0; i < ntypes; i++) {
@ -1908,8 +1908,8 @@ void ReadData::pairIJcoeffs()
if (eof) error->all(FLERR,"Unexpected end of data file");
if (tlabelflag && !lmap->is_complete(Atom::ATOM))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
char *original = buf;
for (i = 0; i < ntypes; i++)
@ -1938,8 +1938,8 @@ void ReadData::bondcoeffs()
if (eof) error->all(FLERR,"Unexpected end of data file");
if (blabelflag && !lmap->is_complete(Atom::BOND))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
char *original = buf;
for (int i = 0; i < nbondtypes; i++) {
@ -1967,8 +1967,8 @@ void ReadData::anglecoeffs(int which)
if (eof) error->all(FLERR,"Unexpected end of data file");
if (alabelflag && !lmap->is_complete(Atom::ANGLE))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
char *original = buf;
for (int i = 0; i < nangletypes; i++) {
@ -2000,8 +2000,8 @@ void ReadData::dihedralcoeffs(int which)
if (eof) error->all(FLERR,"Unexpected end of data file");
if (dlabelflag && !lmap->is_complete(Atom::DIHEDRAL))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
char *original = buf;
for (int i = 0; i < ndihedraltypes; i++) {
@ -2040,8 +2040,8 @@ void ReadData::impropercoeffs(int which)
if (eof) error->all(FLERR,"Unexpected end of data file");
if (ilabelflag && !lmap->is_complete(Atom::IMPROPER))
error->all(FLERR,"Label map is incomplete. "
"All types must be assigned a unique type label.");
error->all(FLERR,"Label map is incomplete: "
"all types must be assigned a unique type label");
char *original = buf;
for (int i = 0; i < nimpropertypes; i++) {

View File

@ -367,6 +367,12 @@ E: Invalid data file section: EndBondTorsion Coeffs
Atom style does not allow dihedrals.
E: Label map is incomplete: all types must be assigned a unique type label
For a given type-kind (atom types, bond types, etc.) to be written to
the data file, all associated types must be assigned a type label, and
each type label can be assigned to only one numeric type.
E: Must define dihedral_style before EndBondTorsion Coeffs
Must use a dihedral_style command before reading a data file that

View File

@ -223,6 +223,11 @@ E: All variables in next command must have same style
UNDOCUMENTED
E: Invalid type label in variable formula
Argument of a labelmap function must be a valid type label that has
been assigned to a numeric type.
E: Invalid variable style with next command
Variable styles {equal} and {world} cannot be used in a next