| 47 |
|
using namespace std; |
| 48 |
|
namespace OpenMD { |
| 49 |
|
|
| 50 |
< |
ForceDecomposition::ForceDecomposition(SimInfo* info) : info_(info) { |
| 50 |
> |
ForceDecomposition::ForceDecomposition(SimInfo* info, InteractionManager* iMan) : info_(info), interactionMan_(iMan) { |
| 51 |
|
sman_ = info_->getSnapshotManager(); |
| 52 |
|
storageLayout_ = sman_->getStorageLayout(); |
| 53 |
|
ff_ = info_->getForceField(); |
| 85 |
|
cellOffsets_.push_back( Vector3i(-1,-1,1) ); |
| 86 |
|
cellOffsets_.push_back( Vector3i(0, -1,1) ); |
| 87 |
|
cellOffsets_.push_back( Vector3i(1, -1,1) ); |
| 88 |
+ |
|
| 89 |
+ |
// cellAllOffsets are the full space for the cell lists used in |
| 90 |
+ |
// constructing the neighbor lists |
| 91 |
+ |
cellAllOffsets_.clear(); |
| 92 |
+ |
cellAllOffsets_.push_back( Vector3i(0, 0, 0) ); |
| 93 |
+ |
|
| 94 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, -1, -1) ); |
| 95 |
+ |
cellAllOffsets_.push_back( Vector3i(0, -1, -1) ); |
| 96 |
+ |
cellAllOffsets_.push_back( Vector3i(1, -1, -1) ); |
| 97 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, 0, -1) ); |
| 98 |
+ |
cellAllOffsets_.push_back( Vector3i(0, 0, -1) ); |
| 99 |
+ |
cellAllOffsets_.push_back( Vector3i(1, 0, -1) ); |
| 100 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, 1, -1) ); |
| 101 |
+ |
cellAllOffsets_.push_back( Vector3i(0, 1, -1) ); |
| 102 |
+ |
cellAllOffsets_.push_back( Vector3i(1, 1, -1) ); |
| 103 |
+ |
|
| 104 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, -1, 0) ); |
| 105 |
+ |
cellAllOffsets_.push_back( Vector3i(0, -1, 0) ); |
| 106 |
+ |
cellAllOffsets_.push_back( Vector3i(1, -1, 0) ); |
| 107 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, 0, 0) ); |
| 108 |
+ |
// cellAllOffsets_.push_back( Vector3i(0, 0, 0) ); |
| 109 |
+ |
cellAllOffsets_.push_back( Vector3i(1, 0, 0) ); |
| 110 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, 1, 0) ); |
| 111 |
+ |
cellAllOffsets_.push_back( Vector3i(0, 1, 0) ); |
| 112 |
+ |
cellAllOffsets_.push_back( Vector3i(1, 1, 0) ); |
| 113 |
+ |
|
| 114 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, -1, 1) ); |
| 115 |
+ |
cellAllOffsets_.push_back( Vector3i(0, -1, 1) ); |
| 116 |
+ |
cellAllOffsets_.push_back( Vector3i(1, -1, 1) ); |
| 117 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, 0, 1) ); |
| 118 |
+ |
cellAllOffsets_.push_back( Vector3i(0, 0, 1) ); |
| 119 |
+ |
cellAllOffsets_.push_back( Vector3i(1, 0, 1) ); |
| 120 |
+ |
cellAllOffsets_.push_back( Vector3i(-1, 1, 1) ); |
| 121 |
+ |
cellAllOffsets_.push_back( Vector3i(0, 1, 1) ); |
| 122 |
+ |
cellAllOffsets_.push_back( Vector3i(1, 1, 1) ); |
| 123 |
|
} |
| 124 |
|
|
| 125 |
< |
SelfData ForceDecomposition::fillSelfData(int atom1) { |
| 126 |
< |
SelfData sdat; |
| 127 |
< |
// Still Missing atype, skippedCharge, potVec pot, |
| 125 |
> |
void ForceDecomposition::fillSelfData(SelfData &sdat, int atom1) { |
| 126 |
> |
|
| 127 |
> |
sdat.atype = atypesLocal[atom1]; |
| 128 |
> |
|
| 129 |
> |
// Still Missing skippedCharge |
| 130 |
|
if (storageLayout_ & DataStorage::dslElectroFrame) { |
| 131 |
|
sdat.eFrame = &(snap_->atomData.electroFrame[atom1]); |
| 132 |
|
} |
| 147 |
|
sdat.dfrhodrho = &(snap_->atomData.functionalDerivative[atom1]); |
| 148 |
|
} |
| 149 |
|
|
| 150 |
+ |
if (storageLayout_ & DataStorage::dslSkippedCharge) { |
| 151 |
+ |
sdat.skippedCharge = &(snap_->atomData.skippedCharge[atom1]); |
| 152 |
+ |
} |
| 153 |
+ |
|
| 154 |
|
if (storageLayout_ & DataStorage::dslParticlePot) { |
| 155 |
|
sdat.particlePot = &(snap_->atomData.particlePot[atom1]); |
| 156 |
|
} |
| 116 |
– |
|
| 117 |
– |
return sdat; |
| 157 |
|
} |
| 158 |
|
|
| 159 |
|
bool ForceDecomposition::checkNeighborList() { |
| 181 |
|
// a conservative test of list skin crossings |
| 182 |
|
dispmax = 2.0 * sqrt (3.0 * dispmax * dispmax); |
| 183 |
|
|
| 184 |
< |
return (dispmax > skinThickness_); |
| 184 |
> |
|
| 185 |
> |
if (dispmax > skinThickness_) |
| 186 |
> |
return (dispmax > skinThickness_); |
| 187 |
> |
|
| 188 |
> |
return false; |
| 189 |
|
} |
| 190 |
|
} |