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 |
|
*/ |
67 |
|
using namespace std; |
68 |
|
namespace OpenMD { |
69 |
|
|
70 |
< |
ForceManager::ForceManager(SimInfo * info) : info_(info) { |
70 |
> |
ForceManager::ForceManager(SimInfo * info) : info_(info), switcher_(NULL) { |
71 |
|
forceField_ = info_->getForceField(); |
72 |
|
interactionMan_ = new InteractionManager(); |
73 |
|
fDecomp_ = new ForceMatrixDecomposition(info_, interactionMan_); |
74 |
+ |
thermo = new Thermo(info_); |
75 |
|
} |
76 |
|
|
77 |
+ |
ForceManager::~ForceManager() { |
78 |
+ |
perturbations_.clear(); |
79 |
+ |
|
80 |
+ |
delete switcher_; |
81 |
+ |
delete interactionMan_; |
82 |
+ |
delete fDecomp_; |
83 |
+ |
delete thermo; |
84 |
+ |
} |
85 |
+ |
|
86 |
|
/** |
87 |
|
* setupCutoffs |
88 |
|
* |
443 |
|
perturbations_.push_back(eField); |
444 |
|
} |
445 |
|
|
446 |
+ |
usePeriodicBoundaryConditions_ = info_->getSimParams()->getUsePeriodicBoundaryConditions(); |
447 |
+ |
|
448 |
|
fDecomp_->distributeInitialData(); |
449 |
< |
|
449 |
> |
|
450 |
|
initialized_ = true; |
451 |
< |
|
451 |
> |
|
452 |
|
} |
453 |
< |
|
453 |
> |
|
454 |
|
void ForceManager::calcForces() { |
455 |
|
|
456 |
|
if (!initialized_) initialize(); |
457 |
< |
|
457 |
> |
|
458 |
|
preCalculation(); |
459 |
|
shortRangeInteractions(); |
460 |
|
longRangeInteractions(); |
738 |
|
|
739 |
|
if (iLoop == loopStart) { |
740 |
|
bool update_nlist = fDecomp_->checkNeighborList(); |
741 |
< |
if (update_nlist) |
741 |
> |
if (update_nlist) { |
742 |
> |
if (!usePeriodicBoundaryConditions_) |
743 |
> |
Mat3x3d bbox = thermo->getBoundingBox(); |
744 |
|
neighborList = fDecomp_->buildNeighborList(); |
745 |
< |
} |
745 |
> |
} |
746 |
> |
} |
747 |
|
|
748 |
|
for (vector<pair<int, int> >::iterator it = neighborList.begin(); |
749 |
|
it != neighborList.end(); ++it) { |