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

Comparing branches/development/src/nonbonded/GB.cpp (file contents):
Revision 1571 by gezelter, Fri May 27 16:45:44 2011 UTC vs.
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC

# Line 36 | Line 36
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38   * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
39 > * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 > * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include <stdio.h>
# Line 239 | Line 240 | namespace OpenMD {
240        mixer.eps0 = sqrt(e1 * e2);
241        
242        RealType er = sqrt(er1 * er2);
243 <      RealType ermu = pow(er,(1.0 / mu_));
243 >      RealType ermu = pow(er, (1.0 / mu_));
244        RealType xp = (1.0 - ermu) / (1.0 + ermu);
245        RealType ap2 = 1.0 / (1.0 + ermu);
246        
247        mixer.xp2 = xp * xp;
248        mixer.xpap2 = xp * ap2;
249        mixer.xpapi2 = xp / ap2;
250 +
251 +      cerr << "mixer" << er1 << " " << er2 << " " << mu_ << " " << ermu << " " << xp <<" " << ap2 << "\n";
252  
253        // only add this pairing if at least one of the atoms is a Gay-Berne atom
254  
# Line 306 | Line 309 | namespace OpenMD {
309      else
310        g = dot(ul1, ul2);
311  
312 +    cerr << "in GB, d = " << *(idat.d) << "\n";
313 +    cerr << "abg = " << a << " " << b << " " << g <<"\n";
314 +
315      RealType au = a / *(idat.rij);
316      RealType bu = b / *(idat.rij);
317      
# Line 315 | Line 321 | namespace OpenMD {
321      
322      RealType H  = (xa2 * au2 + xai2 * bu2 - 2.0*x2*au*bu*g)  / (1.0 - x2*g2);
323      RealType Hp = (xpap2*au2 + xpapi2*bu2 - 2.0*xp2*au*bu*g) / (1.0 - xp2*g2);
324 +    cerr << "xa2, xai2 " << xa2 << " " << xai2 << "\n";
325 +    cerr << "xpap2, xpapi2 " << xpap2 << " " << xpapi2 << "\n";
326 +    cerr << "H Hp = " << H <<  " " << Hp << "\n";
327  
328      RealType sigma = sigma0 / sqrt(1.0 - H);
329      RealType e1 = 1.0 / sqrt(1.0 - x2*g2);
330      RealType e2 = 1.0 - Hp;
331      RealType eps = eps0 * pow(e1,nu_) * pow(e2,mu_);
332 +    cerr << "eps = " << eps0 << " " << e1 << " " << nu_ << " " << e2 << " " << mu_ << "\n";
333      RealType BigR = dw*sigma0 / (*(idat.rij) - sigma + dw*sigma0);
334      
335      RealType R3 = BigR*BigR*BigR;
# Line 330 | Line 340 | namespace OpenMD {
340  
341      RealType U = *(idat.vdwMult) * 4.0 * eps * (R12 - R6);
342  
343 +    cerr << "R12, R6, eps = " << R12 << " " << R6 << " " << eps << " " <<  *(idat.vdwMult) << "\n";
344 +
345      RealType s3 = sigma*sigma*sigma;
346      RealType s03 = sigma0*sigma0*sigma0;
347  
# Line 352 | Line 364 | namespace OpenMD {
364        + 8.0 * eps * mu_ * (R12 - R6) * (xp2*au*bu - Hp*xp2*g) /
365        (1.0 - xp2 * g2) / e2 + 8.0 * eps * s3 * (3.0 * R7 - 6.0 * R13) *
366        (x2 * au * bu - H * x2 * g) / (1.0 - x2 * g2) / (dw * s03);
355    
367  
368 +    cerr << pref1 << " " << pref2 << " " << dUdr <<" " << dUda << " " << dUdb << dUdg << "\n";
369 +
370      Vector3d rhat = *(idat.d) / *(idat.rij);  
371      Vector3d rxu1 = cross(*(idat.d), ul1);
372      Vector3d rxu2 = cross(*(idat.d), ul2);
373      Vector3d uxu = cross(ul1, ul2);
374 +
375 +    cerr << "U = " << U << "\n";
376 +    cerr << "f1 = " << dUdr * rhat + dUda * ul1 + dUdb * ul2 << "\n";
377 +    cerr << "t1 = " << dUda * rxu1 - dUdg * uxu << "\n";
378 +    cerr << "t2 = " << dUdb * rxu2 - dUdg * uxu << "\n";
379 +
380      
381 <    idat.pot[VANDERWAALS_FAMILY] += U *  *(idat.sw);
381 >    (*(idat.pot))[VANDERWAALS_FAMILY] += U *  *(idat.sw);
382      *(idat.f1) += dUdr * rhat + dUda * ul1 + dUdb * ul2;    
383      *(idat.t1) += dUda * rxu1 - dUdg * uxu;
384      *(idat.t2) += dUdb * rxu2 - dUdg * uxu;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines