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

Comparing trunk/src/brains/ForceManager.cpp (file contents):
Revision 1987 by gezelter, Thu Apr 17 19:07:31 2014 UTC vs.
Revision 2031 by jmichalk, Fri Oct 31 18:40:40 2014 UTC

# Line 57 | Line 57
57   #include "primitives/Torsion.hpp"
58   #include "primitives/Inversion.hpp"
59   #include "nonbonded/NonBondedInteraction.hpp"
60 < #include "perturbations/ElectricField.hpp"
60 > #include "perturbations/UniformField.hpp"
61   #include "parallel/ForceMatrixDecomposition.hpp"
62  
63   #include <cstdio>
# Line 405 | Line 405 | namespace OpenMD {
405        interactionMan_->setSimInfo(info_);
406        interactionMan_->initialize();
407  
408 <      // We want to delay the cutoffs until after the interaction
409 <      // manager has set up the atom-atom interactions so that we can
410 <      // query them for suggested cutoff values
408 >      //! We want to delay the cutoffs until after the interaction
409 >      //! manager has set up the atom-atom interactions so that we can
410 >      //! query them for suggested cutoff values
411        setupCutoffs();
412  
413        info_->prepareTopology();      
# Line 417 | Line 417 | namespace OpenMD {
417        if (doHeatFlux_) doParticlePot_ = true;
418  
419        doElectricField_ = info_->getSimParams()->getOutputElectricField();
420 +      doSitePotential_ = info_->getSimParams()->getOutputSitePotential();
421    
422      }
423  
424      ForceFieldOptions& fopts = forceField_->getForceFieldOptions();
425      
426 <    // Force fields can set options on how to scale van der Waals and
427 <    // electrostatic interactions for atoms connected via bonds, bends
428 <    // and torsions in this case the topological distance between
429 <    // atoms is:
430 <    // 0 = topologically unconnected
431 <    // 1 = bonded together
432 <    // 2 = connected via a bend
433 <    // 3 = connected via a torsion
426 >    //! Force fields can set options on how to scale van der Waals and
427 >    //! electrostatic interactions for atoms connected via bonds, bends
428 >    //! and torsions in this case the topological distance between
429 >    //! atoms is:
430 >    //! 0 = topologically unconnected
431 >    //! 1 = bonded together
432 >    //! 2 = connected via a bend
433 >    //! 3 = connected via a torsion
434      
435      vdwScale_.reserve(4);
436      fill(vdwScale_.begin(), vdwScale_.end(), 0.0);
# Line 447 | Line 448 | namespace OpenMD {
448      electrostaticScale_[2] = fopts.getelectrostatic13scale();
449      electrostaticScale_[3] = fopts.getelectrostatic14scale();    
450      
451 <    if (info_->getSimParams()->haveElectricField()) {
452 <      ElectricField* eField = new ElectricField(info_);
451 >    if (info_->getSimParams()->haveUniformField()) {
452 >      UniformField* eField = new UniformField(info_);
453        perturbations_.push_back(eField);
454      }
455  
# Line 716 | Line 717 | namespace OpenMD {
717      potVec exPot(0.0);
718      Vector3d eField1(0.0);
719      Vector3d eField2(0.0);
720 +    RealType sPot1(0.0);
721 +    RealType sPot2(0.0);
722 +                  
723      vector<int>::iterator ia, jb;
724  
725      int loopStart, loopEnd;
# Line 731 | Line 735 | namespace OpenMD {
735      idat.dVdFQ1 = &dVdFQ1;
736      idat.dVdFQ2 = &dVdFQ2;
737      idat.eField1 = &eField1;
738 <    idat.eField2 = &eField2;  
738 >    idat.eField2 = &eField2;
739 >    idat.sPot1 = &sPot1;
740 >    idat.sPot2 = &sPot2;
741      idat.f1 = &f1;
742      idat.sw = &sw;
743      idat.shiftedPot = (cutoffMethod_ == SHIFTED_POTENTIAL) ? true : false;
744      idat.shiftedForce = (cutoffMethod_ == SHIFTED_FORCE || cutoffMethod_ == TAYLOR_SHIFTED) ? true : false;
745      idat.doParticlePot = doParticlePot_;
746      idat.doElectricField = doElectricField_;
747 +    idat.doSitePotential = doSitePotential_;
748      sdat.doParticlePot = doParticlePot_;
749      
750      loopEnd = PAIR_LOOP;
# Line 777 | Line 784 | namespace OpenMD {
784              fij.zero();
785              eField1.zero();
786              eField2.zero();
787 +            sPot1 = 0.0;
788 +            sPot2 = 0.0;
789            }
790            
791            in_switching_region = switcher_->getSwitch(rgrpsq, sw, dswdr,
# Line 834 | Line 843 | namespace OpenMD {
843                  } else {
844                    interactionMan_->doPair(idat);
845                    fDecomp_->unpackInteractionData(idat, atom1, atom2);
846 +                  /*
847 +                  if(atom1 == 971){
848 +                    cerr << "972: " << *(idat.dVdFQ1) << "\n";
849 +                  }
850 +                  if(atom2 == 971){
851 +                    cerr << "972: " << *(idat.dVdFQ2) << "\n";
852 +                  }
853 +                  if(atom1 == 766){
854 +                    cerr << "767: " << *(idat.dVdFQ1) << "\n";
855 +                  }
856 +                  if(atom2 == 766){
857 +                    cerr << "767: " << *(idat.dVdFQ2) << "\n";
858 +                  }
859 +                  */
860                    vij += vpair;
861                    fij += f1;
862                    stressTensor -= outProduct( *(idat.d), f1);
# Line 936 | Line 959 | namespace OpenMD {
959      if (info_->requiresSelfCorrection()) {
960        for (unsigned int atom1 = 0; atom1 < info_->getNAtoms(); atom1++) {
961          fDecomp_->fillSelfData(sdat, atom1);
962 +        /*      
963 +        if(atom1 == 971 || atom1 == 766 || atom1 == 898){
964 +          cout << "atom id: " << atom1 << "\tsdat.dVdFQ: " << *(sdat.dVdFQ) << "\n";
965 +        }
966 +        */
967          interactionMan_->doSelfCorrection(sdat);
968 +        /*
969 +        if(atom1 == 971 || atom1 == 766 || atom1 == 898){
970 +          cout << "\tsdat.dVdFQ: " << *(sdat.dVdFQ) << "\n";
971 +        }
972 +        */
973        }
974      }
975  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines