| 6 |
|
* redistribute this software in source and binary code form, provided |
| 7 |
|
* that the following conditions are met: |
| 8 |
|
* |
| 9 |
< |
* 1. Acknowledgement of the program authors must be made in any |
| 10 |
< |
* publication of scientific results based in part on use of the |
| 11 |
< |
* program. An acceptable form of acknowledgement is citation of |
| 12 |
< |
* the article in which the program was described (Matthew |
| 13 |
< |
* A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher |
| 14 |
< |
* J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented |
| 15 |
< |
* Parallel Simulation Engine for Molecular Dynamics," |
| 16 |
< |
* J. Comput. Chem. 26, pp. 252-271 (2005)) |
| 17 |
< |
* |
| 18 |
< |
* 2. Redistributions of source code must retain the above copyright |
| 9 |
> |
* 1. Redistributions of source code must retain the above copyright |
| 10 |
|
* notice, this list of conditions and the following disclaimer. |
| 11 |
|
* |
| 12 |
< |
* 3. Redistributions in binary form must reproduce the above copyright |
| 12 |
> |
* 2. Redistributions in binary form must reproduce the above copyright |
| 13 |
|
* notice, this list of conditions and the following disclaimer in the |
| 14 |
|
* documentation and/or other materials provided with the |
| 15 |
|
* distribution. |
| 28 |
|
* arising out of the use of or inability to use software, even if the |
| 29 |
|
* University of Notre Dame has been advised of the possibility of |
| 30 |
|
* such damages. |
| 31 |
+ |
* |
| 32 |
+ |
* SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
| 33 |
+ |
* research, please cite the appropriate papers when you publish your |
| 34 |
+ |
* work. Good starting points are: |
| 35 |
+ |
* |
| 36 |
+ |
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
| 37 |
+ |
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
| 38 |
+ |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
| 39 |
+ |
* [4] Vardeman & Gezelter, in progress (2009). |
| 40 |
|
*/ |
| 41 |
|
|
| 42 |
|
/** |
| 55 |
|
#include "primitives/Molecule.hpp" |
| 56 |
|
#include "primitives/StuntDouble.hpp" |
| 57 |
|
#include "UseTheForce/fCutoffPolicy.h" |
| 58 |
– |
#include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h" |
| 59 |
– |
#include "UseTheForce/DarkSide/fElectrostaticScreeningMethod.h" |
| 58 |
|
#include "UseTheForce/DarkSide/fSwitchingFunctionType.h" |
| 59 |
|
#include "UseTheForce/doForces_interface.h" |
| 60 |
|
#include "UseTheForce/DarkSide/neighborLists_interface.h" |
| 63 |
– |
#include "UseTheForce/DarkSide/electrostatic_interface.h" |
| 61 |
|
#include "UseTheForce/DarkSide/switcheroo_interface.h" |
| 62 |
|
#include "utils/MemoryUtils.hpp" |
| 63 |
|
#include "utils/simError.h" |
| 71 |
|
#include "UseTheForce/DarkSide/simParallel_interface.h" |
| 72 |
|
#endif |
| 73 |
|
|
| 74 |
< |
namespace oopse { |
| 74 |
> |
namespace OpenMD { |
| 75 |
|
std::set<int> getRigidSet(int index, std::map<int, std::set<int> >& container) { |
| 76 |
|
std::map<int, std::set<int> >::iterator i = container.find(index); |
| 77 |
|
std::set<int> result; |
| 443 |
|
b = torsion->getAtomB()->getGlobalIndex(); |
| 444 |
|
c = torsion->getAtomC()->getGlobalIndex(); |
| 445 |
|
d = torsion->getAtomD()->getGlobalIndex(); |
| 446 |
< |
|
| 446 |
> |
|
| 447 |
|
if (options_.havevdw12scale() || options_.haveelectrostatic12scale()) { |
| 448 |
|
oneTwoInteractions_.addPair(a, b); |
| 449 |
|
oneTwoInteractions_.addPair(b, c); |
| 760 |
|
useRF = 0; |
| 761 |
|
useSF = 0; |
| 762 |
|
useSP = 0; |
| 763 |
< |
|
| 763 |
> |
useBoxDipole = 0; |
| 764 |
|
|
| 765 |
|
if (simParams_->haveElectrostaticSummationMethod()) { |
| 766 |
|
std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
| 861 |
|
MPI_Allreduce(&temp, &useAtomicVirial_, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD); |
| 862 |
|
|
| 863 |
|
#endif |
| 867 |
– |
|
| 864 |
|
fInfo_.SIM_uses_PBC = usePBC; |
| 865 |
|
fInfo_.SIM_uses_DirectionalAtoms = useDirectionalAtom; |
| 866 |
|
fInfo_.SIM_uses_LennardJones = useLennardJones; |
| 945 |
|
nOneTwo = oneTwoInteractions_.getSize(); |
| 946 |
|
nOneThree = oneThreeInteractions_.getSize(); |
| 947 |
|
nOneFour = oneFourInteractions_.getSize(); |
| 952 |
– |
|
| 953 |
– |
std::cerr << "exculdes:\n"; |
| 954 |
– |
std::cerr << excludedInteractions_; |
| 955 |
– |
std::cerr << "\noneTwo:\n"; |
| 956 |
– |
std::cerr << oneTwoInteractions_; |
| 957 |
– |
std::cerr << "\noneThree:\n"; |
| 958 |
– |
std::cerr << oneThreeInteractions_; |
| 959 |
– |
std::cerr << "\noneFour:\n"; |
| 960 |
– |
std::cerr << oneFourInteractions_; |
| 948 |
|
|
| 949 |
|
int* excludeList = excludedInteractions_.getPairList(); |
| 950 |
|
int* oneTwoList = oneTwoInteractions_.getPairList(); |
| 964 |
|
sprintf( painCave.errMsg, |
| 965 |
|
"There was an error setting the simulation information in fortran.\n" ); |
| 966 |
|
painCave.isFatal = 1; |
| 967 |
< |
painCave.severity = OOPSE_ERROR; |
| 967 |
> |
painCave.severity = OPENMD_ERROR; |
| 968 |
|
simError(); |
| 969 |
|
} |
| 970 |
|
|
| 1048 |
|
int cp = TRADITIONAL_CUTOFF_POLICY; // Set to traditional by default |
| 1049 |
|
|
| 1050 |
|
// Set LJ shifting bools to false |
| 1051 |
< |
ljsp_ = false; |
| 1052 |
< |
ljsf_ = false; |
| 1051 |
> |
ljsp_ = 0; |
| 1052 |
> |
ljsf_ = 0; |
| 1053 |
|
|
| 1054 |
|
std::string myPolicy; |
| 1055 |
|
if (forceFieldOptions_.haveCutoffPolicy()){ |
| 1100 |
|
rsw_ = 0.85 * rcut_; |
| 1101 |
|
sprintf(painCave.errMsg, |
| 1102 |
|
"SimCreator Warning: No value was set for the switchingRadius.\n" |
| 1103 |
< |
"\tOOPSE will use a default value of 85 percent of the cutoffRadius.\n" |
| 1103 |
> |
"\tOpenMD will use a default value of 85 percent of the cutoffRadius.\n" |
| 1104 |
|
"\tswitchingRadius = %f. for this simulation\n", rsw_); |
| 1105 |
|
painCave.isFatal = 0; |
| 1106 |
|
simError(); |
| 1108 |
|
rsw_ = rcut_; |
| 1109 |
|
sprintf(painCave.errMsg, |
| 1110 |
|
"SimCreator Warning: No value was set for the switchingRadius.\n" |
| 1111 |
< |
"\tOOPSE will use the same value as the cutoffRadius.\n" |
| 1111 |
> |
"\tOpenMD will use the same value as the cutoffRadius.\n" |
| 1112 |
|
"\tswitchingRadius = %f. for this simulation\n", rsw_); |
| 1113 |
|
painCave.isFatal = 0; |
| 1114 |
|
simError(); |
| 1120 |
|
toUpper(myMethod); |
| 1121 |
|
|
| 1122 |
|
if (myMethod == "SHIFTED_POTENTIAL") { |
| 1123 |
< |
ljsp_ = true; |
| 1123 |
> |
ljsp_ = 1; |
| 1124 |
|
} else if (myMethod == "SHIFTED_FORCE") { |
| 1125 |
< |
ljsf_ = true; |
| 1125 |
> |
ljsf_ = 1; |
| 1126 |
|
} |
| 1127 |
|
} |
| 1128 |
+ |
|
| 1129 |
|
notifyFortranCutoffs(&rcut_, &rsw_, &ljsp_, &ljsf_); |
| 1130 |
|
|
| 1131 |
|
} else { |
| 1134 |
|
if (fInfo_.SIM_uses_Charges | fInfo_.SIM_uses_Dipoles | fInfo_.SIM_uses_RF) { |
| 1135 |
|
sprintf(painCave.errMsg, |
| 1136 |
|
"SimCreator Warning: No value was set for the cutoffRadius.\n" |
| 1137 |
< |
"\tOOPSE will use a default value of 15.0 angstroms" |
| 1137 |
> |
"\tOpenMD will use a default value of 15.0 angstroms" |
| 1138 |
|
"\tfor the cutoffRadius.\n"); |
| 1139 |
|
painCave.isFatal = 0; |
| 1140 |
|
simError(); |
| 1143 |
|
if (simParams_->haveElectrostaticSummationMethod()) { |
| 1144 |
|
std::string myMethod = simParams_->getElectrostaticSummationMethod(); |
| 1145 |
|
toUpper(myMethod); |
| 1146 |
< |
|
| 1147 |
< |
// For the time being, we're tethering the LJ shifted behavior to the |
| 1148 |
< |
// electrostaticSummationMethod keyword options |
| 1146 |
> |
|
| 1147 |
> |
// For the time being, we're tethering the LJ shifted behavior to the |
| 1148 |
> |
// electrostaticSummationMethod keyword options |
| 1149 |
|
if (myMethod == "SHIFTED_POTENTIAL") { |
| 1150 |
< |
ljsp_ = true; |
| 1150 |
> |
ljsp_ = 1; |
| 1151 |
|
} else if (myMethod == "SHIFTED_FORCE") { |
| 1152 |
< |
ljsf_ = true; |
| 1152 |
> |
ljsf_ = 1; |
| 1153 |
|
} |
| 1154 |
|
if (myMethod == "SHIFTED_POTENTIAL" || myMethod == "SHIFTED_FORCE") { |
| 1155 |
|
if (simParams_->haveSwitchingRadius()){ |
| 1168 |
|
} else { |
| 1169 |
|
sprintf(painCave.errMsg, |
| 1170 |
|
"SimCreator Warning: No value was set for switchingRadius.\n" |
| 1171 |
< |
"\tOOPSE will use a default value of\n" |
| 1171 |
> |
"\tOpenMD will use a default value of\n" |
| 1172 |
|
"\t0.85 * cutoffRadius for the switchingRadius\n"); |
| 1173 |
|
painCave.isFatal = 0; |
| 1174 |
|
simError(); |
| 1175 |
|
rsw_ = 0.85 * rcut_; |
| 1176 |
|
} |
| 1177 |
|
|
| 1178 |
+ |
Electrostatic::setElectrostaticCutoffRadius(rcut_, rsw_); |
| 1179 |
|
notifyFortranCutoffs(&rcut_, &rsw_, &ljsp_, &ljsf_); |
| 1180 |
|
|
| 1181 |
|
} else { |
| 1191 |
|
void SimInfo::setupElectrostaticSummationMethod( int isError ) { |
| 1192 |
|
|
| 1193 |
|
int errorOut; |
| 1194 |
< |
int esm = NONE; |
| 1195 |
< |
int sm = UNDAMPED; |
| 1194 |
> |
ElectrostaticSummationMethod esm = NONE; |
| 1195 |
> |
ElectrostaticScreeningMethod sm = UNDAMPED; |
| 1196 |
|
RealType alphaVal; |
| 1197 |
|
RealType dielectric; |
| 1198 |
|
|
| 1279 |
|
} |
| 1280 |
|
} |
| 1281 |
|
|
| 1282 |
< |
// let's pass some summation method variables to fortran |
| 1283 |
< |
setElectrostaticSummationMethod( &esm ); |
| 1284 |
< |
setFortranElectrostaticMethod( &esm ); |
| 1285 |
< |
setScreeningMethod( &sm ); |
| 1286 |
< |
setDampingAlpha( &alphaVal ); |
| 1298 |
< |
setReactionFieldDielectric( &dielectric ); |
| 1282 |
> |
|
| 1283 |
> |
Electrostatic::setElectrostaticSummationMethod( esm ); |
| 1284 |
> |
Electrostatic::setElectrostaticScreeningMethod( sm ); |
| 1285 |
> |
Electrostatic::setDampingAlpha( alphaVal ); |
| 1286 |
> |
Electrostatic::setReactionFieldDielectric( dielectric ); |
| 1287 |
|
initFortranFF( &errorOut ); |
| 1288 |
|
} |
| 1289 |
|
|
| 1470 |
|
|
| 1471 |
|
|
| 1472 |
|
[ Ixx -Ixy -Ixz ] |
| 1473 |
< |
J =| -Iyx Iyy -Iyz | |
| 1473 |
> |
J =| -Iyx Iyy -Iyz | |
| 1474 |
|
[ -Izx -Iyz Izz ] |
| 1475 |
|
*/ |
| 1476 |
|
|
| 1629 |
|
return sdByGlobalIndex_.at(index); |
| 1630 |
|
} |
| 1631 |
|
*/ |
| 1632 |
< |
}//end namespace oopse |
| 1632 |
> |
}//end namespace OpenMD |
| 1633 |
|
|