Loading...
Searching...
No Matches
GhostPotential Class Referenceabstract

Common base class of ParallelPotential and QCPotential. More...

#include <GhostPotential.h>

Inheritance diagram for GhostPotential:

Public Member Functions

 GhostPotential (AsapPotential *p)
virtual bool CheckAndUpdateAtoms (bool update)=0
 Check if the ghost atoms want the neighbor list updated.
virtual void CommunicateData (double data[])=0
 Place data on virtual atoms.
virtual void CommunicateData (double data[], int n)=0
 Place data on virtual atoms.
virtual void UpdateGhostPositions ()=0
 Update the position of ghost atoms.
double GetCutoffRadius () const
 Get the cutoff of the wrapped potential.
double GetLatticeConstant () const
 Get the lattice constant of the wrapped potential.
Public Member Functions inherited from AsapPotential
virtual ~AsapPotential ()
virtual void SetAtoms (Atoms *a)=0
 Set the atoms belonging to this potential.
virtual double GetPotentialEnergy ()=0
 Calculate the total energy of the system.
virtual const VecGetCartesianForces ()=0
 Calculate the forces on all atoms and return the result.
virtual const symTensorGetStresses (const Vec *momenta=0)=0
 Calculate the stress on all atoms.
virtual void GetStress (double stress[6], const Vec *momenta=0)=0
 Calculate the total stress of the system.
virtual const double * GetPotentialEnergies ()=0
 Calculate the energy of all atoms.
virtual void CheckNeighborLists ()=0
virtual double CalculateLatticeEnergy (const Vec a[3])
 Calculate the energy of an atom in a regular fcc(?) lattice.
virtual void CalculateDerivatives (const Vec a[3], double dEdaDota[6])
 Calculate derivative of the energy of an atom in a regular lattice.
virtual double GetData () const
 Get data used by the QuasiContinuum method.
virtual void UpdateSuperCell (const SuperCell *newSuperCell)=0
 Tell the Potential that a new SuperCell has been assigned to the atoms.
virtual int GetNumberOfAtoms () const =0
 Get the number of atoms.

Protected Attributes

AsapPotentialpotential
 Pointer to the wrapped potential.

Detailed Description

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).

Definition at line 23 of file GhostPotential.h.

Constructor & Destructor Documentation

◆ GhostPotential()

GhostPotential::GhostPotential ( AsapPotential * p)
inline

Definition at line 25 of file GhostPotential.h.

26 : potential(p) {}
AsapPotential * potential
Pointer to the wrapped potential.

Member Function Documentation

◆ CheckAndUpdateAtoms()

virtual bool GhostPotential::CheckAndUpdateAtoms ( bool update)
pure virtual

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.

◆ CommunicateData() [1/2]

virtual void GhostPotential::CommunicateData ( double data[])
pure virtual

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.

◆ CommunicateData() [2/2]

virtual void GhostPotential::CommunicateData ( double data[],
int n )
pure virtual

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.

◆ GetCutoffRadius()

double GhostPotential::GetCutoffRadius ( ) const
inlinevirtual

Get the cutoff of the wrapped potential.

Implements AsapPotential.

Definition at line 57 of file GhostPotential.h.

57{ return potential->GetCutoffRadius(); }

◆ GetLatticeConstant()

double GhostPotential::GetLatticeConstant ( ) const
inlinevirtual

Get the lattice constant of the wrapped potential.

Implements AsapPotential.

Definition at line 60 of file GhostPotential.h.

60{ return potential->GetLatticeConstant(); }

◆ UpdateGhostPositions()

virtual void GhostPotential::UpdateGhostPositions ( )
pure virtual

Update the position of ghost atoms.

Member Data Documentation

◆ potential

AsapPotential* GhostPotential::potential
protected

Pointer to the wrapped potential.

Definition at line 63 of file GhostPotential.h.


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