ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/ForceManager.cpp
(Generate patch)

Comparing branches/development/src/brains/ForceManager.cpp (file contents):
Revision 1761 by gezelter, Fri Jun 22 20:01:37 2012 UTC vs.
Revision 1767 by gezelter, Fri Jul 6 22:01:58 2012 UTC

# Line 449 | Line 449 | namespace OpenMD {
449      Molecule::CutoffGroupIterator ci;
450      CutoffGroup* cg;
451      
452 <    // forces are zeroed here, before any are accumulated.
452 >    // forces and potentials are zeroed here, before any are
453 >    // accumulated.
454      
455 +    Snapshot* snap = info_->getSnapshotManager()->getCurrentSnapshot();
456 +
457 +    snap->setBondPotential(0.0);
458 +    snap->setBendPotential(0.0);
459 +    snap->setTorsionPotential(0.0);
460 +    snap->setInversionPotential(0.0);
461 +
462 +    potVec zeroPot(0.0);
463 +    snap->setLongRangePotential(zeroPot);
464 +    snap->setExcludedPotentials(zeroPot);
465 +
466 +    snap->setRestraintPotential(0.0);
467 +    snap->setRawPotential(0.0);
468 +
469      for (mol = info_->beginMolecule(mi); mol != NULL;
470           mol = info_->nextMolecule(mi)) {
471        for(atom = mol->beginAtom(ai); atom != NULL;
# Line 608 | Line 623 | namespace OpenMD {
623      curSnapshot->setTorsionPotential(torsionPotential);
624      curSnapshot->setInversionPotential(inversionPotential);
625      
626 <    RealType shortRangePotential = bondPotential + bendPotential +
627 <      torsionPotential +  inversionPotential;    
626 >    // RealType shortRangePotential = bondPotential + bendPotential +
627 >    //   torsionPotential +  inversionPotential;    
628  
629 <    curSnapshot->setShortRangePotential(shortRangePotential);
629 >    // curSnapshot->setShortRangePotential(shortRangePotential);
630    }
631    
632    void ForceManager::longRangeInteractions() {
# Line 660 | Line 675 | namespace OpenMD {
675      InteractionData idat;
676      SelfData sdat;
677      RealType mf;
663    RealType lrPot;
678      RealType vpair;
679      RealType dVdFQ1(0.0);
680      RealType dVdFQ2(0.0);
# Line 854 | Line 868 | namespace OpenMD {
868  
869            fDecomp_->collectIntermediateData();
870  
871 <          for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
871 >          for (unsigned int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
872              fDecomp_->fillSelfData(sdat, atom1);
873              interactionMan_->doPreForce(sdat);
874            }
# Line 869 | Line 883 | namespace OpenMD {
883      fDecomp_->collectData();
884          
885      if (info_->requiresSelfCorrection()) {
886 <      for (int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
886 >      for (unsigned int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
887          fDecomp_->fillSelfData(sdat, atom1);
888          interactionMan_->doSelfCorrection(sdat);
889        }
# Line 881 | Line 895 | namespace OpenMD {
895      longRangePotential = *(fDecomp_->getEmbeddingPotential()) +
896        *(fDecomp_->getPairwisePotential());
897  
898 <    curSnapshot->setLongRangePotentialFamilies(longRangePotential);
885 <
886 <    lrPot = longRangePotential.sum();
887 <
888 <    //store the long range potential  
889 <    curSnapshot->setLongRangePotential(lrPot);
898 >    curSnapshot->setLongRangePotential(longRangePotential);
899      
900      curSnapshot->setExcludedPotentials(*(fDecomp_->getExcludedSelfPotential()) +
901                                           *(fDecomp_->getExcludedPotential()));
# Line 900 | Line 909 | namespace OpenMD {
909      Molecule::RigidBodyIterator rbIter;
910      RigidBody* rb;
911      Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
912 <    
912 >  
913      // collect the atomic forces onto rigid bodies
914      
915      for (mol = info_->beginMolecule(mi); mol != NULL;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines