class GhostPotential

Overview

Common base class of ParallelPotential and QCPotential. More…

#include <GhostPotential.h>
 
class GhostPotential: public AsapPotential {
public:
    // construction
 
    GhostPotential(AsapPotential* p);
 
    // methods
 
    virtual bool CheckAndUpdateAtoms(bool update) = 0;
    virtual void CommunicateData(double data[]) = 0;
    virtual void CommunicateData(double data[], int n) = 0;
    virtual void UpdateGhostPositions() = 0;
    virtual double GetCutoffRadius() const;
    virtual double GetLatticeConstant() const;
};

Inherited Members

public:
    // methods
 
    virtual void SetAtoms(Atoms* a) = 0;
    virtual double GetPotentialEnergy() = 0;
    virtual const Vec* GetCartesianForces() = 0;
    virtual const symTensor* GetStresses(const Vec* momenta = 0) = 0;
    virtual void GetStress(double stress[6], const Vec* momenta = 0) = 0;
    virtual const double* GetPotentialEnergies() = 0;
    virtual void CheckNeighborLists() = 0;
    virtual double CalculateLatticeEnergy(const Vec a[3]);
    virtual void CalculateDerivatives(const Vec a[3], double dEdaDota[6]);
    virtual double GetData() const;
    virtual double GetCutoffRadius() const = 0;
    virtual double GetLatticeConstant() const = 0;
    virtual void UpdateSuperCell(const SuperCell* newSuperCell) = 0;
    virtual int GetNumberOfAtoms() const = 0;

Detailed Documentation

Common base class of ParallelPotential and QCPotential.

GhostPotential is a common base class of the functional extensions of Potential for extensions of Atoms which have the concept of ghost atoms (ParallelAtoms and QCAtoms).

A GhostPotential is derived from Potential since it replaces the normal potential in parallel/QC simulations. It also wraps a Potential, namely a specific implementation of Potential (EMT, MoPotential …) describing the interatomic interactions. In this way both parallel and QC simulations are supported with minimal intrusion in the potentials (the specific potentials occationally need to check if the Atoms are really GhostAtoms and then call a few helper functions).

Methods

virtual bool CheckAndUpdateAtoms(bool update) = 0

Check if the ghost atoms want the neighbor list updated.

Called by NeihborList::CheckAndUpdateNeighborList() to post-process the decision to update the neighbor list. Only used by ParallelPotential, where all neighbor lists on all processors should be updated when one processor does it.

virtual void CommunicateData(double data[]) = 0

Place data on virtual atoms.

CommunicateData is used by potentials where exactly one double per atom needs to be updated on all atoms. The data may originate from the corresponding arrays on other processors (this is the case in ParallelPotential) or be calculated (QCPotential). In EMT this quantity is sigma1. If future potentials need to communicate more date, this interface must be extended.

virtual void CommunicateData(double data[], int n) = 0

Place data on virtual atoms.

Bug This is a primitive extension of CommunicateData(double *), it does not work with the quasicontinuum method and must be improved.

virtual void UpdateGhostPositions() = 0

Update the position of ghost atoms.

virtual double GetCutoffRadius() const

Get the cutoff of the wrapped potential.

virtual double GetLatticeConstant() const

Get the lattice constant of the wrapped potential.