| 58 |
|
#include "primitives/Torsion.hpp" |
| 59 |
|
#include "primitives/Inversion.hpp" |
| 60 |
|
#include "nonbonded/NonBondedInteraction.hpp" |
| 61 |
+ |
#include "perturbations/ElectricField.hpp" |
| 62 |
|
#include "parallel/ForceMatrixDecomposition.hpp" |
| 63 |
|
|
| 64 |
|
#include <cstdio> |
| 424 |
|
electrostaticScale_[2] = fopts.getelectrostatic13scale(); |
| 425 |
|
electrostaticScale_[3] = fopts.getelectrostatic14scale(); |
| 426 |
|
|
| 427 |
+ |
if (info_->getSimParams()->haveElectricField()) { |
| 428 |
+ |
ElectricField* eField = new ElectricField(info_); |
| 429 |
+ |
perturbations_.push_back(eField); |
| 430 |
+ |
} |
| 431 |
+ |
|
| 432 |
|
fDecomp_->distributeInitialData(); |
| 433 |
|
|
| 434 |
|
initialized_ = true; |
| 681 |
|
InteractionData idat; |
| 682 |
|
SelfData sdat; |
| 683 |
|
RealType mf; |
| 678 |
– |
RealType lrPot; |
| 684 |
|
RealType vpair; |
| 685 |
|
RealType dVdFQ1(0.0); |
| 686 |
|
RealType dVdFQ2(0.0); |
| 874 |
|
|
| 875 |
|
fDecomp_->collectIntermediateData(); |
| 876 |
|
|
| 877 |
< |
for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) { |
| 877 |
> |
for (unsigned int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) { |
| 878 |
|
fDecomp_->fillSelfData(sdat, atom1); |
| 879 |
|
interactionMan_->doPreForce(sdat); |
| 880 |
|
} |
| 889 |
|
fDecomp_->collectData(); |
| 890 |
|
|
| 891 |
|
if (info_->requiresSelfCorrection()) { |
| 892 |
< |
for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) { |
| 892 |
> |
for (unsigned int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) { |
| 893 |
|
fDecomp_->fillSelfData(sdat, atom1); |
| 894 |
|
interactionMan_->doSelfCorrection(sdat); |
| 895 |
|
} |
| 902 |
|
*(fDecomp_->getPairwisePotential()); |
| 903 |
|
|
| 904 |
|
curSnapshot->setLongRangePotential(longRangePotential); |
| 900 |
– |
|
| 901 |
– |
// lrPot = longRangePotential.sum(); |
| 902 |
– |
|
| 903 |
– |
// //store the long range potential |
| 904 |
– |
// curSnapshot->setLongRangePotential(lrPot); |
| 905 |
|
|
| 906 |
|
curSnapshot->setExcludedPotentials(*(fDecomp_->getExcludedSelfPotential()) + |
| 907 |
|
*(fDecomp_->getExcludedPotential())); |
| 910 |
|
|
| 911 |
|
|
| 912 |
|
void ForceManager::postCalculation() { |
| 913 |
+ |
|
| 914 |
+ |
vector<Perturbation*>::iterator pi; |
| 915 |
+ |
for (pi = perturbations_.begin(); pi != perturbations_.end(); ++pi) { |
| 916 |
+ |
(*pi)->applyPerturbation(); |
| 917 |
+ |
} |
| 918 |
+ |
|
| 919 |
|
SimInfo::MoleculeIterator mi; |
| 920 |
|
Molecule* mol; |
| 921 |
|
Molecule::RigidBodyIterator rbIter; |
| 940 |
|
curSnapshot->setStressTensor(stressTensor); |
| 941 |
|
|
| 942 |
|
} |
| 937 |
– |
|
| 943 |
|
} //end namespace OpenMD |