diff --git a/src/FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/FEP/pair_lj_cut_tip4p_long_soft.cpp index 3cd374b1e4..7670449e0a 100644 --- a/src/FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -20,8 +20,6 @@ #include "pair_lj_cut_tip4p_long_soft.h" -#include -#include #include "angle.h" #include "atom.h" #include "bond.h" @@ -33,6 +31,8 @@ #include "memory.h" #include "error.h" +#include +#include using namespace LAMMPS_NS; @@ -460,9 +460,17 @@ void PairLJCutTIP4PLongSoft::init_style() // set alpha parameter - double theta = force->angle->equilibrium_angle(typeA); - double blen = force->bond->equilibrium_distance(typeB); + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); alpha = qdist / (cos(0.5*theta) * blen); + + const double mincut = cut_coul + qdist + blen + neighbor->skin; + if (comm->get_comm_cutoff() < mincut) { + if (comm->me == 0) + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P pair style", + mincut); + comm->cutghostuser = mincut; + } } /* ---------------------------------------------------------------------- diff --git a/src/FEP/pair_tip4p_long_soft.cpp b/src/FEP/pair_tip4p_long_soft.cpp index 5a04e29a5a..81a40c6098 100644 --- a/src/FEP/pair_tip4p_long_soft.cpp +++ b/src/FEP/pair_tip4p_long_soft.cpp @@ -20,8 +20,6 @@ #include "pair_tip4p_long_soft.h" -#include -#include #include "angle.h" #include "atom.h" #include "bond.h" @@ -33,6 +31,8 @@ #include "memory.h" #include "error.h" +#include +#include using namespace LAMMPS_NS; @@ -417,9 +417,17 @@ void PairTIP4PLongSoft::init_style() // set alpha parameter - double theta = force->angle->equilibrium_angle(typeA); - double blen = force->bond->equilibrium_distance(typeB); + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); alpha = qdist / (cos(0.5*theta) * blen); + + const double mincut = cut_coul + qdist + blen + neighbor->skin; + if (comm->get_comm_cutoff() < mincut) { + if (comm->me == 0) + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P pair style", + mincut); + comm->cutghostuser = mincut; + } } /* ---------------------------------------------------------------------- diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 85d14bbbbb..2e3518e059 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -186,12 +186,11 @@ void PairLJCutTIP4PLongGPU::init_style() cut_coulsq = cut_coul * cut_coul; double cut_coulplus = cut_coul + qdist + blen; double cut_coulsqplus = cut_coulplus * cut_coulplus; - if (maxcut < cut_coulsqplus) { cell_size = cut_coulplus + neighbor->skin; } - if (comm->cutghostuser < cell_size) { + if (maxcut < cut_coulsqplus) cell_size = cut_coulplus + neighbor->skin; + if (comm->get_comm_cutoff() < cell_size) { if (comm->me == 0) - error->warning(FLERR, - "Increasing communication cutoff from {:.8} to {:.8} for TIP4P GPU style", - comm->cutghostuser, cell_size); + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P GPU style", + cell_size); comm->cutghostuser = cell_size; } diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index d0e4b74309..4e3712e49d 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -19,8 +19,6 @@ #include "pair_lj_cut_tip4p_long.h" -#include -#include #include "angle.h" #include "atom.h" #include "bond.h" @@ -32,6 +30,8 @@ #include "memory.h" #include "error.h" +#include +#include using namespace LAMMPS_NS; @@ -474,9 +474,17 @@ void PairLJCutTIP4PLong::init_style() // set alpha parameter - double theta = force->angle->equilibrium_angle(typeA); - double blen = force->bond->equilibrium_distance(typeB); + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); alpha = qdist / (cos(0.5*theta) * blen); + + const double mincut = cut_coul + qdist + blen + neighbor->skin; + if (comm->get_comm_cutoff() < mincut) { + if (comm->me == 0) + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P pair style", + mincut); + comm->cutghostuser = mincut; + } } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index cf947f2e19..73b415f0a1 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -19,8 +19,6 @@ #include "pair_lj_long_tip4p_long.h" -#include -#include #include "angle.h" #include "atom.h" #include "bond.h" @@ -32,6 +30,8 @@ #include "memory.h" #include "error.h" +#include +#include using namespace LAMMPS_NS; @@ -1489,9 +1489,17 @@ void PairLJLongTIP4PLong::init_style() // set alpha parameter - double theta = force->angle->equilibrium_angle(typeA); - double blen = force->bond->equilibrium_distance(typeB); + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); alpha = qdist / (cos(0.5*theta) * blen); + + const double mincut = cut_coul + qdist + blen + neighbor->skin; + if (comm->get_comm_cutoff() < mincut) { + if (comm->me == 0) + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P pair style", + mincut); + comm->cutghostuser = mincut; + } } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp index 16cf04dea1..84f42de38e 100644 --- a/src/KSPACE/pair_tip4p_long.cpp +++ b/src/KSPACE/pair_tip4p_long.cpp @@ -431,9 +431,17 @@ void PairTIP4PLong::init_style() // set alpha parameter - double theta = force->angle->equilibrium_angle(typeA); - double blen = force->bond->equilibrium_distance(typeB); + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); alpha = qdist / (cos(0.5*theta) * blen); + + const double mincut = cut_coul + qdist + blen + neighbor->skin; + if (comm->get_comm_cutoff() < mincut) { + if (comm->me == 0) + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P pair style", + mincut); + comm->cutghostuser = mincut; + } } /* ---------------------------------------------------------------------- diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index b024afd575..81065d42a5 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -502,9 +502,17 @@ void PairLJCutTIP4PCut::init_style() // set alpha parameter - double theta = force->angle->equilibrium_angle(typeA); - double blen = force->bond->equilibrium_distance(typeB); + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); alpha = qdist / (cos(0.5*theta) * blen); + + const double mincut = cut_coul + qdist + blen + neighbor->skin; + if (comm->get_comm_cutoff() < mincut) { + if (comm->me == 0) + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P pair style", + mincut); + comm->cutghostuser = mincut; + } } /* ---------------------------------------------------------------------- diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 1d46df3e13..9a762ffd6b 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -431,9 +431,17 @@ void PairTIP4PCut::init_style() // set alpha parameter - double theta = force->angle->equilibrium_angle(typeA); - double blen = force->bond->equilibrium_distance(typeB); + const double theta = force->angle->equilibrium_angle(typeA); + const double blen = force->bond->equilibrium_distance(typeB); alpha = qdist / (cos(0.5*theta) * blen); + + const double mincut = cut_coul + qdist + blen + neighbor->skin; + if (comm->get_comm_cutoff() < mincut) { + if (comm->me == 0) + error->warning(FLERR, "Increasing communication cutoff to {:.8} for TIP4P pair style", + mincut); + comm->cutghostuser = mincut; + } } /* ----------------------------------------------------------------------