| 63 |
|
#include "utils/MemoryUtils.hpp" |
| 64 |
|
#include "utils/simError.h" |
| 65 |
|
#include "selection/SelectionManager.hpp" |
| 66 |
+ |
#include "io/ForceFieldOptions.hpp" |
| 67 |
+ |
#include "UseTheForce/ForceField.hpp" |
| 68 |
|
|
| 69 |
|
#ifdef IS_MPI |
| 70 |
|
#include "UseTheForce/mpiComponentPlan.h" |
| 922 |
|
|
| 923 |
|
void SimInfo::setupCutoff() { |
| 924 |
|
|
| 925 |
+ |
ForceFieldOptions& forceFieldOptions_ = forceField_->getForceFieldOptions(); |
| 926 |
+ |
|
| 927 |
|
// Check the cutoff policy |
| 928 |
< |
int cp = TRADITIONAL_CUTOFF_POLICY; |
| 929 |
< |
if (simParams_->haveCutoffPolicy()) { |
| 930 |
< |
std::string myPolicy = simParams_->getCutoffPolicy(); |
| 928 |
> |
int cp = TRADITIONAL_CUTOFF_POLICY; // Set to traditional by default |
| 929 |
> |
|
| 930 |
> |
std::string myPolicy; |
| 931 |
> |
if (forceFieldOptions_.haveCutoffPolicy()){ |
| 932 |
> |
myPolicy = forceFieldOptions_.getCutoffPolicy(); |
| 933 |
> |
}else if (simParams_->haveCutoffPolicy()) { |
| 934 |
> |
myPolicy = simParams_->getCutoffPolicy(); |
| 935 |
> |
} |
| 936 |
> |
|
| 937 |
> |
if (!myPolicy.empty()){ |
| 938 |
|
toUpper(myPolicy); |
| 939 |
|
if (myPolicy == "MIX") { |
| 940 |
|
cp = MIX_CUTOFF_POLICY; |
| 969 |
|
if (simParams_->haveSwitchingRadius()) { |
| 970 |
|
rsw_ = simParams_->getSwitchingRadius(); |
| 971 |
|
} else { |
| 972 |
< |
rsw_ = rcut_; |
| 973 |
< |
} |
| 972 |
> |
if (fInfo_.SIM_uses_Charges | |
| 973 |
> |
fInfo_.SIM_uses_Dipoles | |
| 974 |
> |
fInfo_.SIM_uses_RF) { |
| 975 |
> |
|
| 976 |
> |
rsw_ = 0.85 * rcut_; |
| 977 |
> |
sprintf(painCave.errMsg, |
| 978 |
> |
"SimCreator Warning: No value was set for the switchingRadius.\n" |
| 979 |
> |
"\tOOPSE will use a default value of 85\% of the cutoffRadius" |
| 980 |
> |
"\tswitchingRadius = %f. for this simulation\n", rsw_); |
| 981 |
> |
painCave.isFatal = 0; |
| 982 |
> |
simError(); |
| 983 |
> |
} else { |
| 984 |
> |
rsw_ = rcut_; |
| 985 |
> |
sprintf(painCave.errMsg, |
| 986 |
> |
"SimCreator Warning: No value was set for the switchingRadius.\n" |
| 987 |
> |
"\tOOPSE will use the same value as the cutoffRadius.\n" |
| 988 |
> |
"\tswitchingRadius = %f. for this simulation\n", rsw_); |
| 989 |
> |
painCave.isFatal = 0; |
| 990 |
> |
simError(); |
| 991 |
> |
} |
| 992 |
> |
|
| 993 |
|
notifyFortranCutoffs(&rcut_, &rsw_); |
| 994 |
|
|
| 995 |
|
} else { |
| 1117 |
|
} |
| 1118 |
|
|
| 1119 |
|
// let's pass some summation method variables to fortran |
| 1120 |
< |
setElectrostaticSumMethod( &esm ); |
| 1120 |
> |
setElectrostaticSummationMethod( &esm ); |
| 1121 |
|
setFortranElectrostaticMethod( &esm ); |
| 1122 |
|
setScreeningMethod( &sm ); |
| 1123 |
|
setDampingAlpha( &alphaVal ); |