From 53526cfeb578e443b9869cc5eb2e89a86aa647dc Mon Sep 17 00:00:00 2001 From: David van der Spoel Date: Sun, 23 Nov 2014 12:01:02 +0100 Subject: [PATCH] Added warnings for ewald-geometry and surface-epsilon ewald-geometry and surface-epsilon require the system dipole, which will be incorrect when charge groups with net charge cross pbc. grompp now checks and warns for this. Refs #1645. Change-Id: I02e317cbddb47256f942312ec53c5bab2b13be2a --- src/kernel/readir.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/kernel/readir.c b/src/kernel/readir.c index 012d331243..9057ab27e5 100644 --- a/src/kernel/readir.c +++ b/src/kernel/readir.c @@ -1157,7 +1157,28 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts, sprintf(err_buf, "wall-ewald-zfac should be >= 2"); CHECK(ir->wall_ewald_zfac < 2); } - + if ((ir->ewald_geometry == eewg3DC) && (ir->ePBC != epbcXY) && + EEL_FULL(ir->coulombtype)) + { + sprintf(warn_buf, "With %s and ewald_geometry = %s you should use pbc = %s", + eel_names[ir->coulombtype], eewg_names[eewg3DC], epbc_names[epbcXY]); + warning(wi, warn_buf); + } + if ((ir->epsilon_surface != 0) && EEL_FULL(ir->coulombtype)) + { + if (ir->cutoff_scheme == ecutsVERLET) + { + sprintf(warn_buf, "Since molecules/charge groups are broken using the Verlet scheme, you can not use a dipole correction to the %s electrostatics.", + eel_names[ir->coulombtype]); + warning(wi, warn_buf); + } + else + { + sprintf(warn_buf, "Dipole corrections to %s electrostatics only work if all charge groups that can cross PBC boundaries are dipoles. If this is not the case set epsilon_surface to 0", + eel_names[ir->coulombtype]); + warning_note(wi, warn_buf); + } + } if (EVDW_SWITCHED(ir->vdwtype)) { sprintf(err_buf, "With vdwtype = %s rvdw-switch must be < rvdw. Or, better - use a potential modifier.", -- 2.22.0