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 1597 by gezelter, Tue Jul 26 15:49:24 2011 UTC vs.
Revision 1613 by gezelter, Thu Aug 18 20:18:19 2011 UTC

# Line 108 | Line 108 | namespace OpenMD {
108      
109      Globals* simParams_ = info_->getSimParams();
110      ForceFieldOptions& forceFieldOptions_ = forceField_->getForceFieldOptions();
111 +    int mdFileVersion;
112      
113 +    if (simParams_->haveMDfileVersion())
114 +      mdFileVersion = simParams_->getMDfileVersion();
115 +    else
116 +      mdFileVersion = 0;
117 +  
118 +
119      if (simParams_->haveCutoffRadius()) {
120        rCut_ = simParams_->getCutoffRadius();
121      } else {      
# Line 368 | Line 375 | namespace OpenMD {
375        for(atom = mol->beginAtom(ai); atom != NULL;
376            atom = mol->nextAtom(ai)) {
377          atom->zeroForcesAndTorques();
371        cerr << "apos = " << atom->getPos() << "\n";
378        }
379        
380        //change the positions of atoms which belong to the rigidbodies
# Line 382 | Line 388 | namespace OpenMD {
388              cg = mol->nextCutoffGroup(ci)) {
389            //calculate the center of mass of cutoff group
390            cg->updateCOM();
385          cerr << "cgpos = " << cg->getPos() << "\n";
391          }
392        }      
393      }
# Line 528 | Line 533 | namespace OpenMD {
533             mol = info_->nextMolecule(mi)) {
534          for(cg = mol->beginCutoffGroup(ci); cg != NULL;
535              cg = mol->nextCutoffGroup(ci)) {
531          cerr << "branch1\n";
532          cerr << "globind = " << cg->getGlobalIndex() << "\n";
536            cg->updateCOM();
537          }
538        }      
539      } else {
540        // center of mass of the group is the same as position of the atom  
541        // if cutoff group does not exist
539      cerr << "branch2\n";
542        cgConfig->position = config->position;
543      }
544  
# Line 587 | Line 589 | namespace OpenMD {
589          bool update_nlist = fDecomp_->checkNeighborList();
590          if (update_nlist)
591            neighborList = fDecomp_->buildNeighborList();
592 <      }      
593 <        
592 >      }            
593 >
594        for (vector<pair<int, int> >::iterator it = neighborList.begin();
595               it != neighborList.end(); ++it) {
596                  
# Line 598 | Line 600 | namespace OpenMD {
600          cuts = fDecomp_->getGroupCutoffs(cg1, cg2);
601  
602          d_grp  = fDecomp_->getIntergroupVector(cg1, cg2);
603 +
604          curSnapshot->wrapVector(d_grp);        
605          rgrpsq = d_grp.lengthSquare();
603
606          rCutSq = cuts.second;
607  
608          if (rgrpsq < rCutSq) {
# Line 615 | Line 617 | namespace OpenMD {
617                
618            atomListRow = fDecomp_->getAtomsInGroupRow(cg1);
619            atomListColumn = fDecomp_->getAtomsInGroupColumn(cg2);
620 +                      
621  
622            for (vector<int>::iterator ia = atomListRow.begin();
623                 ia != atomListRow.end(); ++ia) {            
# Line 638 | Line 641 | namespace OpenMD {
641                  if (atomListRow.size() == 1 && atomListColumn.size() == 1) {
642                    idat.d = &d_grp;
643                    idat.r2 = &rgrpsq;
641                  cerr << "dgrp = " << d_grp << "\n";
644                  } else {
645                    d = fDecomp_->getInteratomicVector(atom1, atom2);
646                    curSnapshot->wrapVector( d );
647                    r2 = d.lengthSquare();
646                  cerr << "datm = " << d<< "\n";
648                    idat.d = &d;
649                    idat.r2 = &r2;
650                  }
651 <                
651 <                cerr << "idat.d = " << *(idat.d) << "\n";
651 >              
652                  r = sqrt( *(idat.r2) );
653                  idat.rij = &r;
654                
# Line 658 | Line 658 | namespace OpenMD {
658                    interactionMan_->doPair(idat);
659                    fDecomp_->unpackInteractionData(idat, atom1, atom2);
660  
661                  cerr << "d = " << *(idat.d) << "\tv=" << vpair << "\tf=" << f1 << "\n";
661                    vij += vpair;
662                    fij += f1;
663                    tau -= outProduct( *(idat.d), f1);
# Line 714 | Line 713 | namespace OpenMD {
713                  }
714                }
715              }
716 <            //if (!SIM_uses_AtomicVirial) {
716 >            //if (!info_->usesAtomicVirial()) {
717              //  tau -= outProduct(d_grp, fij);
718              //}
719            }
# Line 735 | Line 734 | namespace OpenMD {
734  
735          }
736        }
738
737      }
738      
739      fDecomp_->collectData();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines