.. index:: pair: class; GhostPotential .. _doxid-class_ghost_potential: class GhostPotential ==================== .. toctree:: :hidden: Overview ~~~~~~~~ Common base class of ParallelPotential and QCPotential. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class GhostPotential: public :ref:`AsapPotential` { public: // construction :target:`GhostPotential`(:ref:`AsapPotential`* p); // methods virtual bool :ref:`CheckAndUpdateAtoms`(bool update) = 0; virtual void :ref:`CommunicateData`(double data[]) = 0; virtual void :ref:`CommunicateData`(double data[], int n) = 0; virtual void :ref:`UpdateGhostPositions`() = 0; virtual double :ref:`GetCutoffRadius`() const; virtual double :ref:`GetLatticeConstant`() const; }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods virtual void :ref:`SetAtoms`(:ref:`Atoms`* a) = 0; virtual double :ref:`GetPotentialEnergy`() = 0; virtual const :ref:`Vec`* :ref:`GetCartesianForces`() = 0; virtual const symTensor* :ref:`GetStresses`(const :ref:`Vec`* momenta = 0) = 0; virtual void :ref:`GetStress`(double stress[6], const :ref:`Vec`* momenta = 0) = 0; virtual const double* :ref:`GetPotentialEnergies`() = 0; virtual void :ref:`CheckNeighborLists`() = 0; virtual double :ref:`CalculateLatticeEnergy`(const :ref:`Vec` a[3]); virtual void :ref:`CalculateDerivatives`(const :ref:`Vec` a[3], double dEdaDota[6]); virtual double :ref:`GetData`() const; virtual double :ref:`GetCutoffRadius`() const = 0; virtual double :ref:`GetLatticeConstant`() const = 0; virtual void :ref:`UpdateSuperCell`(const :ref:`SuperCell`* newSuperCell) = 0; virtual int :ref:`GetNumberOfAtoms`() const = 0; .. _details-class_ghost_potential: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Common base class of ParallelPotential and QCPotential. :ref:`GhostPotential ` is a common base class of the functional extensions of Potential for extensions of :ref:`Atoms ` which have the concept of ghost atoms (ParallelAtoms and QCAtoms). A :ref:`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 (:ref:`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 :ref:`Atoms ` are really :ref:`GhostAtoms ` and then call a few helper functions). Methods ------- .. index:: pair: function; CheckAndUpdateAtoms .. _doxid-class_ghost_potential_1a2f5a6f364b7c4d2ae7a204b02822716f: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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. .. index:: pair: function; CommunicateData .. _doxid-class_ghost_potential_1a860b87a710b672701348bb39abc952f5: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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 :ref:`EMT ` this quantity is sigma1. If future potentials need to communicate more date, this interface must be extended. .. index:: pair: function; CommunicateData .. _doxid-class_ghost_potential_1ad1c22d7695ed622bef1b5b8cf2fa35f3: .. ref-code-block:: cpp :class: doxyrest-title-code-block 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. .. index:: pair: function; UpdateGhostPositions .. _doxid-class_ghost_potential_1a6421cbdcca1604e64c917bd7a0479ef7: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void UpdateGhostPositions() = 0 Update the position of ghost atoms. .. index:: pair: function; GetCutoffRadius .. _doxid-class_ghost_potential_1a4e8a147a65d44c0fcaaa60628ecea187: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual double GetCutoffRadius() const Get the cutoff of the wrapped potential. .. index:: pair: function; GetLatticeConstant .. _doxid-class_ghost_potential_1a161416927cdc62a4576c1370d3288ac4: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual double GetLatticeConstant() const Get the lattice constant of the wrapped potential.