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(); |
54 |
+ |
userChoseCutoff_ = false; |
55 |
|
|
56 |
|
Globals* simParams_ = info_->getSimParams(); |
57 |
|
|
87 |
|
cellOffsets_.push_back( Vector3i(1, -1,1) ); |
88 |
|
} |
89 |
|
|
90 |
< |
SelfData ForceDecomposition::fillSelfData(int atom1) { |
91 |
< |
SelfData sdat; |
92 |
< |
// Still Missing atype, skippedCharge, potVec pot, |
90 |
> |
void ForceDecomposition::fillSelfData(SelfData &sdat, int atom1) { |
91 |
> |
|
92 |
> |
sdat.atype = ff_->getAtomType(idents[atom1]); |
93 |
> |
|
94 |
> |
// Still Missing skippedCharge |
95 |
|
if (storageLayout_ & DataStorage::dslElectroFrame) { |
96 |
|
sdat.eFrame = &(snap_->atomData.electroFrame[atom1]); |
97 |
|
} |
112 |
|
sdat.dfrhodrho = &(snap_->atomData.functionalDerivative[atom1]); |
113 |
|
} |
114 |
|
|
115 |
< |
return sdat; |
115 |
> |
if (storageLayout_ & DataStorage::dslSkippedCharge) { |
116 |
> |
sdat.skippedCharge = &(snap_->atomData.skippedCharge[atom1]); |
117 |
> |
} |
118 |
> |
|
119 |
> |
if (storageLayout_ & DataStorage::dslParticlePot) { |
120 |
> |
sdat.particlePot = &(snap_->atomData.particlePot[atom1]); |
121 |
> |
} |
122 |
|
} |
123 |
|
|
124 |
|
bool ForceDecomposition::checkNeighborList() { |
128 |
|
// if we have changed the group identities or haven't set up the |
129 |
|
// saved positions we automatically will need a neighbor list update: |
130 |
|
|
131 |
< |
if ( saved_CG_positions_.size() != nGroups ) return true; |
131 |
> |
if ( saved_CG_positions_.size() != nGroups ) { |
132 |
> |
cerr << "build because size\n"; |
133 |
> |
return true; |
134 |
> |
} |
135 |
|
|
136 |
|
RealType dispmax = 0.0; |
137 |
|
Vector3d disp; |
149 |
|
// a conservative test of list skin crossings |
150 |
|
dispmax = 2.0 * sqrt (3.0 * dispmax * dispmax); |
151 |
|
|
152 |
< |
return (dispmax > skinThickness_); |
152 |
> |
|
153 |
> |
if (dispmax > skinThickness_) { |
154 |
> |
cerr << "build because movement\n"; |
155 |
> |
return (dispmax > skinThickness_); |
156 |
> |
} else { |
157 |
> |
cerr << "not rebuilding\n"; |
158 |
> |
} |
159 |
> |
return false; |
160 |
|
} |
161 |
|
} |