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). |
38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 |
|
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
117 |
|
else |
118 |
|
mdFileVersion = 0; |
119 |
|
|
120 |
+ |
// We need the list of simulated atom types to figure out cutoffs |
121 |
+ |
// as well as long range corrections. |
122 |
+ |
|
123 |
+ |
set<AtomType*>::iterator i; |
124 |
+ |
set<AtomType*> atomTypes_; |
125 |
+ |
atomTypes_ = info_->getSimulatedAtomTypes(); |
126 |
+ |
|
127 |
|
if (simParams_->haveCutoffRadius()) { |
128 |
|
rCut_ = simParams_->getCutoffRadius(); |
129 |
|
} else { |
138 |
|
rCut_ = 12.0; |
139 |
|
} else { |
140 |
|
RealType thisCut; |
141 |
< |
set<AtomType*>::iterator i; |
135 |
< |
set<AtomType*> atomTypes; |
136 |
< |
atomTypes = info_->getSimulatedAtomTypes(); |
137 |
< |
for (i = atomTypes.begin(); i != atomTypes.end(); ++i) { |
141 |
> |
for (i = atomTypes_.begin(); i != atomTypes_.end(); ++i) { |
142 |
|
thisCut = interactionMan_->getSuggestedCutoffRadius((*i)); |
143 |
|
rCut_ = max(thisCut, rCut_); |
144 |
|
} |
749 |
|
if (iLoop == PAIR_LOOP) { |
750 |
|
vij = 0.0; |
751 |
|
fij = V3Zero; |
752 |
+ |
eField1 = V3Zero; |
753 |
+ |
eField2 = V3Zero; |
754 |
|
} |
755 |
|
|
756 |
|
in_switching_region = switcher_->getSwitch(rgrpsq, sw, dswdr, |
825 |
|
fij += fg; |
826 |
|
|
827 |
|
if (atomListRow.size() == 1 && atomListColumn.size() == 1) { |
828 |
< |
stressTensor -= outProduct( *(idat.d), fg); |
829 |
< |
if (doHeatFlux_) |
830 |
< |
fDecomp_->addToHeatFlux(*(idat.d) * dot(fg, vel2)); |
831 |
< |
|
828 |
> |
if (!fDecomp_->skipAtomPair(atomListRow[0], |
829 |
> |
atomListColumn[0], |
830 |
> |
cg1, cg2)) { |
831 |
> |
stressTensor -= outProduct( *(idat.d), fg); |
832 |
> |
if (doHeatFlux_) |
833 |
> |
fDecomp_->addToHeatFlux(*(idat.d) * dot(fg, vel2)); |
834 |
> |
} |
835 |
|
} |
836 |
|
|
837 |
|
for (ia = atomListRow.begin(); |
916 |
|
*(fDecomp_->getPairwisePotential()); |
917 |
|
|
918 |
|
curSnapshot->setLongRangePotential(longRangePotential); |
910 |
– |
|
911 |
– |
// collects single-atom information |
912 |
– |
fDecomp_->collectSelfData(); |
913 |
– |
|
914 |
– |
longRangePotential = *(fDecomp_->getEmbeddingPotential()) + |
915 |
– |
*(fDecomp_->getPairwisePotential()); |
916 |
– |
|
917 |
– |
curSnapshot->setLongRangePotential(longRangePotential); |
919 |
|
|
920 |
|
curSnapshot->setExcludedPotentials(*(fDecomp_->getExcludedSelfPotential()) + |
921 |
|
*(fDecomp_->getExcludedPotential())); |
953 |
|
#endif |
954 |
|
curSnapshot->setStressTensor(stressTensor); |
955 |
|
|
956 |
+ |
if (info_->getSimParams()->getUseLongRangeCorrections()) { |
957 |
+ |
/* |
958 |
+ |
RealType vol = curSnapshot->getVolume(); |
959 |
+ |
RealType Elrc(0.0); |
960 |
+ |
RealType Wlrc(0.0); |
961 |
+ |
|
962 |
+ |
set<AtomType*>::iterator i; |
963 |
+ |
set<AtomType*>::iterator j; |
964 |
+ |
|
965 |
+ |
RealType n_i, n_j; |
966 |
+ |
RealType rho_i, rho_j; |
967 |
+ |
pair<RealType, RealType> LRI; |
968 |
+ |
|
969 |
+ |
for (i = atomTypes_.begin(); i != atomTypes_.end(); ++i) { |
970 |
+ |
n_i = RealType(info_->getGlobalCountOfType(*i)); |
971 |
+ |
rho_i = n_i / vol; |
972 |
+ |
for (j = atomTypes_.begin(); j != atomTypes_.end(); ++j) { |
973 |
+ |
n_j = RealType(info_->getGlobalCountOfType(*j)); |
974 |
+ |
rho_j = n_j / vol; |
975 |
+ |
|
976 |
+ |
LRI = interactionMan_->getLongRangeIntegrals( (*i), (*j) ); |
977 |
+ |
|
978 |
+ |
Elrc += n_i * rho_j * LRI.first; |
979 |
+ |
Wlrc -= rho_i * rho_j * LRI.second; |
980 |
+ |
} |
981 |
+ |
} |
982 |
+ |
Elrc *= 2.0 * NumericConstant::PI; |
983 |
+ |
Wlrc *= 2.0 * NumericConstant::PI; |
984 |
+ |
|
985 |
+ |
RealType lrp = curSnapshot->getLongRangePotential(); |
986 |
+ |
curSnapshot->setLongRangePotential(lrp + Elrc); |
987 |
+ |
stressTensor += Wlrc * SquareMatrix3<RealType>::identity(); |
988 |
+ |
curSnapshot->setStressTensor(stressTensor); |
989 |
+ |
*/ |
990 |
+ |
|
991 |
+ |
} |
992 |
|
} |
993 |
< |
} //end namespace OpenMD |
993 |
> |
} |