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

Comparing trunk/src/integrators/RNEMD.cpp (file contents):
Revision 1329 by gezelter, Sat Mar 14 01:23:53 2009 UTC vs.
Revision 1331 by gezelter, Thu Apr 2 16:04:52 2009 UTC

# Line 59 | Line 59 | namespace oopse {
59  
60   namespace oopse {
61    
62 <  RNEMD::RNEMD(SimInfo* info) : info_(info) {
62 >  RNEMD::RNEMD(SimInfo* info) : info_(info), evaluator_(info), seleMan_(info) {
63      
64      int seedValue;
65      Globals * simParams = info->getSimParams();
66 +
67 +    stringToEnumMap_["Kinetic"] = rnemdKinetic;
68 +    stringToEnumMap_["Px"] = rnemdPx;
69 +    stringToEnumMap_["Py"] = rnemdPy;
70 +    stringToEnumMap_["Pz"] = rnemdPz;
71 +    stringToEnumMap_["Unknown"] = rnemdUnknown;
72 +
73 +    rnemdObjectSelection_ = simParams->getRNEMD_objectSelection();
74 +
75 +    std::cerr << "calling  evaluator with " << rnemdObjectSelection_ << "\n";
76 +    evaluator_.loadScriptString(rnemdObjectSelection_);
77 +    std::cerr << "done";
78      
79 +    const std::string st = simParams->getRNEMD_swapType();
80 +
81 +    std::map<std::string, RNEMDTypeEnum>::iterator i;
82 +    i = stringToEnumMap_.find(st);
83 +    rnemdType_  = (i == stringToEnumMap_.end()) ? RNEMD::rnemdUnknown : i->second;
84 +
85 +    set_RNEMD_swapTime(simParams->getRNEMD_swapTime());
86 +    set_RNEMD_nBins(simParams->getRNEMD_nBins());
87 +    exchangeSum_ = 0.0;
88 +    
89   #ifndef IS_MPI
90      if (simParams->haveSeed()) {
91        seedValue = simParams->getSeed();
# Line 84 | Line 106 | namespace oopse {
106    RNEMD::~RNEMD() {
107      delete randNumGen_;
108    }
109 <  
109 >
110    void RNEMD::doSwap() {
111      std::cerr << "in RNEMD!\n";  
112 +    std::cerr << "nBins = " << nBins_ << "\n";
113 +    std::cerr << "swapTime = " << swapTime_ << "\n";
114 +    std::cerr << "exchangeSum = " << exchangeSum_ << "\n";
115 +    std::cerr << "swapType = " << rnemdType_ << "\n";
116 +    std::cerr << "selection = " << rnemdObjectSelection_ << "\n";
117 +
118 +    seleMan_.setSelectionSet(evaluator_.evaluate());
119 +
120 +    std::cerr << "selectionCount = " << seleMan_.getSelectionCount() << "\n\n";
121 +
122 +    int i;
123 +    StuntDouble* sd;
124 +
125 +    for (sd = seleMan_.beginSelected(i); sd != NULL; sd = seleMan_.nextSelected(i)) {
126 +      Vector3d pos = sd->getPos();
127 +      //wrap the stuntdoubles into a cell      
128 +      if (usePeriodicBoundaryConditions_)
129 +        info_->getSnapshotManager()->getCurrentSnapshot()->wrapVector(pos);
130 +      int binNo = int(nBins_ * (pos.z()) / hmat(2,2));
131 +      sliceSDLists_[binNo].push_back(sd);
132 +    }
133 +
134    }  
135   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines