diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index d1e2e93ce1..d23215a9b9 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -375,6 +375,9 @@ void PairList::init_style() if (atom->tag_enable == 0) error->all(FLERR,"Pair style list requires atom IDs"); + if (atom->map_style == 0) + error->all(FLERR,"Pair style list requires an atom map"); + if (offset_flag) { for (int n=0; n < npairs; ++n) { list_parm_t &par = params[n]; diff --git a/src/USER-MISC/pair_list.h b/src/USER-MISC/pair_list.h index 8869a52f52..9d199f5ba7 100644 --- a/src/USER-MISC/pair_list.h +++ b/src/USER-MISC/pair_list.h @@ -74,5 +74,43 @@ class PairList : public Pair { /* ERROR/WARNING messages: +E: Not all pairs processed in pair_style list + +Not all interacting pairs for which coefficients were found. This can be intentional +and then you need to set the 'nocheck' option. If not, it usually means that the +communication cutoff is too small. This can be ameliorated by either increasing +the cutoff in the pair_style command or the communication cutoff. + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Cannot open pair list file + +Self-explanatory. The file with the list of pairs cannot be open for reading. +Check the path and permissions. + +E: Incorrectly formatted ... + +Self-explanatory. The content of the pair list file does not match the documented +format. Please re-read the documentation and carefully compare it to your file. + +E: Unknown pair list potential style + +Self-explanatory. You requested a potential type that is not yet implemented or have a typo. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +E: Pair style list requires atom IDs + +Self-explanatory. The pairs in the list are identified via atom IDs, so they need to be present. + +E: Pair style list requires an atom map + +Self-explanatory. Atoms are looked up via an atom map. Create one using the atom_style map command. */ diff --git a/src/atom.h b/src/atom.h index 375417942f..4d617585ae 100644 --- a/src/atom.h +++ b/src/atom.h @@ -1,4 +1,4 @@ -/* ---------------------------------------------------------------------- +/* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov @@ -185,10 +185,12 @@ class Atom : protected Pointers { // functions for global to local ID mapping // map lookup function inlined for efficiency + // return -1 if no map defined inline int map(int global) { if (map_style == 1) return map_array[global]; - else return map_find_hash(global); + else if (map_style == 2) return map_find_hash(global); + else return -1; }; void map_init();