62 |
|
|
63 |
|
ForceManager::ForceManager(SimInfo * info) : info_(info), |
64 |
|
NBforcesInitialized_(false) { |
65 |
– |
lj_ = LJ::Instance(); |
66 |
– |
lj_->setForceField(info_->getForceField()); |
67 |
– |
|
68 |
– |
eam_ = EAM::Instance(); |
69 |
– |
eam_->setForceField(info_->getForceField()); |
65 |
|
} |
66 |
|
|
67 |
|
void ForceManager::calcForces() { |
280 |
|
//initialize data before passing to fortran |
281 |
|
RealType longRangePotential[LR_POT_TYPES]; |
282 |
|
RealType lrPot = 0.0; |
288 |
– |
Vector3d totalDipole; |
283 |
|
int isError = 0; |
284 |
|
|
285 |
|
for (int i=0; i<LR_POT_TYPES;i++){ |
306 |
|
for (int i=0; i<LR_POT_TYPES;i++){ |
307 |
|
lrPot += longRangePotential[i]; //Quick hack |
308 |
|
} |
309 |
< |
|
316 |
< |
// grab the simulation box dipole moment if specified |
317 |
< |
if (info_->getCalcBoxDipole()){ |
318 |
< |
getAccumulatedBoxDipole(totalDipole.getArrayPointer()); |
319 |
< |
|
320 |
< |
curSnapshot->statData[Stats::BOX_DIPOLE_X] = totalDipole(0); |
321 |
< |
curSnapshot->statData[Stats::BOX_DIPOLE_Y] = totalDipole(1); |
322 |
< |
curSnapshot->statData[Stats::BOX_DIPOLE_Z] = totalDipole(2); |
323 |
< |
} |
324 |
< |
|
309 |
> |
|
310 |
|
//store the tau and long range potential |
311 |
|
curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot; |
312 |
|
curSnapshot->statData[Stats::VANDERWAALS_POTENTIAL] = longRangePotential[VDW_POT]; |