From 0a2b78acb8772ac245e465754116e70e47eaa4e1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 16 Jan 2017 15:47:02 -0500 Subject: [PATCH] rather than adjusting the communication cutoff, we just print out the minimum value needed and error out i suspect, this communication cutoff adjustment was included into the code before it was possible to separately set it via comm_modify. stopping with an error message printing the needed/current value is cleaner, in keeping with other modules in LAMMPS and much less problematic. --- examples/USER/misc/srp/in.srp | 1 + src/USER-MISC/fix_srp.cpp | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/USER/misc/srp/in.srp b/examples/USER/misc/srp/in.srp index 6913434362..234026e9cb 100644 --- a/examples/USER/misc/srp/in.srp +++ b/examples/USER/misc/srp/in.srp @@ -15,6 +15,7 @@ bond_style harmonic bond_coeff * 225.0 0.85 comm_modify vel yes +comm_modify cutoff 3.6 # must use pair hybrid, since srp bond particles # do not interact with other atoms types diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 08499b2abc..fbd8473cb0 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -264,14 +264,11 @@ void FixSRP::setup_pre_force(int zz) if (cutghostmin > comm->cutghost[2]) cutghostmin = comm->cutghost[2]; - // reset cutghost if needed + // stop if cutghost is insufficient if (cutneighmax_srp > cutghostmin){ - if(comm->me == 0){ - sprintf(str, "Extending ghost comm cutoff. New %f, old %f.", cutneighmax_srp, cutghostmin); - error->message(FLERR,str); - } - // cutghost updated by comm->setup - comm->cutghostuser = cutneighmax_srp; + sprintf(str, "Communication cutoff too small for fix srp. " + "Need %f, current %f.", cutneighmax_srp, cutghostmin); + error->all(FLERR,str); } // assign tags for new atoms, update map