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). |
39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
42 |
|
#include "parallel/ForceDecomposition.hpp" |
43 |
|
#include "math/Vector3.hpp" |
48 |
|
using namespace std; |
49 |
|
namespace OpenMD { |
50 |
|
|
51 |
< |
ForceDecomposition::ForceDecomposition(SimInfo* info) : info_(info) { |
51 |
> |
ForceDecomposition::ForceDecomposition(SimInfo* info, InteractionManager* iMan) : info_(info), interactionMan_(iMan) { |
52 |
|
sman_ = info_->getSnapshotManager(); |
53 |
|
storageLayout_ = sman_->getStorageLayout(); |
54 |
|
ff_ = info_->getForceField(); |
88 |
|
cellOffsets_.push_back( Vector3i(1, -1,1) ); |
89 |
|
} |
90 |
|
|
91 |
< |
SelfData ForceDecomposition::fillSelfData(int atom1) { |
92 |
< |
SelfData sdat; |
93 |
< |
// Still Missing atype, skippedCharge, potVec pot, |
91 |
> |
void ForceDecomposition::fillSelfData(SelfData &sdat, int atom1) { |
92 |
> |
|
93 |
> |
sdat.atype = atypesLocal[atom1]; |
94 |
> |
|
95 |
> |
sdat.pot = &embeddingPot; |
96 |
> |
|
97 |
|
if (storageLayout_ & DataStorage::dslElectroFrame) { |
98 |
|
sdat.eFrame = &(snap_->atomData.electroFrame[atom1]); |
99 |
|
} |
114 |
|
sdat.dfrhodrho = &(snap_->atomData.functionalDerivative[atom1]); |
115 |
|
} |
116 |
|
|
117 |
+ |
if (storageLayout_ & DataStorage::dslSkippedCharge) { |
118 |
+ |
sdat.skippedCharge = &(snap_->atomData.skippedCharge[atom1]); |
119 |
+ |
} |
120 |
+ |
|
121 |
|
if (storageLayout_ & DataStorage::dslParticlePot) { |
122 |
|
sdat.particlePot = &(snap_->atomData.particlePot[atom1]); |
123 |
|
} |
116 |
– |
|
117 |
– |
return sdat; |
124 |
|
} |
125 |
|
|
126 |
|
bool ForceDecomposition::checkNeighborList() { |
148 |
|
// a conservative test of list skin crossings |
149 |
|
dispmax = 2.0 * sqrt (3.0 * dispmax * dispmax); |
150 |
|
|
151 |
< |
return (dispmax > skinThickness_); |
151 |
> |
|
152 |
> |
if (dispmax > skinThickness_) |
153 |
> |
return (dispmax > skinThickness_); |
154 |
> |
|
155 |
> |
return false; |
156 |
|
} |
157 |
|
} |