From 9afbc71802fb6bde12dcd42b4bb97e4556ed6465 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 27 Jun 2020 10:19:57 -0400 Subject: [PATCH] only check for consistent cutoff and return it when flagged as kspace compatible --- src/pair_table.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 73b916f966..d8f1d75958 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -1033,11 +1033,15 @@ void *PairTable::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") != 0) return NULL; if (ntables == 0) error->all(FLERR,"All pair coeffs are not set"); - double cut_coul = tables[0].cut; - for (int m = 1; m < ntables; m++) - if (tables[m].cut != cut_coul) - error->all(FLERR, - "Pair table cutoffs must all be equal to use with KSpace"); - dim = 0; - return &tables[0].cut; + // only check for cutoff consistency if claiming to be KSpace compatible + + if (ewaldflag || pppmflag || msmflag || dispersionflag || tip4pflag) { + double cut_coul = tables[0].cut; + for (int m = 1; m < ntables; m++) + if (tables[m].cut != cut_coul) + error->all(FLERR, + "Pair table cutoffs must all be equal to use with KSpace"); + dim = 0; + return &tables[0].cut; + } else return NULL; }