| 526 |
|
int useDirectionalAtom = 0; |
| 527 |
|
int useElectrostatics = 0; |
| 528 |
|
//usePBC and useRF are from simParams |
| 529 |
< |
int usePBC = simParams_->getPBC(); |
| 529 |
> |
int usePBC = simParams_->getUsePeriodicBoundaryConditions(); |
| 530 |
|
int useRF; |
| 531 |
+ |
std::string myMethod; |
| 532 |
|
|
| 533 |
|
// set the useRF logical |
| 534 |
< |
std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
| 535 |
< |
if (myMethod == "REACTION_FIELD") |
| 536 |
< |
useRF = 1; |
| 537 |
< |
else |
| 538 |
< |
useRF = 0; |
| 534 |
> |
useRF = 0; |
| 535 |
> |
|
| 536 |
> |
|
| 537 |
> |
if (simParams_->haveElectrostaticSummationMethod()) { |
| 538 |
> |
std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
| 539 |
> |
toUpper(myMethod); |
| 540 |
> |
if (myMethod == "REACTION_FIELD") { |
| 541 |
> |
useRF=1; |
| 542 |
> |
} |
| 543 |
> |
} |
| 544 |
|
|
| 545 |
|
//loop over all of the atom types |
| 546 |
|
for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { |
| 622 |
|
fInfo_.SIM_uses_FLARB = useFLARB; |
| 623 |
|
fInfo_.SIM_uses_RF = useRF; |
| 624 |
|
|
| 625 |
< |
if( fInfo_.SIM_uses_Dipoles && myMethod == "REACTION_FIELD") { |
| 626 |
< |
|
| 625 |
> |
if( myMethod == "REACTION_FIELD") { |
| 626 |
> |
|
| 627 |
|
if (simParams_->haveDielectric()) { |
| 628 |
|
fInfo_.dielect = simParams_->getDielectric(); |
| 629 |
|
} else { |
| 633 |
|
"\tsetting a dielectric constant!\n"); |
| 634 |
|
painCave.isFatal = 1; |
| 635 |
|
simError(); |
| 636 |
< |
} |
| 631 |
< |
|
| 632 |
< |
} else { |
| 633 |
< |
fInfo_.dielect = 0.0; |
| 636 |
> |
} |
| 637 |
|
} |
| 635 |
– |
|
| 638 |
|
} |
| 639 |
|
|
| 640 |
|
void SimInfo::setupFortranSim() { |
| 808 |
|
|
| 809 |
|
if (fInfo_.SIM_uses_Charges | fInfo_.SIM_uses_Dipoles | fInfo_.SIM_uses_RF) { |
| 810 |
|
|
| 811 |
< |
if (!simParams_->haveRcut()){ |
| 811 |
> |
if (!simParams_->haveCutoffRadius()){ |
| 812 |
|
sprintf(painCave.errMsg, |
| 813 |
|
"SimCreator Warning: No value was set for the cutoffRadius.\n" |
| 814 |
|
"\tOOPSE will use a default value of 15.0 angstroms" |
| 817 |
|
simError(); |
| 818 |
|
rcut = 15.0; |
| 819 |
|
} else{ |
| 820 |
< |
rcut = simParams_->getRcut(); |
| 820 |
> |
rcut = simParams_->getCutoffRadius(); |
| 821 |
|
} |
| 822 |
|
|
| 823 |
< |
if (!simParams_->haveRsw()){ |
| 823 |
> |
if (!simParams_->haveSwitchingRadius()){ |
| 824 |
|
sprintf(painCave.errMsg, |
| 825 |
|
"SimCreator Warning: No value was set for switchingRadius.\n" |
| 826 |
|
"\tOOPSE will use a default value of\n" |
| 827 |
< |
"\t0.95 * cutoffRadius for the switchingRadius\n"); |
| 827 |
> |
"\t0.85 * cutoffRadius for the switchingRadius\n"); |
| 828 |
|
painCave.isFatal = 0; |
| 829 |
|
simError(); |
| 830 |
< |
rsw = 0.95 * rcut; |
| 830 |
> |
rsw = 0.85 * rcut; |
| 831 |
|
} else{ |
| 832 |
< |
rsw = simParams_->getRsw(); |
| 832 |
> |
rsw = simParams_->getSwitchingRadius(); |
| 833 |
|
} |
| 834 |
|
|
| 835 |
|
} else { |
| 836 |
|
// if charge, dipole or reaction field is not used and the cutofff radius is not specified in |
| 837 |
|
//meta-data file, the maximum cutoff radius calculated from forcefiled will be used |
| 838 |
|
|
| 839 |
< |
if (simParams_->haveRcut()) { |
| 840 |
< |
rcut = simParams_->getRcut(); |
| 839 |
> |
if (simParams_->haveCutoffRadius()) { |
| 840 |
> |
rcut = simParams_->getCutoffRadius(); |
| 841 |
|
} else { |
| 842 |
|
//set cutoff radius to the maximum cutoff radius based on atom types in the whole system |
| 843 |
|
rcut = calcMaxCutoffRadius(); |
| 844 |
|
} |
| 845 |
|
|
| 846 |
< |
if (simParams_->haveRsw()) { |
| 847 |
< |
rsw = simParams_->getRsw(); |
| 846 |
> |
if (simParams_->haveSwitchingRadius()) { |
| 847 |
> |
rsw = simParams_->getSwitchingRadius(); |
| 848 |
|
} else { |
| 849 |
|
rsw = rcut; |
| 850 |
|
} |
| 861 |
|
int cp = TRADITIONAL_CUTOFF_POLICY; |
| 862 |
|
if (simParams_->haveCutoffPolicy()) { |
| 863 |
|
std::string myPolicy = simParams_->getCutoffPolicy(); |
| 864 |
+ |
toUpper(myPolicy); |
| 865 |
|
if (myPolicy == "MIX") { |
| 866 |
|
cp = MIX_CUTOFF_POLICY; |
| 867 |
|
} else { |
| 888 |
|
|
| 889 |
|
notifyFortranCutoffs(&rcut_, &rsw_, &rnblist, &cp); |
| 890 |
|
// also send cutoff notification to electrostatics |
| 891 |
< |
setElectrostaticCutoffRadius(&rcut_); |
| 891 |
> |
setElectrostaticCutoffRadius(&rcut_, &rsw_); |
| 892 |
|
} |
| 893 |
|
|
| 894 |
|
void SimInfo::setupElectrostaticSummationMethod( int isError ) { |
| 904 |
|
|
| 905 |
|
if (simParams_->haveElectrostaticSummationMethod()) { |
| 906 |
|
std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
| 907 |
+ |
toUpper(myMethod); |
| 908 |
|
if (myMethod == "NONE") { |
| 909 |
|
esm = NONE; |
| 910 |
|
} else { |
| 921 |
|
simError(); |
| 922 |
|
} |
| 923 |
|
} else { |
| 924 |
< |
if (myMethod == "REACTION_FIELD") { |
| 924 |
> |
if (myMethod == "REACTION_FIELD") { |
| 925 |
|
esm = REACTION_FIELD; |
| 926 |
|
} else { |
| 927 |
|
// throw error |