| 86 |
|
* simulation for suggested cutoff values (e.g. 2.5 * sigma). |
| 87 |
|
* Use the maximum suggested value that was found. |
| 88 |
|
* |
| 89 |
< |
* cutoffMethod : (one of HARD, SWITCHED, SHIFTED_FORCE, SHIFTED_POTENTIAL) |
| 89 |
> |
* cutoffMethod : (one of HARD, SWITCHED, SHIFTED_FORCE, |
| 90 |
> |
* or SHIFTED_POTENTIAL) |
| 91 |
|
* If cutoffMethod was explicitly set, use that choice. |
| 92 |
|
* If cutoffMethod was not explicitly set, use SHIFTED_FORCE |
| 93 |
|
* |
| 295 |
|
void ForceManager::initialize() { |
| 296 |
|
|
| 297 |
|
if (!info_->isTopologyDone()) { |
| 298 |
+ |
|
| 299 |
|
info_->update(); |
| 300 |
|
interactionMan_->setSimInfo(info_); |
| 301 |
|
interactionMan_->initialize(); |
| 303 |
|
// We want to delay the cutoffs until after the interaction |
| 304 |
|
// manager has set up the atom-atom interactions so that we can |
| 305 |
|
// query them for suggested cutoff values |
| 304 |
– |
|
| 306 |
|
setupCutoffs(); |
| 307 |
|
|
| 308 |
|
info_->prepareTopology(); |
| 310 |
|
|
| 311 |
|
ForceFieldOptions& fopts = forceField_->getForceFieldOptions(); |
| 312 |
|
|
| 313 |
< |
// Force fields can set options on how to scale van der Waals and electrostatic |
| 314 |
< |
// interactions for atoms connected via bonds, bends and torsions |
| 315 |
< |
// in this case the topological distance between atoms is: |
| 313 |
> |
// Force fields can set options on how to scale van der Waals and |
| 314 |
> |
// electrostatic interactions for atoms connected via bonds, bends |
| 315 |
> |
// and torsions in this case the topological distance between |
| 316 |
> |
// atoms is: |
| 317 |
|
// 0 = topologically unconnected |
| 318 |
|
// 1 = bonded together |
| 319 |
|
// 2 = connected via a bend |
| 365 |
|
|
| 366 |
|
for (mol = info_->beginMolecule(mi); mol != NULL; |
| 367 |
|
mol = info_->nextMolecule(mi)) { |
| 368 |
< |
for(atom = mol->beginAtom(ai); atom != NULL; atom = mol->nextAtom(ai)) { |
| 368 |
> |
for(atom = mol->beginAtom(ai); atom != NULL; |
| 369 |
> |
atom = mol->nextAtom(ai)) { |
| 370 |
|
atom->zeroForcesAndTorques(); |
| 371 |
|
} |
| 372 |
< |
|
| 372 |
> |
|
| 373 |
|
//change the positions of atoms which belong to the rigidbodies |
| 374 |
|
for (rb = mol->beginRigidBody(rbIter); rb != NULL; |
| 375 |
|
rb = mol->nextRigidBody(rbIter)) { |
| 376 |
|
rb->zeroForcesAndTorques(); |
| 377 |
|
} |
| 378 |
< |
|
| 378 |
> |
|
| 379 |
|
if(info_->getNGlobalCutoffGroups() != info_->getNGlobalAtoms()){ |
| 380 |
|
for(cg = mol->beginCutoffGroup(ci); cg != NULL; |
| 381 |
|
cg = mol->nextCutoffGroup(ci)) { |
| 384 |
|
} |
| 385 |
|
} |
| 386 |
|
} |
| 387 |
< |
|
| 387 |
> |
|
| 388 |
|
// Zero out the stress tensor |
| 389 |
|
tau *= 0.0; |
| 390 |
|
|
| 438 |
|
dataSet.prev.angle = dataSet.curr.angle = angle; |
| 439 |
|
dataSet.prev.potential = dataSet.curr.potential = currBendPot; |
| 440 |
|
dataSet.deltaV = 0.0; |
| 441 |
< |
bendDataSets.insert(map<Bend*, BendDataSet>::value_type(bend, dataSet)); |
| 441 |
> |
bendDataSets.insert(map<Bend*, BendDataSet>::value_type(bend, |
| 442 |
> |
dataSet)); |
| 443 |
|
}else { |
| 444 |
|
i->second.prev.angle = i->second.curr.angle; |
| 445 |
|
i->second.prev.potential = i->second.curr.potential; |
| 526 |
|
mol = info_->nextMolecule(mi)) { |
| 527 |
|
for(cg = mol->beginCutoffGroup(ci); cg != NULL; |
| 528 |
|
cg = mol->nextCutoffGroup(ci)) { |
| 529 |
+ |
cerr << "branch1\n"; |
| 530 |
+ |
cerr << "globind = " << cg->getGlobalIndex() << "\n"; |
| 531 |
|
cg->updateCOM(); |
| 532 |
|
} |
| 533 |
|
} |
| 534 |
|
} else { |
| 535 |
|
// center of mass of the group is the same as position of the atom |
| 536 |
|
// if cutoff group does not exist |
| 537 |
+ |
cerr << "branch2\n"; |
| 538 |
|
cgConfig->position = config->position; |
| 539 |
|
} |
| 540 |
|
|
| 621 |
|
for (vector<int>::iterator jb = atomListColumn.begin(); |
| 622 |
|
jb != atomListColumn.end(); ++jb) { |
| 623 |
|
atom2 = (*jb); |
| 624 |
< |
|
| 624 |
> |
|
| 625 |
|
if (!fDecomp_->skipAtomPair(atom1, atom2)) { |
| 626 |
|
vpair = 0.0; |
| 627 |
|
workPot = 0.0; |
| 636 |
|
if (atomListRow.size() == 1 && atomListColumn.size() == 1) { |
| 637 |
|
idat.d = &d_grp; |
| 638 |
|
idat.r2 = &rgrpsq; |
| 639 |
+ |
cerr << "dgrp = " << d_grp << "\n"; |
| 640 |
|
} else { |
| 641 |
|
d = fDecomp_->getInteratomicVector(atom1, atom2); |
| 642 |
|
curSnapshot->wrapVector( d ); |
| 643 |
|
r2 = d.lengthSquare(); |
| 644 |
+ |
cerr << "datm = " << d<< "\n"; |
| 645 |
|
idat.d = &d; |
| 646 |
|
idat.r2 = &r2; |
| 647 |
|
} |
| 648 |
|
|
| 649 |
+ |
cerr << "idat.d = " << *(idat.d) << "\n"; |
| 650 |
|
r = sqrt( *(idat.r2) ); |
| 651 |
|
idat.rij = &r; |
| 652 |
|
|
| 655 |
|
} else { |
| 656 |
|
interactionMan_->doPair(idat); |
| 657 |
|
fDecomp_->unpackInteractionData(idat, atom1, atom2); |
| 658 |
+ |
|
| 659 |
+ |
cerr << "d = " << *(idat.d) << "\tv=" << vpair << "\tf=" << f1 << "\n"; |
| 660 |
|
vij += vpair; |
| 661 |
|
fij += f1; |
| 662 |
|
tau -= outProduct( *(idat.d), f1); |
| 720 |
|
} |
| 721 |
|
|
| 722 |
|
if (iLoop == PREPAIR_LOOP) { |
| 723 |
< |
if (info_->requiresPrepair()) { |
| 723 |
> |
if (info_->requiresPrepair()) { |
| 724 |
> |
|
| 725 |
|
fDecomp_->collectIntermediateData(); |
| 726 |
|
|
| 727 |
|
for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) { |
| 728 |
|
fDecomp_->fillSelfData(sdat, atom1); |
| 729 |
|
interactionMan_->doPreForce(sdat); |
| 730 |
|
} |
| 731 |
< |
|
| 732 |
< |
|
| 733 |
< |
fDecomp_->distributeIntermediateData(); |
| 731 |
> |
|
| 732 |
> |
fDecomp_->distributeIntermediateData(); |
| 733 |
> |
|
| 734 |
|
} |
| 735 |
|
} |
| 736 |
|
|