Path Integral Quantum Monte Carlo
Public Member Functions
FixedAzizPotential Class Reference

Computes the potential energy resulting from a series of fixed helium atoms that are not updated and provide a static 'external' potential. More...

#include <potential.h>

+ Inheritance diagram for FixedAzizPotential:
+ Collaboration diagram for FixedAzizPotential:

Public Member Functions

 FixedAzizPotential (const Container *)
 Constructor. More...
 
 ~FixedAzizPotential ()
 Destructor.
 
double V (const dVec &r)
 The total potential coming from the interaction of a particle with all fixed particles.
 
dVec gradV (const dVec &r)
 The gradient of the total potential coming from the interaction of a particle with all fixed particles.
 
Array< dVec, 1 > initialConfig (const Container *, MTRand &, const int)
 Initial configuration corresponding to FixedAziz 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 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

Computes the potential energy resulting from a series of fixed helium atoms that are not updated and provide a static 'external' potential.

We require a Aziz potential interaction pointer to properly compute the interaction with the static particles.

Definition at line 924 of file potential.h.

Constructor & Destructor Documentation

◆ FixedAzizPotential()

FixedAzizPotential::FixedAzizPotential ( const Container _boxPtr)

Constructor.

We load the positions of fixed but interacting particles from disk and create a new lookup table which will be used to speed up the computation. The interactions with the fixed particles are assumed to be Aziz.

Definition at line 490 of file potential.cpp.

490  :
491  aziz(_boxPtr) {
492 
493  char state; // Fixed or updateable?
494  dVec pos; // The loaded position
495 
496  /* Initialize the cutoff^2 */
497  rc2 = constants()->rc2();
498 
499  /* We start with an array of size 500 */
500  fixedParticles.resize(500);
501 
502  /* Here we load both the number and location of fixed helium atoms from disk. */
503  numFixedParticles = 0;
504  int n = 0;
505  while (!communicate()->file("fixed")->stream().eof()) {
506  if (communicate()->file("fixed")->stream().peek() == '#') {
507  communicate()->file("fixed")->stream().ignore(512,'\n');
508  }
509  else {
510  communicate()->file("fixed")->stream() >> state;
511  for (int i = 0; i < NDIM; i++)
512  communicate()->file("fixed")->stream() >> pos[i];
513 
514  /* If the particle is labelled with an 'F' it is fixed and should
515  * be included here */
516  if (state == 'F') {
517  numFixedParticles++;
518  if (numFixedParticles >= int(fixedParticles.size()))
519  fixedParticles.resizeAndPreserve(numFixedParticles);
520 
521  /* Put the initial position in the container */
522  _boxPtr->putInside(pos);
523  fixedParticles(n) = pos;
524  n++;
525  }
526  communicate()->file("fixed")->stream().ignore();
527  }
528  }
529 
530  fixedParticles.resizeAndPreserve(numFixedParticles);
531 
532  /* Now that we have the particle positions, create a new lookup table pointer
533  * and initialize it */
534  lookupPtr = new LookupTable(_boxPtr,1,numFixedParticles);
535  lookupPtr->updateGrid(fixedParticles);
536 
537  /* Resize and initialize our local grid box arrays */
538  fixedBeadsInGrid.resize(lookupPtr->getTotNumGridBoxes(),numFixedParticles);
539  numFixedBeadsInGrid.resize(lookupPtr->getTotNumGridBoxes());
540  fixedBeadsInGrid = XXX;
541  numFixedBeadsInGrid = 0;
542 
543  /* Create a local copy of all beads in each grid box plus nearest neighbors.
544  * This will drastically speed up the computing of potential energies. */
545  for (n = 0; n < lookupPtr->getTotNumGridBoxes(); n++) {
546  lookupPtr->updateFullInteractionList(n,0);
547  numFixedBeadsInGrid(n) = lookupPtr->fullNumBeads;
548  for (int m = 0; m < lookupPtr->fullNumBeads; m++)
549  fixedBeadsInGrid(n,m) = lookupPtr->fullBeadList(m)[1];
550  }
551 
552 }
File * file(string type)
Get method returning file object.
Definition: communicator.h:85
double rc2() const
Get potential cutoff squared.
Definition: constants.h:48
virtual void putInside(dVec &) const =0
Place a vector inside the simulation cell.
The particle (bead) lookup table.
Definition: lookuptable.h:29
int fullNumBeads
The full number of active beads in beadList;.
Definition: lookuptable.h:44
int getTotNumGridBoxes()
Return the total number of grid boxes.
Definition: lookuptable.h:49
void updateGrid(const Path &)
We update the full nearest neighbor grid by filling up all data arrays at all time slices.
void updateFullInteractionList(const beadLocator &, const int)
Fill up the fullBeadList array with a list of beads in the same grid box as the supplied beadIndex an...
Array< beadLocator, 1 > fullBeadList
The full dynamic list of interacting beads.
Definition: lookuptable.h:41
#define NDIM
Number of spatial dimnsions.
Definition: common.h:71
TinyVector< double, NDIM > dVec
A NDIM-vector of type double.
Definition: common.h:111
#define XXX
Used to refer to a nonsense beadIndex.
Definition: common.h:98
Communicator * communicate()
Global public access to the communcator singleton.
Definition: communicator.h:121
ConstantParameters * constants()
Global public access to the constants.
Definition: constants.h:201
+ Here is the call graph for this function:

Member Function Documentation

◆ initialConfig()

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

Initial configuration corresponding to FixedAziz potential.

Return an initial particle configuration.

We load an initial configuration from disk, which consists of a number of updateable positions. These positions are stored as NDIM vectors and proceeded by a letter 'U'.

Reimplemented from PotentialBase.

Definition at line 620 of file potential.cpp.

621  {
622 
623  /* The particle configuration */
624  Array<dVec,1> initialPos(1);
625  initialPos = 0.0;
626 
627  int locNumParticles = 0; // Number of updateable particles
628  char state; // Update or Fix
629  dVec pos; // The current position
630 
631  /* We go through all lines in the fixed input file, discarding any comments
632  * and assign the initial positions of the particles */
633  int n = 0;
634  while (!communicate()->file("fixed")->stream().eof()) {
635  if (communicate()->file("fixed")->stream().peek() == '#') {
636  communicate()->file("fixed")->stream().ignore(512,'\n');
637  }
638  else {
639  communicate()->file("fixed")->stream() >> state;
640  for (int i = 0; i < NDIM; i++)
641  communicate()->file("fixed")->stream() >> pos[i];
642 
643  /* If the particle is labelled with an 'U' it is updatable and should
644  * be included */
645  if (state == 'U') {
646  locNumParticles++;
647  initialPos.resizeAndPreserve(locNumParticles);
648 
649  /* Put the initial position in the box */
650  boxPtr->putInside(pos);
651 
652  /* Assign the position to all time slices*/
653  initialPos(n) = pos;
654  n++;
655  }
656  communicate()->file("fixed")->stream().ignore();
657  }
658  }
659 
660  /* Reset the file pointer */
661  communicate()->file("fixed")->stream().seekg(0, ios::beg);
662 
663  /* Return the initial Positions */
664  return initialPos;
665 }
+ Here is the call graph for this function:

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