Path Integral Quantum Monte Carlo
Public Member Functions
LJCylinderPotential Class Reference

Computes the value of the external wall potential for a cylindrical cavity. More...

#include <potential.h>

+ Inheritance diagram for LJCylinderPotential:
+ Collaboration diagram for LJCylinderPotential:

Public Member Functions

 LJCylinderPotential (const double)
 Constructor. More...
 
 ~LJCylinderPotential ()
 Destructor.
 
double V (const dVec &r)
 The integrated LJ Wall potential.
 
dVec gradV (const dVec &)
 Return the gradient of aziz potential for separation r using a lookup table.
 
double grad2V (const dVec &)
 Return the Laplacian of aziz potential for separation r using a lookup table.
 
Array< dVec, 1 > initialConfig (const Container *, MTRand &, const int)
 Initial configuration corresponding to the LJ cylinder 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 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...
 
- Public Member Functions inherited from TabulatedPotential
 TabulatedPotential ()
 Constructor.
 
virtual ~TabulatedPotential ()
 Destructor.
 

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.
 
- Protected Member Functions inherited from TabulatedPotential
void initLookupTable (const double, const double)
 Given a discretization factor and the system size, create and fill the lookup tables for the potential and its derivative.
 
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. More...
 
virtual double direct (const Array< double, 1 > &, const TinyVector< double, 2 > &, const double)
 Use a direct lookup for the potential table. More...
 
- Protected Attributes inherited from TabulatedPotential
Array< double, 1 > lookupV
 A potential lookup table.
 
Array< double, 1 > lookupdVdr
 A lookup table for dVint/dr.
 
Array< double, 1 > lookupd2Vdr2
 A lookup table for d2Vint/dr2.
 
double dr
 The discretization for the lookup table.
 
int tableLength
 The number of elements in the lookup table.
 
TinyVector< double, 2 > extV
 Extremal value of V.
 
TinyVector< double, 2 > extdVdr
 Extremal value of dV/dr.
 
TinyVector< double, 2 > extd2Vdr2
 Extremal value of d2V/dr2.
 

Detailed Description

Computes the value of the external wall potential for a cylindrical cavity.

Definition at line 535 of file potential.h.

Constructor & Destructor Documentation

◆ LJCylinderPotential()

LJCylinderPotential::LJCylinderPotential ( const double  radius)

Constructor.

We create a Lennard-Jones cylinder, which uses a lookup table to hold the value of the integrated 6-12 potential for helium atoms interacting with a silicon nitride cylinder.

See also
C. Chakravarty J. Phys. Chem. B, 101, 1878 (1997).
Parameters
radiusThe radius of the cylinder

Definition at line 1027 of file potential.cpp.

1027  :
1028  PotentialBase(),
1030 {
1031 
1032  /* The radius of the tube */
1033  R = radius;
1034 
1035  /* The density of nitrogen in silicon nitride */
1036  density = 0.078; // atoms / angstrom^3
1037 // density = 0.008; // atoms / angstrom^3
1038 
1039  /* We define the values of epsilon and sigma for N and He */
1040 // double epsilonHe = 10.216; // Kelvin
1041 // double sigmaHe = 2.556; // angstroms
1042 // double sigmaN = 3.299; // angstroms
1043 // double epsilonN = 36.2; // Kelvin
1044 // epsilon = sqrt(epsilonHe*epsilonN);
1045 // sigma = 0.5*(sigmaHe + sigmaN);
1046 
1047  /* We operate under the assumption that the silicon can be neglected in the
1048  * silicon-nitride, and thus only consider the Nitrogen. We use a
1049  * Kiselov type model to extract the actual parameters. We assume that
1050  * silicate and silicon-nitride are roughly equivalent. */
1051  epsilon = 10.22; // Kelvin
1052  sigma = 2.628; // angstroms
1053 
1054 // epsilon = 32; // Kelvin
1055 // sigma = 3.08; // angstroms
1056 
1057  /* We choose a mesh consisting of 10^6 points, and create the lookup table */
1058  dR = (1.0E-6)*R;
1059 
1060  initLookupTable(dR,R);
1061 
1062  /* Find the minimun of the potential */
1063  minV = 1.0E5;
1064  for (int n = 0; n < tableLength; n++) {
1065  if (lookupV(n) < minV)
1066  minV = lookupV(n);
1067  }
1068 
1069  /* The extremal values for the lookup table */
1070  extV = valueV(0.0),valueV(R);
1071  extdVdr = valuedVdr(0.0),valuedVdr(R);
1072 }
PotentialBase()
Constructor.
Definition: potential.cpp:25
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
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 > lookupV
A potential lookup table.
Definition: potential.h:86
+ Here is the call graph for this function:

Member Function Documentation

◆ initialConfig()

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

Initial configuration corresponding to the LJ cylinder potential.

Return an initial particle configuration.

Return a set of initial positions inside the cylinder.

Reimplemented from PotentialBase.

Definition at line 1191 of file potential.cpp.

1192  {
1193 
1194  /* The particle configuration */
1195  Array<dVec,1> initialPos(numParticles);
1196  initialPos = 0.0;
1197 
1198  /* We shift the radius inward to account for the excluded volume from the
1199  * hard wall. This represents the largest prism that can be put
1200  * inside a cylinder. */
1201  dVec lside;
1202  lside[0] = lside[1] = sqrt(2.0)*(R-sigma);
1203  lside[2] = boxPtr->side[NDIM-1];
1204 
1205  /* Get the linear size per particle */
1206  double initSide = pow((1.0*numParticles/product(lside)),-1.0/(1.0*NDIM));
1207 
1208  /* We determine the number of initial grid boxes there are in
1209  * in each dimension and compute their size */
1210  int totNumGridBoxes = 1;
1211  iVec numNNGrid;
1212  dVec sizeNNGrid;
1213 
1214  for (int i = 0; i < NDIM; i++) {
1215  numNNGrid[i] = static_cast<int>(ceil((lside[i] / initSide) - EPS));
1216 
1217  /* Make sure we have at least one grid box */
1218  if (numNNGrid[i] < 1)
1219  numNNGrid[i] = 1;
1220 
1221  /* Compute the actual size of the grid */
1222  sizeNNGrid[i] = lside[i] / (1.0 * numNNGrid[i]);
1223 
1224  /* Determine the total number of grid boxes */
1225  totNumGridBoxes *= numNNGrid[i];
1226  }
1227 
1228  /* Now, we place the particles at the middle of each box */
1229  PIMC_ASSERT(totNumGridBoxes>=numParticles);
1230  dVec pos;
1231  for (int n = 0; n < totNumGridBoxes; n++) {
1232 
1233  iVec gridIndex;
1234  for (int i = 0; i < NDIM; i++) {
1235  int scale = 1;
1236  for (int j = i+1; j < NDIM; j++)
1237  scale *= numNNGrid[j];
1238  gridIndex[i] = (n/scale) % numNNGrid[i];
1239  }
1240 
1241  for (int i = 0; i < NDIM; i++)
1242  pos[i] = (gridIndex[i]+0.5)*sizeNNGrid[i] - 0.5*lside[i];
1243 
1244  boxPtr->putInside(pos);
1245 
1246  if (n < numParticles)
1247  initialPos(n) = pos;
1248  else
1249  break;
1250  }
1251 
1252  return initialPos;
1253 }
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:

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