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

Comparing branches/development/src/nonbonded/SC.cpp (file contents):
Revision 1549 by gezelter, Wed Apr 27 18:38:15 2011 UTC vs.
Revision 1554 by gezelter, Sat Apr 30 02:54:02 2011 UTC

# Line 306 | Line 306 | namespace OpenMD {
306      
307      if (!initialized_) initialize();
308      
309 <    SCInteractionData mixer = MixingMap[idat.atypes];
309 >    SCInteractionData mixer = MixingMap[ *(idat.atypes) ];
310  
311      RealType rcij = mixer.rCut;
312  
313 <    if (idat.rij < rcij) {
314 <      idat.rho_i_at_j = mixer.phi->getValueAt(idat.rij);
315 <      idat.rho_j_at_i = idat.rho_i_at_j;
313 >    if ( *(idat.rij)  < rcij) {
314 >      *(idat.rho_i_at_j) = mixer.phi->getValueAt( *(idat.rij) );
315 >      *(idat.rho_j_at_i) = *(idat.rho_i_at_j);
316      } else {
317 <      idat.rho_i_at_j = 0.0;
318 <      idat.rho_j_at_i = 0.0;
317 >      *(idat.rho_i_at_j) = 0.0;
318 >      *(idat.rho_j_at_i) = 0.0;
319      }
320 <
320 >    
321      return;
322    }
323  
# Line 327 | Line 327 | namespace OpenMD {
327  
328      SCAtomData data1 = SCMap[sdat.atype];
329      
330 <    sdat.frho = - data1.c * data1.epsilon * sqrt(sdat.rho);
331 <    sdat.dfrhodrho = 0.5 * sdat.frho / sdat.rho;
330 >    *(sdat.frho) = - data1.c * data1.epsilon * sqrt( *(sdat.rho) );
331 >    *(sdat.dfrhodrho) = 0.5 * *(sdat.frho) / *(sdat.rho);
332      
333      return;
334    }
# Line 338 | Line 338 | namespace OpenMD {
338      
339      if (!initialized_) initialize();
340      
341 <    SCAtomData data1 = SCMap[idat.atypes.first];
342 <    SCAtomData data2 = SCMap[idat.atypes.second];
341 >    SCAtomData data1 = SCMap[idat.atypes->first];
342 >    SCAtomData data2 = SCMap[idat.atypes->second];
343  
344 <    SCInteractionData mixer = MixingMap[idat.atypes];
344 >    SCInteractionData mixer = MixingMap[*(idat.atypes)];
345  
346      RealType rcij = mixer.rCut;
347  
348 <    if (idat.rij < rcij) {
348 >    if ( *(idat.rij)  < rcij) {
349        RealType vcij = mixer.vCut;
350        
351        pair<RealType, RealType> res;
352        
353 <      res = mixer.phi->getValueAndDerivativeAt(idat.rij);
353 >      res = mixer.phi->getValueAndDerivativeAt( *(idat.rij) );
354        RealType rhtmp = res.first;
355        RealType drhodr = res.second;
356        
357 <      res = mixer.V->getValueAndDerivativeAt(idat.rij);
357 >      res = mixer.V->getValueAndDerivativeAt( *(idat.rij) );
358        RealType vptmp = res.first;
359        RealType dvpdr = res.second;
360        
361        RealType pot_temp = vptmp - vcij;
362 <      idat.vpair += pot_temp;
362 >      *(idat.vpair) += pot_temp;
363        
364 <      RealType dudr = drhodr * (idat.dfrho1 + idat.dfrho2) + dvpdr;
364 >      RealType dudr = drhodr * ( *(idat.dfrho1) + *(idat.dfrho2) ) + dvpdr;
365        
366 <      idat.f1 += idat.d * dudr / idat.rij;
366 >      *(idat.f1) += *(idat.d) * dudr / *(idat.rij) ;
367          
368        // particle_pot is the difference between the full potential
369        // and the full potential without the presence of a particular
# Line 377 | Line 377 | namespace OpenMD {
377        // Most of the particle_pot heavy lifting comes from the
378        // pair interaction, and will be handled by vpair.
379        
380 <      idat.fshift1 = - data1.c * data1.epsilon * sqrt(idat.rho1 - rhtmp);
381 <      idat.fshift2 = - data2.c * data2.epsilon * sqrt(idat.rho2 - rhtmp);
380 >      *(idat.fshift1) = - data1.c * data1.epsilon * sqrt( *(idat.rho1) - rhtmp);
381 >      *(idat.fshift2) = - data2.c * data2.epsilon * sqrt( *(idat.rho2) - rhtmp);
382        
383 <      idat.pot[3] += pot_temp;
383 >      idat.pot[METALLIC_FAMILY] += pot_temp;
384      }
385        
386      return;    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines