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 |
> |
initialized_(false) { |
72 |
|
forceField_ = info_->getForceField(); |
73 |
|
interactionMan_ = new InteractionManager(); |
74 |
|
fDecomp_ = new ForceMatrixDecomposition(info_, interactionMan_); |
75 |
+ |
thermo = new Thermo(info_); |
76 |
|
} |
77 |
|
|
78 |
+ |
ForceManager::~ForceManager() { |
79 |
+ |
perturbations_.clear(); |
80 |
+ |
|
81 |
+ |
delete switcher_; |
82 |
+ |
delete interactionMan_; |
83 |
+ |
delete fDecomp_; |
84 |
+ |
delete thermo; |
85 |
+ |
} |
86 |
+ |
|
87 |
|
/** |
88 |
|
* setupCutoffs |
89 |
|
* |
444 |
|
perturbations_.push_back(eField); |
445 |
|
} |
446 |
|
|
447 |
+ |
usePeriodicBoundaryConditions_ = info_->getSimParams()->getUsePeriodicBoundaryConditions(); |
448 |
+ |
|
449 |
|
fDecomp_->distributeInitialData(); |
450 |
< |
|
450 |
> |
|
451 |
|
initialized_ = true; |
452 |
< |
|
452 |
> |
|
453 |
|
} |
454 |
< |
|
454 |
> |
|
455 |
|
void ForceManager::calcForces() { |
456 |
|
|
457 |
|
if (!initialized_) initialize(); |
458 |
< |
|
458 |
> |
|
459 |
|
preCalculation(); |
460 |
|
shortRangeInteractions(); |
461 |
|
longRangeInteractions(); |
694 |
|
RealType rCutSq; |
695 |
|
bool in_switching_region; |
696 |
|
RealType sw, dswdr, swderiv; |
697 |
< |
vector<int> atomListColumn, atomListRow, atomListLocal; |
697 |
> |
vector<int> atomListColumn, atomListRow; |
698 |
|
InteractionData idat; |
699 |
|
SelfData sdat; |
700 |
|
RealType mf; |
739 |
|
|
740 |
|
if (iLoop == loopStart) { |
741 |
|
bool update_nlist = fDecomp_->checkNeighborList(); |
742 |
< |
if (update_nlist) |
742 |
> |
if (update_nlist) { |
743 |
> |
if (!usePeriodicBoundaryConditions_) |
744 |
> |
Mat3x3d bbox = thermo->getBoundingBox(); |
745 |
|
neighborList = fDecomp_->buildNeighborList(); |
746 |
< |
} |
746 |
> |
} |
747 |
> |
} |
748 |
|
|
749 |
|
for (vector<pair<int, int> >::iterator it = neighborList.begin(); |
750 |
|
it != neighborList.end(); ++it) { |