Path Integral Quantum Monte Carlo
potential.h
Go to the documentation of this file.
1 
9 #ifndef POTENTIAL_H
10 #define POTENTIAL_H
11 
12 #include "common.h"
13 #include "constants.h"
14 
15 class Path;
16 class LookupTable;
17 class Container;
18 
19 // ========================================================================
20 // PotentialBase Class
21 // ========================================================================
33 
34  public:
35  PotentialBase ();
36  virtual ~PotentialBase();
37 
39  virtual double V(const dVec &) { return 0.0; }
40 
42  virtual double V(const dVec &, const dVec &) { return 0.0; }
43 
45  virtual dVec gradV(const dVec &) { return 0.0; }
46 
48  virtual double grad2V(const dVec &) { return 0.0; }
49 
52  virtual double dVdlambda(const dVec &, const dVec &) {return 0.0;}
53  virtual double dVdtau(const dVec &, const dVec &) {return 0.0;}
54 
56  virtual Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
57 
59  void output(const double);
60 
61  double tailV;
62 
64  virtual Array<double,1> getExcLen();
65 
66  protected:
67  double deltaSeparation(double sep1,double sep2) const;
68 };
69 
70 // ========================================================================
71 // TabulatedPotential Class
72 // ========================================================================
81  public:
83  virtual ~TabulatedPotential();
84 
85  protected:
86  Array <double,1> lookupV;
87  Array <double,1> lookupdVdr;
88  Array <double,1> lookupd2Vdr2;
89 
90  double dr;
92 
93  TinyVector<double,2> extV;
94  TinyVector<double,2> extdVdr;
95  TinyVector<double,2> extd2Vdr2;
96 
97  /* Initialize all data structures */
98  void initLookupTable(const double, const double);
99 
100  /* Returns the 2-point spline fit to the lookup table */
101  virtual double newtonGregory(const Array<double,1>&, const TinyVector<double,2>&, const double);
102 
103  /* Returns a bare lookup value */
104  virtual double direct(const Array<double,1>&, const TinyVector<double,2>&, const double);
105 
107  virtual double valueV (const double) = 0;
108 
110  virtual double valuedVdr (const double) = 0;
111 
113  virtual double valued2Vdr2 (const double) = 0;
114 
115 };
116 
117 // ========================================================================
118 // FreePotential Class
119 // ========================================================================
124  public:
125  FreePotential();
126  ~FreePotential();
127 
129  double V(const dVec &sep) { return 0.0*sep[0]; };
130 
132  dVec gradV(const dVec &pos) {
133  return (0.0*pos);
134  }
135 };
136 
137 // ========================================================================
138 // HarmonicPotential Class
139 // ========================================================================
146  public:
148  HarmonicPotential (double);
150 
151  double omega2; //The SHO frequency in units of hbar
152 
154  double V(const dVec &r) {
155  return (omega2*dot(r,r)/(4.0*constants()->lambda()));
156  }
157 
159  dVec gradV(const dVec &r) {
160  dVec tempr;
161  tempr = r;
162  return (omega2*tempr/(2.0*constants()->lambda()));
163  }
164 
166  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
167 };
168 
169 // ========================================================================
170 // SingleWellPotential Class
171 // ========================================================================
176  public:
179 
181  double V(const dVec &r) {
182  double r2 = dot(r,r);
183  return ( 0.5*r2 + r2*r2 );
184  }
185 
187  dVec gradV(const dVec &r) {
188  double r2 = dot(r,r);
189  dVec tempr;
190  tempr = r;
191  return ((1.0 + 4.0*r2)*tempr);
192  }
193 };
194 
195 // ========================================================================
196 // HarmonicCylinderPotential Class
197 // ========================================================================
203  public:
204  HarmonicCylinderPotential (const double);
206 
208  double V(const dVec &r) {
209  double r2 = 0.0;
210  for (int i=0; i < NDIM-1; i++)
211  r2 += r[i]*r[i];
212  return ( 0.5 * c * constants()->m() * w * w * r2 );
213  }
214 
216  dVec gradV(const dVec &r) {
217  dVec tempr;
218  tempr = 0.0;
219  for (int i=0; i < NDIM-1; i++)
220  tempr[i] = r[i];
221  return ( c * constants()->m() * w * w * tempr );
222  }
223 
224  private:
225  double w; // The confining frequency
226  double c; // A dimension-full constant
227 };
228 
229 // ========================================================================
230 // DeltaPotential Class
231 // ========================================================================
240  public:
241  DeltaPotential (double,double);
242  ~DeltaPotential ();
243 
249  double V(const dVec &r) {
250  return (norm*exp(-dot(r,r)*inv2sigma2));
251  }
252 
258  dVec gradV(const dVec &r) {
259  return (-2.0*r*norm*inv2sigma2*exp(-dot(r,r)*inv2sigma2));
260  }
261 
262  private:
263  double norm; // A normalization constant for fixed strength
264  double inv2sigma2; // 1/(2\sigma^2) where \sigma^2 is the variance
265 };
266 
267 
268 // ========================================================================
269 // LorentzianPotential Class
270 // ========================================================================
276  public:
277  LorentzianPotential (double,double);
279 
285  double V(const dVec &r) {
286  return (norm / (a*a + dot(r,r)));
287  }
288 
294  dVec gradV(const dVec &r) {
295  double b = a*a + dot(r,r);
296  return ((-(2.0*norm*a)/(b*b))*r);
297  }
298 
299  private:
300  double c; // The strength of the delta function
301  double norm; // A normalization constant for fixed strength
302  double a; // The order of the limit
303 };
304 
305 // ========================================================================
306 // SutherlandPotential Class
307 // ========================================================================
314  public:
315  SutherlandPotential (double);
317 
321  double V(const dVec &r) {
322  double x = pioL*(sqrt(dot(r,r)) + EPS);
323  return g * pioL * pioL / (sin(x)*sin(x));
324  }
325 
329  dVec gradV(const dVec &r) {
330  double rnorm = sqrt(dot(r,r)) + EPS;
331  double x = pioL*rnorm;
332  double s = sin(x);
333  return (-2.0* g * pioL * pioL * pioL * cos(x) / (s*s*s*rnorm)) * r;
334  }
335 
339  double grad2V(const dVec &r) {
340  double x = pioL*(sqrt(dot(r,r))+EPS);
341  double s = sin(x);
342  return 2.0* g * pioL * pioL * pioL * pioL * (2.0+cos(2*x)) /
343  (s*s*s*s);
344  }
345 
346  private:
347  double g; // The interaction constant g
348  double pioL; // \pi/L
349 };
350 
351 // ========================================================================
352 // Dipolar Potential Class
353 // ========================================================================
361  public:
362  DipolePotential ();
363  ~DipolePotential ();
364 
368  double V(const dVec &r) {
369  double x = sqrt(dot(r,r));
370  if (x < EPS)
371  return LBIG;
372  return 1.0/(x*x*x);
373  }
374 
379  dVec gradV(const dVec &r) {
380  double x = sqrt(dot(r,r));
381  if (x < EPS)
382  return 0.0;
383  return (-3.0/(x*x*x*x*x)) * r;
384  }
385 
389  double grad2V(const dVec &r) {
390  double x = sqrt(dot(r,r));
391  if (x < EPS)
392  return 0.0;
393  return 6.0/(x*x*x*x*x);
394  }
395 };
396 
397 
398 // ========================================================================
399 // Hard Cylinder Potential Class
400 // ========================================================================
406  public:
407  HardCylinderPotential (const double);
409 
411  double V(const dVec &r) {
412  if (sqrt(r[0]*r[0]+r[1]*r[1]) >= R)
413  return LBIG;
414  else
415  return 0.0;
416  }
417 
419  dVec gradV(const dVec &r) {
420  dVec tempr;
421  tempr = r;
422  tempr[2] = 0.0;
423  if (abs((r[0]*r[0]+r[1]*r[1])-R*R)<1.0E-3)
424  return LBIG*tempr;
425  else
426  return 0.0*tempr;
427  }
428 
429  private:
430  double R; // Radius of the tube
431 };
432 
433 // ========================================================================
434 // Plated LJ Cylinder Potential Class
435 // ========================================================================
441  public:
442  PlatedLJCylinderPotential (const double, const double, const double, const double, const double);
444 
446  double V(const dVec &r) {
447  int k = static_cast<int>(sqrt(r[0]*r[0] + r[1]*r[1])/dR);
448  if (k >= tableLength)
449  return extV[1];
450  else
451  return lookupV(k);
452  }
453 
454  /* The gradient of the LJ Wall potential */
455  dVec gradV(const dVec &);
456 
457  /* Laplacian of the LJ Wall potential */
458  double grad2V(const dVec &);
459 
461  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
462 
463  private:
465  double V_ (const double, const double, const double, const double, const double);
466  double dVdr_ (const double, const double, const double, const double, const double);
467 
468  /* All the parameters needed for the LJ wall potential */
469  double densityPlated;
470  double sigmaPlated;
471  double epsilonPlated;
472  double density;
473  double sigma;
474  double epsilon;
475 
476  double Ri; // Inner radius of the tube
477  double Ro; // Outer radius of the tube
478  double dR; // Discretization for the lookup table
479 
480  double minV; // The minimum value of the potential
481 
482  /* Used to construct the lookup tables */
483  double valueV (const double);
484  double valuedVdr (const double);
485  double valued2Vdr2 (const double);
486 };
487 
488 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
489 // INLINE FUNCTION DEFINITIONS
490 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
491 
497  double rnorm = sqrt(r[0]*r[0] + r[1]*r[1]);
498  dVec tempr;
499  tempr = r;
500  tempr[2] = 0.0;
501  int k = static_cast<int>(rnorm/dR);
502  dVec gV;
503  if (k >= tableLength)
504  gV = (extdVdr[1]/rnorm)*tempr;
505  else
506  gV = (lookupdVdr(k)/rnorm)*tempr;
507  return gV;
508 }
509 
514 inline double PlatedLJCylinderPotential::grad2V(const dVec &r) {
515  double rnorm = sqrt(r[0]*r[0] + r[1]*r[1]);
516  dVec tempr;
517  tempr = r;
518  tempr[2] = 0.0; // PBC in z-direction
519  int k = static_cast<int>(rnorm/dR);
520  double g2V;
521  if (k >= tableLength)
522  g2V = extd2Vdr2[1];
523  else
524  g2V = lookupd2Vdr2(k);
525  return g2V;
526 }
527 
528 // ========================================================================
529 // LJ Cylinder Potential Class
530 // ========================================================================
536  public:
537  LJCylinderPotential (const double);
539 
541  double V(const dVec &r) {
542  int k = static_cast<int>(sqrt(r[0]*r[0] + r[1]*r[1])/dR);
543  if (k >= tableLength)
544  return extV[1];
545  else
546  return lookupV(k);
547  }
548 
549  /* The gradient of the LJ Wall potential */
550  dVec gradV(const dVec &);
551 
552  /* Laplacian of the LJ Wall potential */
553  double grad2V(const dVec &);
554 
556  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
557 
558  private:
559  /* All the parameters needed for the LJ wall potential */
560  double density;
561  double sigma;
562  double epsilon;
563 
564  double R; // Radius of the tube
565  double dR; // Discretization for the lookup table
566 
567  double minV; // The minimum value of the potential
568 
569  /* Used to construct the lookup tables */
570  double valueV (const double);
571  double valuedVdr (const double);
572  double valued2Vdr2 (const double);
573 };
574 
575 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
576 // INLINE FUNCTION DEFINITIONS
577 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
578 
584  double rnorm = sqrt(r[0]*r[0] + r[1]*r[1]);
585  dVec tempr;
586  tempr = r;
587  tempr[2] = 0.0;
588  int k = static_cast<int>(rnorm/dR);
589  dVec gV;
590  if (k >= tableLength)
591  gV = (extdVdr[1]/rnorm)*tempr;
592  else
593  gV = (lookupdVdr(k)/rnorm)*tempr;
594  return gV;
595 }
596 
601 inline double LJCylinderPotential::grad2V(const dVec &r) {
602  double rnorm = sqrt(r[0]*r[0] + r[1]*r[1]);
603  dVec tempr;
604  tempr = r;
605  tempr[2] = 0.0; // PBC in z-direction
606  int k = static_cast<int>(rnorm/dR);
607  double g2V;
608  if (k >= tableLength)
609  g2V = extd2Vdr2[1];
610  else
611  g2V = lookupd2Vdr2(k);
612  return g2V;
613 }
614 
615 // ========================================================================
616 // LJ Hour Glass Potential Class
617 // ========================================================================
623 
624  public:
625  LJHourGlassPotential (const double, const double, const double);
627 
629  double V(const dVec &);
630 
632  dVec gradV(const dVec &pos) {
633  return (0.0*pos);
634  }
635 
636  /* Laplacian of the LJ Wall potential. Use primitive approx. */
637  double grad2V(const dVec & pos) {
638  return 0.0;
639  }
640 
642  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
643  Array<dVec,1> initialConfig1(const Container*, MTRand &, const int);
644 
645  private:
646  /* All the parameters needed for the LJ wall potential */
647  double density;
648  double sigma;
649  double epsilon;
650 
651  double R; // Radius of the tube at +/- L/2
652  double dR; // variation of radius
653 
654  /* double minV; // The minimum value of the potential */
655 
656  double L; // The legnth of the pore
657  double invd; // The inverse of the variation length scale
658  double R0; // A constant used in the tanh radius function
659 
660  /* Different functional forms for the hourglass radius */
661  double Rlinear(double z) {
662  return (2.0*dR*abs(z)/L + R - dR);
663  }
664 
665  double Rtanh(double z) {
666  double t = R0*tanh(z*invd);
667  return (dR*t*t + R - dR);
668  }
669 };
670 
671 // ========================================================================
672 // Aziz Potential Class
673 // ========================================================================
679  public:
680  AzizPotential (const Container *);
681  ~AzizPotential ();
682 
683  /* The Aziz HFDHE2 Potential */
684  double V(const dVec &);
685 
686  /* The gradient of the Aziz potential */
687  dVec gradV(const dVec &);
688 
689  /* The Laplacian of the Aziz potential */
690  double grad2V(const dVec &);
691 
692  private:
693  /* All the parameters of the Aziz potential */
694  double rm, A, epsilon, alpha, D, C6, C8, C10;
695 
696  /* Used to construct the lookup tables */
697  double valueV (const double);
698  double valuedVdr (const double);
699  double valued2Vdr2 (const double);
700 
701  /* The F-function needed for the Aziz potential */
702  double F(const double x) {
703  return (x < D ? exp(-(D/x - 1.0)*(D/x - 1.0)) : 1.0 );
704  }
705 
706  /* The derivative of the F-function needed for the Aziz potential */
707  double dF(const double x) {
708  double ix = 1.0/x;
709  double r = 2.0*D*ix*ix*(D*ix-1.0)*exp(-(D*ix - 1.0)*(D*ix - 1.0));
710  return (x < D ? r : 0.0 );
711  }
712 
713  /* The 2nd derivative of the F-function needed for the Aziz potential
714  * Double checked with Mathematica --MTG */
715  double d2F(const double x) {
716  double ix = 1.0/x;
717  double r = 2.0*D*ix*ix*ix*( 2.0*D*D*D*ix*ix*ix - 4.0*D*D*ix*ix
718  - D*ix + 2.0) * exp(-(D*ix - 1.0)*(D*ix - 1.0));
719  return (x < D ? r : 0.0 );
720  }
721 
722 };
723 
724 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
725 // INLINE FUNCTION DEFINITIONS
726 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
727 
731 inline double AzizPotential::V(const dVec &r) {
732  //double rnorm = sqrt(dot(r,r));
733  //return newtonGregory(lookupV,extV,rnorm);
734  return direct(lookupV,extV,sqrt(dot(r,r)));
735 }
736 
737 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
738 
743 inline dVec AzizPotential::gradV(const dVec &r) {
744  double rnorm = sqrt(dot(r,r));
745  dVec gV;
746  //gV = (newtonGregory(lookupdVdr,extdVdr,rnorm)/rnorm)*r;
747  gV = (direct(lookupdVdr,extdVdr,rnorm)/rnorm)*r;
748  return gV;
749 }
750 
751 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
752 
758 inline double AzizPotential::grad2V(const dVec &r) {
759  double rnorm = sqrt(dot(r,r));
760  double g2V;
761  //g2V = (newtonGregory(lookupd2Vdr2,extd2Vdr2,rnorm)/rnorm)*r;
762  g2V = direct(lookupd2Vdr2,extd2Vdr2,rnorm);
763  return g2V;
764 }
765 
766 
767 // ========================================================================
768 // Szalewicz Potential Class
769 // ========================================================================
775  public:
776  SzalewiczPotential (const Container *);
778 
779  /* The Szalewicz HFDHE2 Potential */
780  double V(const dVec &);
781 
782  /* The gradient of the Szalewicz potential */
783  dVec gradV(const dVec &);
784 
785  /* The Laplacian of the Szalewicz potential */
786  double grad2V(const dVec &);
787 
788  private:
789  /* All the parameters of the Szalewicz potential */
790  double rm = 2.9262186279335958;
791  double Cn[17] = { 0.0,
792  0.0,
793  0.0,
794  0.000000577235,
795  -0.000035322,
796  0.000001377841,
797  1.461830,
798  0.0,
799  14.12350,
800  0.0,
801  183.7497,
802  -0.7674e2,
803  0.3372e4,
804  -0.3806e4,
805  0.8534e5,
806  -0.1707e6,
807  0.286e7
808  };
809  double a = 3.64890303652830;
810  double b = 2.36824871743591;
811  double eta = 4.09423805117871;
812  double Pn[3] = {-25.4701669416621, 269.244425630616, -56.3879970402079};
813  double Qn[2] = {38.7957487310071, -2.76577136772754};
814  long int factorials[17] = { 1,
815  1,
816  2,
817  6,
818  24,
819  120,
820  720,
821  5040,
822  40320,
823  362880,
824  3628800,
825  39916800,
826  479001600,
827  6227020800,
828  87178291200,
829  1307674368000,
830  20922789888000};
831  /* Used to construct the lookup tables */
832  double valueV (const double);
833  double valuedVdr (const double);
834  double valued2Vdr2 (const double);
835 
836  /* The Tang-Toennies damping function needed for the Szalewicz potential */
837  /* Can be described as upper incomplete gamma function.*/
838  double fn(const double x, const int n) {
839  double s1 = 0.0;
840  for (int i = 0; i < n + 1; i++) {
841  s1 += pow(x,i)/factorials[i];
842  }
843  return 1.0 - (exp(-x)*s1);
844  }
845 
846  /* The derivative of the Tang-Toennies damping function needed for the Szalewicz potential */
847  double dfn(const double x, const int n) {
848  return (exp(-x)*pow(x,n)/factorials[n]);
849  }
850 
851  /* The 2nd derivative of the Tang-Toennies needed for the Szalewicz potential*/
852  double d2fn(const double x, const int n) {
853  return (exp(-x)*(n-x)*pow(x,(n-1))/factorials[n]);
854  }
855 
856  /* The Tang-Toennies damping function expanded for small r */
857  /* needed for the Szalewicz potential */
858  /* Can be described as upper incomplete gamma function. */
859  double fn2(const double x, const int n) {
860 
861  double s1 = 0.0;
862  for (int i = 0; i < 17; i++) {
863  s1 += (pow(-1,i)*pow(x,(i+1)))/(factorials[i]*(n+i+1));
864  }
865  s1 *= pow(x,n)/factorials[n];
866  return s1;
867  }
868 
869 };
870 
871 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
872 // INLINE FUNCTION DEFINITIONS
873 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
874 
878 inline double SzalewiczPotential::V(const dVec &r) {
879  //double rnorm = sqrt(dot(r,r));
880  //return newtonGregory(lookupV,extV,rnorm);
881  return direct(lookupV,extV,sqrt(dot(r,r)));
882 }
883 
884 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
885 
891  double rnorm = sqrt(dot(r,r));
892  dVec gV;
893  //gV = (newtonGregory(lookupdVdr,extdVdr,rnorm)/rnorm)*r;
894  gV = (direct(lookupdVdr,extdVdr,rnorm)/rnorm)*r;
895  return gV;
896 }
897 
898 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
899 
905 inline double SzalewiczPotential::grad2V(const dVec &r) {
906  double rnorm = sqrt(dot(r,r));
907  double g2V;
908  //g2V = (newtonGregory(lookupd2Vdr2,extd2Vdr2,rnorm)/rnorm)*r;
909  //g2V = (direct(lookupd2Vdr2,extd2Vdr2,rnorm)/rnorm)*r;
910  g2V = direct(lookupd2Vdr2,extd2Vdr2,rnorm);
911  return g2V;
912 }
913 
914 // ========================================================================
915 // FixedAzizPotential Class
916 // ========================================================================
925 
926  public:
927  FixedAzizPotential(const Container *);
929 
930  /* Return the sum of the Aziz 'interaction energy' between the supplied
931  * particle and all fixed particles. */
932  double V(const dVec &r);
933 
934  /* Return the gradient of the sum of the Aziz 'interaction energy' */
935  dVec gradV(const dVec &r);
936 
938  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
939 
940  private:
941  AzizPotential aziz; // A copy of the aziz potential
942  Array <dVec,1> fixedParticles; // The location of the fixed particles
943  Array <int,2> fixedBeadsInGrid; // The local grid hash table
944  Array <int,1> numFixedBeadsInGrid; // The number of fixed particles in each grid box
945  int numFixedParticles; // The total number of fixed particles
946  LookupTable *lookupPtr; // A lookup table pointer
947  double rc2; // A local copy of the potential cutoff squared
948 
949 };
950 
951 // ========================================================================
952 // FixedPositionLJPotential Class
953 // ========================================================================
962 
963  public:
964  FixedPositionLJPotential(const double, const double, const Container*);
966 
967  /* Return the sum of the Lennard-Jones potential between the supplied
968  * particle and the fixed positions found in FILENAME. */
969  double V(const dVec &r);
970 
971  private:
972  const Container *boxPtr;
973  double sigma;
974  double epsilon;
975  double Lz;
976 
977  Array <dVec,1> fixedParticles; // The location of the fixed particles
978  int numFixedParticles; // The total number of fixed particles
979 };
980 
981 
982 
983 // ========================================================================
984 // Excluded Volume Class (volume excluded w/ large potential)
985 // ========================================================================
991  public:
992  Gasparini_1_Potential (double, double, const Container*);
994 
996  double V(const dVec &r){
997  double r2 = 0.0;
998  if ((r[2] >= -excZ) && (r[2] <= excZ) && (r[1] >= -excY) && (r[1] <= excY))
999  r2 = 1.0*V0;
1000  return r2;
1001  }
1002 
1004  dVec gradV(const dVec &) { return 0.0; }
1005 
1007  double grad2V(const dVec &r) { return 0.0; }
1008 
1009 
1011  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
1012 
1014  Array<double,1> getExcLen();
1015 
1016  /* parameters needed for Gasp Potential_1 */
1017  const double excZ; //half amt. of exclusion (z)
1018  const double excY; //half amt. of exclusion (y)
1019  const double V0; //scales the potential step
1020 };
1021 
1022 // ========================================================================
1023 // Hard Sphere Potential Class
1024 // ========================================================================
1033  public:
1034  HardSpherePotential (double);
1036 
1038  virtual double V(const dVec &r) {
1039  return ((sqrt(dot(r,r)) <= a) ? LBIG : 0.0);
1040  }
1041 
1043  double V(const dVec &, const dVec &);
1044  double dVdlambda(const dVec &, const dVec &);
1045  double dVdtau(const dVec &, const dVec &);
1046 
1047  private:
1048  double a; // The strength of the delta function
1049 };
1050 
1051 
1052 // ========================================================================
1053 // 1D Delta Potential Class
1054 // ========================================================================
1061 public:
1062  Delta1DPotential (double);
1063  ~Delta1DPotential ();
1064 
1066  virtual double V(const dVec &r) {
1067  return (0.0);
1068  }
1069 
1071  double V(const dVec &, const dVec &);
1072  double dVdlambda(const dVec &, const dVec &);
1073  double dVdtau(const dVec &, const dVec &);
1074 
1075 private:
1076 
1077  double erfCO; //cutoff of erfc for asymptotic form
1078  double g; // The strength of the delta function
1079  double l0; // The COM kinetic length scale: 2\sqrt{\lambda\tau}
1080  double xi; // The ratio l0/li
1081  double li; // The COM interaction length scale: 2\lambda/g
1082 
1083  double xiSqOver2; // (xi^2)/2.0
1084  double xiSqrtPIOver2; // xi*\sqrt{\pi/2.0}
1085 
1087  double Wint(double yt, double dxt);
1088  double dWdyt(double yt, double dxt);
1089  double dWdxi(double yt, double dxt);
1090  double dWddxt(double yt, double dxt);
1091 };
1092 
1093 
1094 // ========================================================================
1095 // Hard Rod Potential Class
1096 // ========================================================================
1103  public:
1104  HardRodPotential (double);
1105  ~HardRodPotential ();
1106 
1108  virtual double V(const dVec &r) {
1109  return ((sqrt(dot(r,r)) <= a) ? LBIG : 0.0);
1110  }
1111 
1113  double V(const dVec &, const dVec &);
1114  double dVdlambda(const dVec &, const dVec &);
1115  double dVdtau(const dVec &, const dVec &);
1116 
1117  private:
1118  double a; // The strength of the delta function
1119 };
1120 
1121 // ========================================================================
1122 // Carbon Nanotube Potential Class
1123 // ========================================================================
1128 //class CarbonNanotubePotential : public PotentialBase, public TabulatedPotential {
1129 // public:
1130 // CarbonNanotubePotential(const double);
1131 // ~CarbonNanotubePotential();
1132 //
1133 // /** The cylindrically symmetric potential. */
1134 // double V(const dVec &r) {
1135 // int k = int(sqrt(r[0]*r[0] + r[1]*r[1])/dR);
1136 // if (k >= tableLength)
1137 // return extV[1];
1138 // else
1139 // return lookupV(k);
1140 // }
1141 //
1142 // /* The gradient of the CNT potential */
1143 // dVec gradV(const dVec &);
1144 //
1145 // /** Initial configuration corresponding to the CNT potential */
1146 // Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
1147 //
1148 // private:
1149 // /* All the parameters needed for the LJ wall potential */
1150 // double density;
1151 // double sigmaHe,sigmaC;
1152 // double epsilonHe,epsilonC;
1153 //
1154 // double R; // Radius of the tube
1155 // double dR; // Discretization for the lookup table
1156 //
1157 // double minV; // The minimum value of the potential
1158 //
1159 // /* Used to construct the lookup tables */
1160 // double valueV (const double);
1161 // double valuedVdr (const double);
1162 //};
1163 
1164 // ========================================================================
1165 // GraphenePotential Class
1166 // ========================================================================
1175 
1176  public:
1177  GraphenePotential(const double, const double, const double, const double, const double);
1179 
1180  /* Return the sum of the van der Waals' interaction energy between the supplied
1181  * particle and the fixed graphene lattice. */
1182  double V(const dVec &r);
1183 
1185  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
1186 
1187  private:
1188  double sigma;
1189  double epsilon;
1190  double Lz;
1191  double Lzo2;
1192 
1193  double a1x;
1194  double a1y;
1195  double a2x;
1196  double a2y;
1197 
1198  double g1x;
1199  double g1y;
1200  double g2x;
1201  double g2y;
1202 
1203  double b1x;
1204  double b1y;
1205  double b2x;
1206  double b2y;
1207 
1208  double A;
1209 
1210 };
1211 
1212 // ========================================================================
1213 // GrapheneLUTPotential Class
1214 // ========================================================================
1223 
1224  public:
1225  GrapheneLUTPotential(const double, const double, const double, const double, const double, const Container*);
1227 
1228  /* Return the sum of the van der Waals' interaction energy between the supplied
1229  * particle and the fixed graphene lattice. */
1230  double V(const dVec &r);
1231 
1232  /* Return the gradient of the sum of the van der Waals' interaction energy between the supplied
1233  * particle and the fixed graphene lattice. */
1234  dVec gradV(const dVec &r);
1235 
1237  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
1238 
1239  private:
1240  double sigma;
1241  double epsilon;
1242 
1243  double a1x;
1244  double a1y;
1245  double a2x;
1246  double a2y;
1247 
1248  double g1x;
1249  double g1y;
1250  double g2x;
1251  double g2y;
1252 
1253  double b1x;
1254  double b1y;
1255  double b2x;
1256  double b2y;
1257 
1258  double A;
1259 
1260  double Lzo2;
1261  double Lz;
1262  double zWall;
1263  double invWallWidth;
1264  double V_zmin;
1265 
1266  double q = 2.0; // number of basis vectors
1267 
1268  static const int gnum = 3;
1269  static const int gtot = 16; //pow(gnum + 1,2);
1270 
1271  double dr = 1.0E-5;
1272  double zmin = 1.5;
1273  double zmax = 10.0;
1274  int tableLength;
1275 
1276  /* Array<int,2> karr; */
1277  /* double garr [gtot]; */
1278 
1279  Array<int,1> gMagID; // g-magnitude lookup index
1280 
1281  /* The lookup tables */
1282  Array<double,2> vg;
1283  Array<double,2> gradvg;
1284 };
1285 
1286 // ========================================================================
1287 // GrapheneLUT3DPotential Class
1288 // ========================================================================
1297 
1298  public:
1299  GrapheneLUT3DPotential(const string, const Container*);
1301 
1302  /* Return the sum of the van der Waals' interaction energy between the supplied
1303  * particle and the fixed graphene lattice. */
1304  double V(const dVec &);
1305 
1306  /* Return the gradient of the sum of the van der Waals' interaction energy between the supplied
1307  * particle and the fixed graphene lattice. */
1308  dVec gradV(const dVec &);
1309  double grad2V(const dVec &);
1310 
1312  Array<dVec,1> initialConfig(const Container*, MTRand &, const int);
1313  Array<dVec,1> initialConfig1(const Container*, MTRand &, const int);
1314 
1315  void put_in_uc( dVec &, double, double);
1316  void cartesian_to_uc( dVec &, double, double, double, double);
1317  double trilinear_interpolation(Array<double,3>,dVec,double,double,double);
1318  double direct_lookup(Array<double,3>,dVec,double,double,double);
1319 
1320  private:
1321  double Lzo2;
1322  double zWall;
1323  double invWallWidth;
1324 
1325  /* spacing of the lookup tables */
1326  double dx;
1327  double dy;
1328  double dz;
1329 
1330  /* dimensions of the lookup tables */
1331  double cell_length_a;
1332  double cell_length_b;
1333  double zmin;
1334  double zmax;
1335  double V_zmin;
1336 
1337  /* transfer matrix */
1338  double A11;
1339  double A12;
1340  double A21;
1341  double A22;
1342 
1343  Array<double,3> V3d; // Potential lookup table
1344  Array<double,3> gradV3d_x; // gradient of potential x direction lookup table
1345  Array<double,3> gradV3d_y; // gradient of potential y direction lookup table
1346  Array<double,3> gradV3d_z; // gradient of potential z direction lookup table
1347  Array<double,3> grad2V3d; // Laplacian of potential
1348  Array<double,1> LUTinfo;
1349 
1350 };
1351 
1352 /****
1353  * Put inside unit cell
1354  ***/
1355 inline void GrapheneLUT3DPotential::put_in_uc(dVec &r, double cell_length_a, double cell_length_b) {
1356  r[0] -= cell_length_a * floor(r[0]/cell_length_a);
1357  r[1] -= cell_length_b * floor(r[1]/cell_length_b);
1358 }
1359 
1360 /****
1361  * transfer from cartesian to unit cell coordinates
1362  ***/
1363 
1364 inline void GrapheneLUT3DPotential::cartesian_to_uc( dVec &r, double A11, double A12, double A21, double A22) {
1365  double _x = A11 * r[0] + A12*r[1];
1366  double _y = A21 * r[0] + A22*r[1];
1367  r[0] = _x;
1368  r[1] = _y;
1369 }
1370 
1371 inline double GrapheneLUT3DPotential::trilinear_interpolation(Array<double,3> P,dVec r,double dx,double dy,double dz) {
1372  double x = r[0];
1373  double y = r[1];
1374  double z = r[2];
1375 
1376  double _xidx = floor(x/dx);
1377  double _yidx = floor(y/dy);
1378  double _zidx = floor(z/dz);
1379  int xidx = static_cast<int>(_xidx);
1380  int yidx = static_cast<int>(_yidx);
1381  int zidx = static_cast<int>(_zidx);
1382 
1383  double Delta_x = x/dx - _xidx;
1384  double Delta_y = y/dy - _yidx;
1385  double Delta_z = z/dz - _zidx;
1386 
1387  double c00 = P(xidx,yidx,zidx)*(1 - Delta_x) + P(xidx + 1,yidx,zidx)*Delta_x;
1388  double c01 = P(xidx,yidx,zidx + 1)*(1 - Delta_x) + P(xidx + 1,yidx,zidx + 1)*Delta_x;
1389  double c10 = P(xidx,yidx + 1,zidx)*(1 - Delta_x) + P(xidx + 1,yidx + 1,zidx)*Delta_x;
1390  double c11 = P(xidx,yidx + 1,zidx + 1)*(1 - Delta_x) + P(xidx + 1,yidx + 1,zidx + 1)*Delta_x;
1391 
1392  double c0 = c00*(1 - Delta_y) + c10*Delta_y;
1393  double c1 = c01*(1 - Delta_y) + c11*Delta_y;
1394 
1395  double c = c0*(1 - Delta_z) + c1*Delta_z;
1396  return c;
1397 }
1398 
1399 inline double GrapheneLUT3DPotential::direct_lookup(Array<double,3> P,dVec r,double dx,double dy,double dz) {
1400  double x = r[0];
1401  double y = r[1];
1402  double z = r[2];
1403 
1404  int xidx = static_cast<int>(x/dx);
1405  int yidx = static_cast<int>(y/dy);
1406  int zidx = static_cast<int>(z/dz);
1407 
1408  double c0 = P(xidx,yidx,zidx);
1409  return c0;
1410 }
1411 
1412 // ========================================================================
1413 // GrapheneLUT3DPotentialGenerate Class
1414 // ========================================================================
1423 
1424  public:
1426  const double, const double, const double, const double,
1427  const double, const Container*);
1429 
1430  private:
1431 
1432  double Lzo2; // half the system size in the z-direction
1433 
1434  /* resolution of the lookup tables */
1435  int xres;
1436  int yres;
1437  int zres;
1438 
1439  /* dimensions of the lookup tables */
1440  /* double zmin; */
1441  double zmax;
1442  /* double V_zmin; */
1443 
1444  double Vz_64( double, double, double, int );
1445  double Vz_64( double, double, double );
1446  double Vz_64( double, double );
1447 
1448  double gradVz_x_64( double, double, double, int );
1449  double gradVz_x_64( double, double, double );
1450  double gradVz_x_64( double, double );
1451 
1452  double gradVz_y_64( double, double, double, int );
1453  double gradVz_y_64( double, double, double );
1454  double gradVz_y_64( double, double );
1455 
1456 
1457  double gradVz_z_64( double, double, double, int );
1458  double gradVz_z_64( double, double, double );
1459  double gradVz_z_64( double, double );
1460 
1461  double grad2Vz_64( double, double, double, int );
1462  double grad2Vz_64( double, double, double );
1463  double grad2Vz_64( double, double );
1464 
1465  double Vg_64( double, double, double, double, double, double, double,
1466  double, double, double );
1467  double Vg_64( double, double, double, double, double, double, double,
1468  double, double );
1469 
1470  double gradVg_x_64( double, double, double, double, double, double, double,
1471  double, double, double );
1472  double gradVg_x_64( double, double, double, double, double, double, double,
1473  double, double );
1474 
1475  double gradVg_y_64( double, double, double, double, double, double, double,
1476  double, double, double );
1477  double gradVg_y_64( double, double, double, double, double, double, double,
1478  double, double );
1479 
1480  double gradVg_z_64( double, double, double, double, double, double, double,
1481  double, double, double );
1482  double gradVg_z_64( double, double, double, double, double, double, double,
1483  double, double );
1484 
1485  double grad2Vg_64( double, double, double, double, double, double, double,
1486  double, double, double );
1487  double grad2Vg_64( double, double, double, double, double, double, double,
1488  double, double );
1489 
1490  double V_64( double, double, double, double, double, double,
1491  TinyVector<double,2>, TinyVector<double,2>,
1492  TinyVector<double,2>, TinyVector<double,2>, Array<int,1>,
1493  Array<int,1>, Array<double,1> );
1494 
1495  double gradV_x_64( double, double, double, double, double, double,
1496  TinyVector<double,2>, TinyVector<double,2>,
1497  TinyVector<double,2>, TinyVector<double,2>, Array<int,1>,
1498  Array<int,1>, Array<double,1> );
1499 
1500  double gradV_y_64( double, double, double, double, double, double,
1501  TinyVector<double,2>, TinyVector<double,2>,
1502  TinyVector<double,2>, TinyVector<double,2>, Array<int,1>,
1503  Array<int,1>, Array<double,1> );
1504 
1505  double gradV_z_64( double, double, double, double, double, double,
1506  TinyVector<double,2>, TinyVector<double,2>,
1507  TinyVector<double,2>, TinyVector<double,2>, Array<int,1>,
1508  Array<int,1>, Array<double,1> );
1509 
1510  double grad2V_64( double, double, double, double, double, double,
1511  TinyVector<double,2>, TinyVector<double,2>,
1512  TinyVector<double,2>, TinyVector<double,2>, Array<int,1>,
1513  Array<int,1>, Array<double,1> );
1514 
1515  std::tuple<
1516  TinyVector<double,2>, TinyVector<double,2>,
1517  TinyVector<double,2>, TinyVector<double,2>,
1518  TinyVector<double,2>, TinyVector<double,2>
1519  > get_graphene_vectors();
1520  std::tuple<
1521  TinyVector<double,2>, TinyVector<double,2>,
1522  TinyVector<double,2>, TinyVector<double,2>,
1523  TinyVector<double,2>, TinyVector<double,2>
1524  > get_graphene_vectors( double );
1525  std::tuple<
1526  TinyVector<double,2>, TinyVector<double,2>,
1527  TinyVector<double,2>, TinyVector<double,2>,
1528  TinyVector<double,2>, TinyVector<double,2>
1529  > get_graphene_vectors( double, double, double );
1530  std::tuple<
1531  TinyVector<double,2>, TinyVector<double,2>,
1532  TinyVector<double,2>, TinyVector<double,2>,
1533  TinyVector<double,2>, TinyVector<double,2>
1534  > get_graphene_vectors_old( double, double, double );
1535  std::tuple< Array<int,1>, Array<int,1>, Array<double,1>
1536  > get_g_magnitudes( TinyVector<double,2>, TinyVector<double,2> );
1537 
1538  template <class T> double calculate_magnitude( T vec ) {
1539  return sqrt(dot(vec,vec));
1540  }
1541 
1542  template <class T1, class T2> double calculate_angle(
1543  T1 x, T2 y, double magnitude_x, double magnitude_y ) {
1544  return acos(dot(x,y)/magnitude_x/magnitude_y);
1545  }
1546 
1547  template <class T1, class T2> double calculate_angle( T1 x, T2 y ) {
1548  return calculate_angle(x,y,calculate_magnitude(x),calculate_magnitude(y));
1549  }
1550 
1551  void calculate_V3D_64(
1552  Array<double,3>, Array<double,2>, Array<double,2>,
1553  Array<double,1>, double, double,
1554  double, TinyVector<double,2>, TinyVector<double,2>,
1555  TinyVector<double,2>, TinyVector<double,2>,
1556  Array<int,1>, Array<int,1>,
1557  Array<double,1> );
1558 
1559  void calculate_gradV3D_x_64(
1560  Array<double,3>, Array<double,2>, Array<double,2>,
1561  Array<double,1>, double, double,
1562  double, TinyVector<double,2>, TinyVector<double,2>,
1563  TinyVector<double,2>, TinyVector<double,2>,
1564  Array<int,1>, Array<int,1>,
1565  Array<double,1> );
1566 
1567  void calculate_gradV3D_y_64(
1568  Array<double,3>, Array<double,2>, Array<double,2>,
1569  Array<double,1>, double, double,
1570  double, TinyVector<double,2>, TinyVector<double,2>,
1571  TinyVector<double,2>, TinyVector<double,2>,
1572  Array<int,1>, Array<int,1>,
1573  Array<double,1> );
1574 
1575  void calculate_gradV3D_z_64(
1576  Array<double,3>, Array<double,2>, Array<double,2>,
1577  Array<double,1>, double, double,
1578  double, TinyVector<double,2>, TinyVector<double,2>,
1579  TinyVector<double,2>, TinyVector<double,2>,
1580  Array<int,1>, Array<int,1>,
1581  Array<double,1> );
1582 
1583  void calculate_grad2V3D_64(
1584  Array<double,3>, Array<double,2>, Array<double,2>,
1585  Array<double,1>, double, double,
1586  double, TinyVector<double,2>, TinyVector<double,2>,
1587  TinyVector<double,2>, TinyVector<double,2>,
1588  Array<int,1>, Array<int,1>,
1589  Array<double,1> );
1590 
1591  std::pair<double, double> get_z_min_V_min(
1592  double, double, double, double, double,
1593  TinyVector<double,2>, TinyVector<double,2>,
1594  TinyVector<double,2>, TinyVector<double,2>,
1595  Array<int,1>, Array<int,1>, Array<double,1> );
1596 
1597  std::pair<double, double> get_z_V_to_find(
1598  double, double, double,
1599  TinyVector<double,2>, TinyVector<double,2>,
1600  TinyVector<double,2>, TinyVector<double,2>,
1601  Array<int,1>, Array<int,1>, Array<double,1> );
1602 
1603  Array<double,3> get_V3D(
1604  double, double, double, int, int, int, double, double );
1605  std::pair<Array<double,3> , Array<double,1>> get_V3D(
1606  double, double, double, int, int, int, double );
1607  std::tuple<
1608  Array<double,3>, Array<double,3>, Array<double,3>,
1609  Array<double,3>, Array<double,3>, Array<double,2>,
1610  Array<double,2>, Array<double,1>
1611  > get_V3D_all( double, double, double, int, int, int, double );
1612 };
1613 
1614 // ========================================================================
1615 // GrapheneLUT3DPotentialToBinary Class
1616 // ========================================================================
1625 
1626  public:
1627  GrapheneLUT3DPotentialToBinary(const string, const Container*);
1629 
1630  private:
1631  Array<double,3> V3d; // Potential lookup table
1632  Array<double,3> gradV3d_x; // gradient of potential x direction lookup table
1633  Array<double,3> gradV3d_y; // gradient of potential y direction lookup table
1634  Array<double,3> gradV3d_z; // gradient of potential z direction lookup table
1635  Array<double,3> grad2V3d; // Laplacian of potential
1636  Array<double,1> LUTinfo;
1637 
1638 };
1639 
1640 // ========================================================================
1641 // GrapheneLUT3DPotentialToText Class
1642 // ========================================================================
1651 
1652  public:
1653  GrapheneLUT3DPotentialToText(const string, const Container*);
1655 
1656  private:
1657  Array<double,3> V3d; // Potential lookup table
1658  Array<double,3> gradV3d_x; // gradient of potential x direction lookup table
1659  Array<double,3> gradV3d_y; // gradient of potential y direction lookup table
1660  Array<double,3> gradV3d_z; // gradient of potential z direction lookup table
1661  Array<double,3> grad2V3d; // Laplacian of potential
1662  Array<double,1> LUTinfo;
1663 
1664 };
1665 
1666 
1667 #endif
Computes the value of the semi-empircal Aziz potential that is known to be accurate for He-4.
Definition: potential.h:678
~AzizPotential()
Destructor.
Definition: potential.cpp:1515
dVec gradV(const dVec &)
Return the gradient of aziz potential for separation r using a lookup table.
Definition: potential.h:743
double grad2V(const dVec &)
Return the Laplacian of aziz potential for separation r using a lookup table.
Definition: potential.h:758
AzizPotential(const Container *)
Constructor.
Definition: potential.cpp:1475
double V(const dVec &)
Return the aziz potential for separation r using a lookup table.
Definition: potential.h:731
The base class which holds details on the generalized box that our system will be simulated inside of...
Definition: container.h:24
Computes the effective potential from the exact two-body density matrix for delta interactions in 1D.
Definition: potential.h:1060
~Delta1DPotential()
Destructor.
Definition: potential.cpp:2187
double dVdlambda(const dVec &, const dVec &)
The derivative of the effective potential with respect to lambda.
Definition: potential.cpp:2319
double dVdtau(const dVec &, const dVec &)
The derivative of the effective potential with respect to tau.
Definition: potential.cpp:2344
virtual double V(const dVec &r)
The classical potential.
Definition: potential.h:1066
Delta1DPotential(double)
Constructor.
Definition: potential.cpp:2170
Computes the potential energy for delta function interaction potential, approximated here as the limi...
Definition: potential.h:239
dVec gradV(const dVec &r)
Return the gradient of the delta function potential with strength g approximated as the limit of a Ga...
Definition: potential.h:258
DeltaPotential(double, double)
Constructor.
Definition: potential.cpp:387
double V(const dVec &r)
Return the delta function potential with strength g approximated as the limit of a Gaussian distribut...
Definition: potential.h:249
~DeltaPotential()
Destructor.
Definition: potential.cpp:397
Computes the potential energy for polarized electrical dipoles with strength D in reduced units where...
Definition: potential.h:360
double grad2V(const dVec &r)
Return the Laplacian of the dipolar potential.
Definition: potential.h:389
double V(const dVec &r)
Return the dipole potential 1/r^3.
Definition: potential.h:368
dVec gradV(const dVec &r)
Return the gradient of the dipole potential.
Definition: potential.h:379
DipolePotential()
Constructor.
Definition: potential.cpp:462
~DipolePotential()
Destructor.
Definition: potential.cpp:473
Computes the potential energy resulting from a series of fixed helium atoms that are not updated and ...
Definition: potential.h:924
dVec gradV(const dVec &r)
The gradient of the total potential coming from the interaction of a particle with all fixed particle...
Definition: potential.cpp:592
double V(const dVec &r)
The total potential coming from the interaction of a particle with all fixed particles.
Definition: potential.cpp:568
~FixedAzizPotential()
Destructor.
Definition: potential.cpp:557
FixedAzizPotential(const Container *)
Constructor.
Definition: potential.cpp:490
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to FixedAziz potential.
Definition: potential.cpp:620
Returns Lennard-Jones potential between adatoms and fixed postions in FILENAME.
Definition: potential.h:961
FixedPositionLJPotential(const double, const double, const Container *)
Constructor.
Definition: potential.cpp:676
~FixedPositionLJPotential()
Destructor.
Definition: potential.cpp:731
double V(const dVec &r)
Return the value of the van der Waals' interaction between a graphene sheet and a helium adatom at a ...
Definition: potential.cpp:742
Free potential.
Definition: potential.h:123
dVec gradV(const dVec &pos)
The gradient of the potential.
Definition: potential.h:132
FreePotential()
Constructor.
Definition: potential.cpp:277
~FreePotential()
Destructor.
Definition: potential.cpp:283
double V(const dVec &sep)
The potential.
Definition: potential.h:129
Computes potential energy for Gasparini potential.
Definition: potential.h:990
Array< double, 1 > getExcLen()
get the exclusion lengths ay and az
Definition: potential.cpp:2033
Gasparini_1_Potential(double, double, const Container *)
Constructor.
Definition: potential.cpp:1853
double V(const dVec &r)
The potential.
Definition: potential.h:996
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to FixedAziz potential.
Definition: potential.cpp:1874
dVec gradV(const dVec &)
The gradient of the potential.
Definition: potential.h:1004
~Gasparini_1_Potential()
Destructor.
Definition: potential.cpp:1865
double grad2V(const dVec &r)
Laplacian of the potential.
Definition: potential.h:1007
FIXME Returns van der Waals' potential between a helium adatom and a graphene sheet using summation i...
Definition: potential.h:1422
~GrapheneLUT3DPotentialGenerate()
Destructor.
Definition: potential.cpp:4380
GrapheneLUT3DPotentialGenerate(const double, const double, const double, const double, const double, const Container *)
Constructor.
Definition: potential.cpp:3302
FIXME Returns van der Waals' potential between a helium adatom and a graphene sheet using summation i...
Definition: potential.h:1624
~GrapheneLUT3DPotentialToBinary()
Destructor.
Definition: potential.cpp:4475
GrapheneLUT3DPotentialToBinary(const string, const Container *)
Constructor.
Definition: potential.cpp:4392
FIXME Returns van der Waals' potential between a helium adatom and a graphene sheet using summation i...
Definition: potential.h:1650
GrapheneLUT3DPotentialToText(const string, const Container *)
Constructor.
Definition: potential.cpp:4493
~GrapheneLUT3DPotentialToText()
Destructor.
Definition: potential.cpp:4575
Returns van der Waals' potential between a helium adatom and a graphene sheet using summation in reci...
Definition: potential.h:1296
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to graphene-helium vdW potential.
Definition: potential.cpp:3222
dVec gradV(const dVec &)
Return the gradient of the van der Waals' interaction between a graphene sheet and a helium adatom at...
Definition: potential.cpp:3091
double V(const dVec &)
Return the value of the van der Waals' interaction between a graphene sheet and a helium adatom at a ...
Definition: potential.cpp:3062
double grad2V(const dVec &)
Return the gradient of the van der Waals' interaction between a graphene sheet and a helium adatom at...
Definition: potential.cpp:3120
~GrapheneLUT3DPotential()
Destructor.
Definition: potential.cpp:3046
GrapheneLUT3DPotential(const string, const Container *)
Constructor.
Definition: potential.cpp:3006
Array< dVec, 1 > initialConfig1(const Container *, MTRand &, const int)
Return an initial particle configuration.
Definition: potential.cpp:3140
Returns van der Waals' potential between a helium adatom and a graphene sheet using summation in reci...
Definition: potential.h:1222
dVec gradV(const dVec &r)
Return the gradient of the van der Waals' interaction between a graphene sheet and a helium adatom at...
Definition: potential.cpp:2902
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to graphene-helium vdW potential.
Definition: potential.cpp:2948
GrapheneLUTPotential(const double, const double, const double, const double, const double, const Container *)
Constructor.
Definition: potential.cpp:2658
double V(const dVec &r)
Return the value of the van der Waals' interaction between a graphene sheet and a helium adatom at a ...
Definition: potential.cpp:2853
~GrapheneLUTPotential()
Destructor.
Definition: potential.cpp:2840
The smooth non-corregated version of the helium-carbon nanotube potential.
Definition: potential.h:1174
GraphenePotential(const double, const double, const double, const double, const double)
Constructor.
Definition: potential.cpp:2475
double V(const dVec &r)
Return the value of the van der Waals' interaction between a graphene sheet and a helium adatom at a ...
Definition: potential.cpp:2526
~GraphenePotential()
Destructor.
Definition: potential.cpp:2515
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to graphene-helium vdW potential.
Definition: potential.cpp:2571
Computes the value of the external wall potential for a hard-walled cylindrical cavity.
Definition: potential.h:405
~HardCylinderPotential()
Destructor.
Definition: potential.cpp:789
HardCylinderPotential(const double)
Constructor.
Definition: potential.cpp:781
dVec gradV(const dVec &r)
A delta function at rho=R.
Definition: potential.h:419
double V(const dVec &r)
A step function at rho=R.
Definition: potential.h:411
Computes the effective potential from the exact two-body density matrix for hard rods in 1D.
Definition: potential.h:1102
HardRodPotential(double)
Constructor.
Definition: potential.cpp:2367
double dVdlambda(const dVec &, const dVec &)
The derivative of the effective potential with respect to lambda.
Definition: potential.cpp:2426
~HardRodPotential()
Destructor.
Definition: potential.cpp:2376
virtual double V(const dVec &r)
The classical potential.
Definition: potential.h:1108
double dVdtau(const dVec &, const dVec &)
The derivative of the effective potential with respect to tau.
Definition: potential.cpp:2451
Computes the effective potential from the exact two-body density matrix for hard spheres in 3D.
Definition: potential.h:1032
virtual double V(const dVec &r)
The classical potential.
Definition: potential.h:1038
double dVdlambda(const dVec &, const dVec &)
The derivative of the effective potential with respect to lambda.
Definition: potential.cpp:2108
~HardSpherePotential()
Destructor.
Definition: potential.cpp:2062
HardSpherePotential(double)
Constructor.
Definition: potential.cpp:2053
double dVdtau(const dVec &, const dVec &)
The derivative of the effective potential with respect to tau.
Definition: potential.cpp:2140
Computes the potential energy for an external harmonic potential with axial symmetry.
Definition: potential.h:202
double V(const dVec &r)
The potential.
Definition: potential.h:208
HarmonicCylinderPotential(const double)
Constructor.
Definition: potential.cpp:358
~HarmonicCylinderPotential()
Destructor.
Definition: potential.cpp:371
dVec gradV(const dVec &r)
The gradient of the potential.
Definition: potential.h:216
Computes the potential energy for an external harmonic potential.
Definition: potential.h:145
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to Harmonic potential.
Definition: potential.cpp:332
~HarmonicPotential()
Destructor.
Definition: potential.cpp:324
double V(const dVec &r)
The potential.
Definition: potential.h:154
dVec gradV(const dVec &r)
The gradient of the potential.
Definition: potential.h:159
Computes the value of the external wall potential for a cylindrical cavity.
Definition: potential.h:535
LJCylinderPotential(const double)
Constructor.
Definition: potential.cpp:1027
double grad2V(const dVec &)
Return the Laplacian of aziz potential for separation r using a lookup table.
Definition: potential.h:601
~LJCylinderPotential()
Destructor.
Definition: potential.cpp:1077
double V(const dVec &r)
The integrated LJ Wall potential.
Definition: potential.h:541
dVec gradV(const dVec &)
Return the gradient of aziz potential for separation r using a lookup table.
Definition: potential.h:583
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to the LJ cylinder potential.
Definition: potential.cpp:1191
Computes the value of the external wall potential for an hour-glass shaped cavity.
Definition: potential.h:622
LJHourGlassPotential(const double, const double, const double)
Constructor.
Definition: potential.cpp:1273
double grad2V(const dVec &pos)
Grad^2 of the potential.
Definition: potential.h:637
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to the LJ cylinder potential.
Definition: potential.cpp:1429
double V(const dVec &)
The integrated LJ hour glass potential.
Definition: potential.cpp:1314
Array< dVec, 1 > initialConfig1(const Container *, MTRand &, const int)
Return a set of initial positions inside the hourglass.
Definition: potential.cpp:1354
dVec gradV(const dVec &pos)
The gradient of the potential.
Definition: potential.h:632
~LJHourGlassPotential()
Destructor.
Definition: potential.cpp:1301
The particle (bead) lookup table.
Definition: lookuptable.h:29
Computes the potential energy for delta function interaction potential, approximated here as the limi...
Definition: potential.h:275
~LorentzianPotential()
Destructor.
Definition: potential.cpp:424
LorentzianPotential(double, double)
Constructor.
Definition: potential.cpp:413
double V(const dVec &r)
Return the delta function potential with strength 2c approximated as the limit of a Lorentzian distri...
Definition: potential.h:285
dVec gradV(const dVec &r)
Return the gradient of the delta function potential with strength 2c approximated as the limit of a L...
Definition: potential.h:294
The space-time trajectories.
Definition: path.h:29
Computes the value of the external wall potential for a plated cylindrical cavity.
Definition: potential.h:440
double V(const dVec &r)
The integrated LJ Wall potential.
Definition: potential.h:446
dVec gradV(const dVec &)
Return the gradient of aziz potential for separation r using a lookup table.
Definition: potential.h:496
double grad2V(const dVec &)
Return the Laplacian of aziz potential for separation r using a lookup table.
Definition: potential.h:514
PlatedLJCylinderPotential(const double, const double, const double, const double, const double)
Constructor.
Definition: potential.cpp:800
~PlatedLJCylinderPotential()
Destructor.
Definition: potential.cpp:846
Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Initial configuration corresponding to the LJ cylinder potential.
Definition: potential.cpp:948
The base class from which all specific potentials are derived from.
Definition: potential.h:32
double deltaSeparation(double sep1, double sep2) const
Return the minimum image difference for 1D separations.
Definition: potential.cpp:119
PotentialBase()
Constructor.
Definition: potential.cpp:25
virtual double grad2V(const dVec &)
Grad^2 of the potential.
Definition: potential.h:48
virtual Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Default Initial configuration of particles.
Definition: potential.cpp:41
virtual ~PotentialBase()
Destructor.
Definition: potential.cpp:32
double tailV
Tail correction factor.
Definition: potential.h:61
void output(const double)
A debug method that output's the potential to a supplied separation.
Definition: potential.cpp:106
virtual dVec gradV(const dVec &)
The gradient of the potential.
Definition: potential.h:45
virtual Array< double, 1 > getExcLen()
Array to hold data elements.
Definition: potential.cpp:135
virtual double dVdlambda(const dVec &, const dVec &)
The derivative of the effective potential with respect to lambda and tau.
Definition: potential.h:52
virtual double V(const dVec &, const dVec &)
The effective potential for the pair product approximation.
Definition: potential.h:42
virtual double V(const dVec &)
The potential.
Definition: potential.h:39
Computes the potential energy for an external single well potential.
Definition: potential.h:175
~SingleWellPotential()
Destructor.
Definition: potential.cpp:301
SingleWellPotential()
Constructor.
Definition: potential.cpp:295
dVec gradV(const dVec &r)
The gradient of the potential.
Definition: potential.h:187
double V(const dVec &r)
The potential.
Definition: potential.h:181
Computes the potential energy for the periodic Sutherland model which approximates long-range 1/r^2 i...
Definition: potential.h:313
dVec gradV(const dVec &r)
Return the gradient of the Sutherland potential.
Definition: potential.h:329
double V(const dVec &r)
Return the Sutherland potential g/r^2.
Definition: potential.h:321
double grad2V(const dVec &r)
Return the Laplacian of the Sutherland potential.
Definition: potential.h:339
~SutherlandPotential()
Destructor.
Definition: potential.cpp:448
SutherlandPotential(double)
Constructor.
Definition: potential.cpp:439
Computes the value of the semi-empircal Szalewicz potential that is known to be accurate for He-4.
Definition: potential.h:774
dVec gradV(const dVec &)
Return the gradient of Szalewicz potential for separation r using a lookup table.
Definition: potential.h:890
~SzalewiczPotential()
Destructor.
Definition: potential.cpp:1694
double grad2V(const dVec &)
Return the Laplacian of Szalewicz potential for separation r using a lookup table.
Definition: potential.h:905
double V(const dVec &)
Return the Szalewicz potential for separation r using a lookup table.
Definition: potential.h:878
SzalewiczPotential(const Container *)
Constructor.
Definition: potential.cpp:1625
Pre-tabulated potential for complicated functions.
Definition: potential.h:80
Array< double, 1 > lookupd2Vdr2
A lookup table for d2Vint/dr2.
Definition: potential.h:88
TabulatedPotential()
Constructor.
Definition: potential.cpp:149
int tableLength
The number of elements in the lookup table.
Definition: potential.h:91
TinyVector< double, 2 > extdVdr
Extremal value of dV/dr.
Definition: potential.h:94
virtual ~TabulatedPotential()
Destructor.
Definition: potential.cpp:158
virtual double valuedVdr(const double)=0
The functional value of dV/dr.
TinyVector< double, 2 > extV
Extremal value of V.
Definition: potential.h:93
void initLookupTable(const double, const double)
Given a discretization factor and the system size, create and fill the lookup tables for the potentia...
Definition: potential.cpp:168
Array< double, 1 > lookupdVdr
A lookup table for dVint/dr.
Definition: potential.h:87
virtual double valued2Vdr2(const double)=0
The functional value of d2V/dr2.
virtual double valueV(const double)=0
The functional value of V.
virtual double direct(const Array< double, 1 > &, const TinyVector< double, 2 > &, const double)
Use a direct lookup for the potential table.
Definition: potential.cpp:255
virtual double newtonGregory(const Array< double, 1 > &, const TinyVector< double, 2 > &, const double)
Use the Newton-Gregory forward difference method to do a 2-point lookup on the potential table.
Definition: potential.cpp:226
TinyVector< double, 2 > extd2Vdr2
Extremal value of d2V/dr2.
Definition: potential.h:95
Array< double, 1 > lookupV
A potential lookup table.
Definition: potential.h:86
double dr
The discretization for the lookup table.
Definition: potential.h:90
Global common header with shared dependencies and methods.
#define NDIM
Number of spatial dimnsions.
Definition: common.h:71
#define EPS
A small number.
Definition: common.h:94
#define LBIG
The log of a big number.
Definition: common.h:97
TinyVector< double, NDIM > dVec
A NDIM-vector of type double.
Definition: common.h:111
ConstantParameters class definition.
ConstantParameters * constants()
Global public access to the constants.
Definition: constants.h:201