From 2731215fad361dfc35fc084be020639aa00a1ca5 Mon Sep 17 00:00:00 2001 From: Loren Schwiebert Date: Wed, 19 Jan 2022 12:10:54 -0500 Subject: [PATCH] Fix #405 Check that RCut and RCutLow are not negative --- src/ConfigSetup.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ConfigSetup.cpp b/src/ConfigSetup.cpp index ef1d4bf3e..51a528c22 100644 --- a/src/ConfigSetup.cpp +++ b/src/ConfigSetup.cpp @@ -1746,7 +1746,14 @@ void ConfigSetup::verifyInputs(void) std::cout << "Error: Cutoff is not specified!" << std::endl; exit(EXIT_FAILURE); } - + if(sys.ff.cutoff < 0.0) { + std::cout << "Error: Cutoff cannot be negative!" << std::endl; + exit(EXIT_FAILURE); + } + if(sys.ff.cutoffLow < 0.0) { + sys.ff.cutoffLow = 0.0; + printf("Warning: Short Range Cutoff cannot be negative. Initializing to zero.\n"); + } if(sys.elect.ewald && (sys.elect.tolerance == DBL_MAX)) { std::cout << "Error: Tolerance is not specified!" << std::endl; exit(EXIT_FAILURE);