Path Integral Quantum Monte Carlo
Public Member Functions
GraphenePotential Class Reference

The smooth non-corregated version of the helium-carbon nanotube potential. More...

#include <potential.h>

+ Inheritance diagram for GraphenePotential:
+ Collaboration diagram for GraphenePotential:

Public Member Functions

 GraphenePotential (const double, const double, const double, const double, const double)
 Constructor.
 
 ~GraphenePotential ()
 Destructor.
 
double V (const dVec &r)
 Return the value of the van der Waals' interaction between a graphene sheet and a helium adatom at a position, r, above the sheet. More...
 
Array< dVec, 1 > initialConfig (const Container *, MTRand &, const int)
 Initial configuration corresponding to graphene-helium vdW potential. More...
 
- Public Member Functions inherited from PotentialBase
 PotentialBase ()
 Constructor.
 
virtual ~PotentialBase ()
 Destructor.
 
virtual double V (const dVec &, const dVec &)
 The effective potential for the pair product approximation.
 
virtual dVec gradV (const dVec &)
 The gradient of the potential.
 
virtual double grad2V (const dVec &)
 Grad^2 of the potential.
 
virtual double dVdlambda (const dVec &, const dVec &)
 The derivative of the effective potential with respect to lambda and tau.
 
virtual double dVdtau (const dVec &, const dVec &)
 
void output (const double)
 A debug method that output's the potential to a supplied separation. More...
 
virtual Array< double, 1 > getExcLen ()
 Array to hold data elements. More...
 

Additional Inherited Members

- Data Fields inherited from PotentialBase
double tailV
 Tail correction factor.
 
- Protected Member Functions inherited from PotentialBase
double deltaSeparation (double sep1, double sep2) const
 Return the minimum image difference for 1D separations.
 

Detailed Description

The smooth non-corregated version of the helium-carbon nanotube potential.

See also
http://prb.aps.org/abstract/PRB/v62/i3/p2173_1

Returns van der Waals' potential between a helium adatom and a graphene sheet using summation in reciprocal space.

Author: Nathan Nichols Returns the potential energy resulting from a van der Waals' interaction between a helium adatom and a fixed infinite graphene lattice

Definition at line 1174 of file potential.h.

Member Function Documentation

◆ initialConfig()

Array< dVec, 1 > GraphenePotential::initialConfig ( const Container boxPtr,
MTRand &  random,
const int  numParticles 
)
virtual

Initial configuration corresponding to graphene-helium vdW potential.

Return an initial particle configuration.

We create particles at random locations above the graphene sheet.

Reimplemented from PotentialBase.

Definition at line 2571 of file potential.cpp.

2572  {
2573 
2574  /* The particle configuration */
2575  Array<dVec,1> initialPos(numParticles);
2576  initialPos = 0.0;
2577  double initSideCube = 1.0*numParticles;
2578 
2579  for (int i = 0; i < NDIM - 1; i++) {
2580  initSideCube /= boxPtr->side[i];
2581  }
2582 
2583  initSideCube /= ((boxPtr->side[NDIM-1] / 2.0) - 6.0);
2584 
2585  /* Get the linear size per particle, and the number of particles */
2586  double initSide = pow((initSideCube),-1.0/(1.0*NDIM));
2587 
2588  /* We determine the number of initial grid boxes there are in
2589  * in each dimension and compute their size */
2590  int totNumGridBoxes = 1;
2591  iVec numNNGrid;
2592  dVec sizeNNGrid;
2593 
2594  for (int i = 0; i < NDIM - 1; i++) {
2595  numNNGrid[i] = static_cast<int>(ceil((boxPtr->side[i] / initSide) - EPS));
2596 
2597  /* Make sure we have at least one grid box */
2598  if (numNNGrid[i] < 1)
2599  numNNGrid[i] = 1;
2600 
2601  /* Compute the actual size of the grid */
2602  sizeNNGrid[i] = boxPtr->side[i] / (1.0 * numNNGrid[i]);
2603 
2604  /* Determine the total number of grid boxes */
2605  totNumGridBoxes *= numNNGrid[i];
2606  }
2607 
2608  numNNGrid[NDIM-1] = static_cast<int>(ceil(((boxPtr->side[NDIM-1] - 12.0) / (2.0 * initSide)) - EPS));
2609 
2610  /* Make sure we have at least one grid box */
2611  if (numNNGrid[NDIM-1] < 1)
2612  numNNGrid[NDIM-1] = 1;
2613 
2614  /* Compute the actual size of the grid */
2615  sizeNNGrid[NDIM-1] = (boxPtr->side[NDIM-1] - 12.0) / (2.0 * numNNGrid[NDIM-1]);
2616 
2617  /* Determine the total number of grid boxes */
2618  totNumGridBoxes *= numNNGrid[NDIM-1];
2619 
2620  /* Now, we place the particles at the middle of each box */
2621  PIMC_ASSERT(totNumGridBoxes>=numParticles);
2622  dVec pos;
2623  for (int n = 0; n < totNumGridBoxes; n++) {
2624 
2625  iVec gridIndex;
2626  for (int i = 0; i < NDIM; i++) {
2627  int scale = 1;
2628  for (int j = i+1; j < NDIM; j++)
2629  scale *= numNNGrid[j];
2630  gridIndex[i] = (n/scale) % numNNGrid[i];
2631  }
2632 
2633  for (int i = 0; i < NDIM - 1; i++)
2634  pos[i] = (gridIndex[i]+0.5)*sizeNNGrid[i] - 0.5*boxPtr->side[i];
2635 
2636  pos[NDIM - 1] = (gridIndex[NDIM - 1]+0.5)*sizeNNGrid[NDIM - 1] + 3.0;
2637 
2638  boxPtr->putInside(pos);
2639 
2640  if (n < numParticles)
2641  initialPos(n) = pos;
2642  else
2643  break;
2644  }
2645  return initialPos;
2646 }
virtual void putInside(dVec &) const =0
Place a vector inside the simulation cell.
dVec side
The linear dimensions of the box.
Definition: container.h:31
#define NDIM
Number of spatial dimnsions.
Definition: common.h:71
#define EPS
A small number.
Definition: common.h:94
TinyVector< double, NDIM > dVec
A NDIM-vector of type double.
Definition: common.h:111
#define PIMC_ASSERT(X)
Rename assert method.
Definition: common.h:64
TinyVector< int, NDIM > iVec
A NDIM-vector of type integer.
Definition: common.h:114
+ Here is the call graph for this function:

◆ V()

double GraphenePotential::V ( const dVec r)
virtual

Return the value of the van der Waals' interaction between a graphene sheet and a helium adatom at a position, r, above the sheet.

Parameters
rthe position of a helium particle
Returns
the van der Waals' potential for graphene-helium

Reimplemented from PotentialBase.

Definition at line 2526 of file potential.cpp.

2526  {
2527 
2528  double z = r[2] + Lzo2;
2529 
2530  /* We take care of the particle being in a forbidden region */
2531  if (z < 1.5)
2532  return 40000.;
2533  if (z > Lz-0.05)
2534  return 40000.;
2535 
2536  double x = r[0];
2537  double y = r[1];
2538  double g = 0.;
2539  double gdotb1 = 0.;
2540  double gdotb2 = 0.;
2541  double k5term = 0.;
2542  double k2term = 0.;
2543  double prefactor = 0.;
2544  double v_g = 0.;
2545  double v = (4.*M_PI/A)*epsilon*sigma*sigma*( ((2./5.)*pow((sigma/z),10)) - pow((sigma/z),4) );
2546 
2547  for (double m = -1; m < 1+1; m++) {
2548  for (double n = -1; n < 1+1; n++) {
2549  if ((m != 0) || (n != 0)){
2550  g = sqrt(pow((m*g1x + n*g2x),2.) + pow((m*g1y + n*g2y),2.));
2551  gdotb1 = ((m*g1x + n*g2x)*(b1x+x)) + ((m*g1y + n*g2y)*(b1y+y));
2552  gdotb2 = ((m*g1x + n*g2x)*(b2x+x)) + ((m*g1y + n*g2y)*(b2y+y));
2553  k5term = pow((g*sigma*sigma/2./z),5.)*boost::math::cyl_bessel_k(5., g*z)/30.;
2554  k2term = 2.*pow((g*sigma*sigma/2./z),2.)*boost::math::cyl_bessel_k(2., g*z);
2555  prefactor = epsilon*sigma*sigma*2.*M_PI/A;
2556 
2557  v_g = prefactor*(k5term-k2term);
2558  v += (cos(gdotb1)+cos(gdotb2))*v_g;
2559  }
2560  }
2561  }
2562 
2563  return v;
2564 
2565 }

The documentation for this class was generated from the following files: