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

Comparing branches/development/src/UseTheForce/ForceField.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1710 by gezelter, Fri May 18 21:44:02 2012 UTC

# Line 52 | Line 52
52   #include "UseTheForce/ForceField.hpp"
53   #include "utils/simError.h"
54   #include "utils/Tuple.hpp"
55 + #include "types/LennardJonesAdapter.hpp"
56 +
57   namespace OpenMD {
58  
59    ForceField::ForceField() {
# Line 635 | Line 637 | namespace OpenMD {
637    }
638    
639    RealType ForceField::getRcutFromAtomType(AtomType* at) {
638    /**@todo */
639    GenericData* data;
640      RealType rcut = 0.0;
641      
642 <    if (at->isLennardJones()) {
643 <      data = at->getPropertyByName("LennardJones");
644 <      if (data != NULL) {
645 <        LJParamGenericData* ljData = dynamic_cast<LJParamGenericData*>(data);
646 <        
647 <        if (ljData != NULL) {
648 <          LJParam ljParam = ljData->getData();
649 <          
650 <          //by default use 2.5*sigma as cutoff radius
651 <          rcut = 2.5 * ljParam.sigma;
652 <          
653 <        } else {
654 <          sprintf( painCave.errMsg,
655 <                   "Can not cast GenericData to LJParam\n");
656 <          painCave.severity = OPENMD_ERROR;
657 <          painCave.isFatal = 1;
658 <          simError();          
659 <        }            
660 <      } else {
661 <        sprintf( painCave.errMsg, "Can not find Parameters for LennardJones\n");
662 <        painCave.severity = OPENMD_ERROR;
663 <        painCave.isFatal = 1;
664 <        simError();          
665 <      }
642 >    LennardJonesAdapter lja = LennardJonesAdapter(at);
643 >    if (lja.isLennardJones()) {
644 >      rcut = 2.5 * lja.getSigma();
645      }
646      return rcut;    
647    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines