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

Comparing trunk/OOPSE-2.0/src/brains/ForceManager.cpp (file contents):
Revision 2344 by chrisfen, Tue Oct 4 19:34:03 2005 UTC vs.
Revision 2363 by chuckv, Wed Oct 12 21:57:16 2005 UTC

# Line 50 | Line 50
50   #include "brains/ForceManager.hpp"
51   #include "primitives/Molecule.hpp"
52   #include "UseTheForce/doForces_interface.h"
53 + #define __C
54 + #include "UseTheForce/DarkSide/fInteractionMap.h"
55   #include "utils/simError.h"
56   namespace oopse {
57  
# Line 180 | Line 182 | namespace oopse {
182      }
183    
184      //initialize data before passing to fortran
185 <    double longRangePotential = 0.0;
185 >    double longRangePotential[LR_POT_TYPES];
186 >    double lrPot = 0.0;
187 >    
188      Mat3x3d tau;
189      short int passedCalcPot = needPotential;
190      short int passedCalcStress = needStress;
191      int isError = 0;
192  
193 +    for (int i=0; i<LR_POT_TYPES;i++){
194 +      longRangePotential[i]=0.0; //Initialize array
195 +    }
196 +
197 +
198 +
199      doForceLoop( pos,
200                   rc,
201                   A,
# Line 193 | Line 203 | namespace oopse {
203                   frc,
204                   trq,
205                   tau.getArrayPointer(),
206 <                 &longRangePotential,
206 >                 longRangePotential,
207                   &passedCalcPot,
208                   &passedCalcStress,
209                   &isError );
# Line 204 | Line 214 | namespace oopse {
214        painCave.isFatal = 1;
215        simError();
216      }
217 +    for (int i=0; i<LR_POT_TYPES;i++){
218 +      lrPot += longRangePotential[i]; //Quick hack
219 +    }
220  
221      //store the tau and long range potential    
222 <    curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = longRangePotential;
222 >    curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = lrPot;
223 >    //  curSnapshot->statData[Stats::LONG_RANGE_POTENTIAL] = longRangePotential;
224      curSnapshot->statData.setTau(tau);
225    }
226  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines