diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index 9ba59b6995c759478e1546902b5dc2bd2052841c..30d8ab64b60f086c89d328402aa0b2ba8c45c282 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -65,8 +65,12 @@ PairLJCharmmfswCoulLong::PairLJCharmmfswCoulLong(LAMMPS *lmp) : Pair(lmp) // switch qqr2e from LAMMPS value to CHARMM value - if (strcmp(update->unit_style,"real") == 0) + if (strcmp(update->unit_style,"real") == 0) { + if ((comm->me == 0) && (force->qqr2e != force->qqr2e_charmm_real)) + error->message(FLERR,"Switching to CHARMM coulomb energy" + " conversion constant"); force->qqr2e = force->qqr2e_charmm_real; + } } /* ---------------------------------------------------------------------- */ @@ -96,8 +100,12 @@ PairLJCharmmfswCoulLong::~PairLJCharmmfswCoulLong() // switch qqr2e back from CHARMM value to LAMMPS value - if (strcmp(update->unit_style,"real") == 0) + if (update && strcmp(update->unit_style,"real") == 0) { + if ((comm->me == 0) && (force->qqr2e == force->qqr2e_charmm_real)) + error->message(FLERR,"Restoring original LAMMPS coulomb energy" + " conversion constant"); force->qqr2e = force->qqr2e_lammps_real; + } } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp index f1366a379d03100a429f1e901ed62c7b47f65f85..0d2159b671ddf84969954c78b809ebef065ea560 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp @@ -50,8 +50,12 @@ PairLJCharmmfswCoulCharmmfsh::PairLJCharmmfswCoulCharmmfsh(LAMMPS *lmp) : // switch qqr2e from LAMMPS value to CHARMM value - if (strcmp(update->unit_style,"real") == 0) + if (strcmp(update->unit_style,"real") == 0) { + if ((comm->me == 0) && (force->qqr2e != force->qqr2e_charmm_real)) + error->message(FLERR,"Switching to CHARMM coulomb energy" + " conversion constant"); force->qqr2e = force->qqr2e_charmm_real; + } } /* ---------------------------------------------------------------------- */ @@ -80,8 +84,12 @@ PairLJCharmmfswCoulCharmmfsh::~PairLJCharmmfswCoulCharmmfsh() // switch qqr2e back from CHARMM value to LAMMPS value - if (strcmp(update->unit_style,"real") == 0) + if (update && strcmp(update->unit_style,"real") == 0) { + if ((comm->me == 0) && (force->qqr2e == force->qqr2e_charmm_real)) + error->message(FLERR,"Restoring original LAMMPS coulomb energy" + " conversion constant"); force->qqr2e = force->qqr2e_lammps_real; + } } /* ---------------------------------------------------------------------- */