Loading...
Searching...
No Matches
EMT Class Reference

The Effective Medium Theory (EMT) potential. More...

#include <EMT.h>

Inheritance diagram for EMT:

Public Member Functions

 EMT (EMTParameterProvider *prov=0)
 Create an EMT potential optionally using a parameter provider.
virtual ~EMT ()
 Delete the EMT potential.
void SetSubtractE0 (bool subtractE0)
virtual void SetAtoms (Atoms *atoms)
 Set the atoms belonging to this potential.
virtual const VecGetCartesianForces ()
 Calculate the forces on all atoms and return the result.
virtual const double * GetPotentialEnergies ()
 Calculate the energy of all atoms.
virtual double GetPotentialEnergy ()
 Calculate the total energy of the system.
virtual const symTensorGetStresses (const Vec *momenta=0)
 Calculate the stress on all atoms.
virtual void GetStress (double stress[6], const Vec *momenta=0)
 Calculate the total stress of the system.
virtual void CheckNeighborLists ()
 Check that neighbor lists are up to date, update them if not.
virtual double GetCutoffRadius () const
 Return the cutoff radius used in the potential.
virtual double GetLatticeConstant () const
 Return the lattice constant of the material, if well-defined.
virtual int GetNumberOfAtoms () const
 Get the number of atoms.
virtual void SetContinuumElement (int z)
 Specify the element in the continuum region of a QuasiContinuum simulation.
virtual void UpdateSuperCell (const SuperCell *newSuperCell)
 Tell the Potential that a new SuperCell has been assigned to the atoms.
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.
const double * GetSigma1 (int n)
 Return a pointer to the EMT "density" sigma1.
const double * GetSigma2 (int n)
 Return a pointer to the EMT "density" sigma2.
void PrintParameters ()
 Print the EMT parameters.
NeighborListGetNeighborList () const
 Return a pointer to the neighbor list.
Public Member Functions inherited from AsapPotential
virtual ~AsapPotential ()

Protected Member Functions

virtual void InitParameters ()
 Initialization of the EMT parameters.
virtual void Allocate ()
 (Re)allocate storage for forces, energies and intermediate results.
virtual void AllocateStress ()
 (Re)allocate storage for stresses
virtual void CalculateIDs ()
 Calculate type numbers from the atomic numbers.
virtual void CalculateSigmas (int calculatesigma2=1)
 Calculate sigma1 and perhaps sigma2.
virtual void CalculateEnergiesAfterSigmas (double *Epot=0)
 Calculate energies once sigma1 is known.
virtual void CalculateForcesAfterEnergies (Vec *forces, double stress[][6]=0)
 Calculate forces in a multicomponent system.
virtual void CalculateForcesAfterEnergiesSingle (Vec *forces, double stress[][6]=0)
 Calculate forces in a system with only one element.
virtual void CalculateStuff (const Vec a[3], double &sigma1, double &sigma2, double *diffs2, double *wght, double *dsigma1, double *dsigma2)
 Internal function used for the QuasiContinuum stuff.

Protected Attributes

Atomsatoms
 The atoms we are working on.
GhostAtomsghostatoms
 Non-NULL if atoms are GhostAtoms.
int nAtoms
 The number of (real) atoms.
int nSize
 Number of atoms including ghost atoms.
NeighborListnblist
 The neighborlist object.
EMTParameterProviderprovider
 The source of the EMT parameters.
bool ownProvider
 May we delete the provider?
bool subtractE0
 Whether we subtract E0 from atomic energies (defines the zero of potential energy; if we don't subtract, zero corresponds to infinite seperation.
std::vector< const emt_parameters * > parameters
 The EMT parameters.
const emt_parameterscontinuumelement
 The element in the continuum region.
const TinyDoubleMatrixchi
 The Chi matrix of EMT.
int nelements
 The number of different elements in the simulation.
double rFermi
 Cutoff parameters (from EMTParameterProvider).
double rNbCut
double cutoffslope
 Cutoff slope.
int sigma2isvalid
 For consistency checks.
vector< vector< double > > sigma1
 Temporary data for the atoms.
vector< vector< double > > sigma2
vector< double > Ec
 Each atom has a single Ec, Eas, radius etc.
vector< double > Eas
vector< double > potentialenergy
vector< double > radius
vector< double > dEds
vector< Vecforce
vector< double > stress
 The stresses. Always remember to use six per atoms!
int nAtomsRes
int nSizeRes
 If there are ghostatoms, some extra space is reserved for the arrays.
vector< int > id
 The atomic numbers are translated into IDs, integers in [0, nelements-1].
double unnormalizedstress [6]
 The total stress before division by volume.
double totalvolume
 Total volume during stresscalculation.
int nHalfNeighbors
 For the quasicontinuum stuff.
int(* coef )[6]
 For the quasicontinuum stuff.
double dataSigma1
 For the quasicontinuum stuff.
struct { 
   int   ids 
   int   nblist 
   int   sigma1 
   int   sigma2 
   int   beforeforces 
   int   energies 
   int   forces 
   int   stresses 
   int   fullstresses 
counters
 A structure of counters to check if recalculations are necessary.

Private Member Functions

void sigma_batch (int *self, int *other, Vec rnb[], double *sq_dist, int zs, int zo, int n, int calculatesigma2)
 sigma_batch does the hard work in CalculateSigmas().
void force_batch (int *self, int *other, Vec rnb[], double *sq_dist, double dEdss[], double dEdso[], int zs, int zo, int n, Vec *force, double(*stress)[6])
 force_batch does the hard work in CalculateForcesAfterEnergy().

Detailed Description

The Effective Medium Theory (EMT) potential.

The Effective Medium Theory (EMT) as originally implemented in Per Stoltze's ARTwork program, and documented in

  • K. W. Jacobsen, P. Stoltze and J. K. Nørskov, Surf. Sci. vol. 366, p. 394-402 (1996).

Definition at line 24 of file EMT.h.

Constructor & Destructor Documentation

◆ EMT()

EMT::EMT ( EMTParameterProvider * prov = 0)

Create an EMT potential optionally using a parameter provider.

◆ ~EMT()

virtual EMT::~EMT ( )
virtual

Delete the EMT potential.

Member Function Documentation

◆ Allocate()

virtual void EMT::Allocate ( )
protectedvirtual

(Re)allocate storage for forces, energies and intermediate results.

◆ AllocateStress()

virtual void EMT::AllocateStress ( )
protectedvirtual

(Re)allocate storage for stresses

◆ CalculateDerivatives()

virtual void EMT::CalculateDerivatives ( const Vec a[3],
double dEdaDota[6] )
virtual

Calculate derivative of the energy of an atom in a regular lattice.

Used by the QuasiContinuum method.

Reimplemented from AsapPotential.

◆ CalculateEnergiesAfterSigmas()

virtual void EMT::CalculateEnergiesAfterSigmas ( double * Epot = 0)
protectedvirtual

Calculate energies once sigma1 is known.

If Epot is NULL, energies are not calculated, only derivatives needed for the force.

◆ CalculateForcesAfterEnergies()

virtual void EMT::CalculateForcesAfterEnergies ( Vec * forces,
double stress[][6] = 0 )
protectedvirtual

Calculate forces in a multicomponent system.

◆ CalculateForcesAfterEnergiesSingle()

virtual void EMT::CalculateForcesAfterEnergiesSingle ( Vec * forces,
double stress[][6] = 0 )
protectedvirtual

Calculate forces in a system with only one element.

◆ CalculateIDs()

virtual void EMT::CalculateIDs ( )
protectedvirtual

Calculate type numbers from the atomic numbers.

◆ CalculateLatticeEnergy()

virtual double EMT::CalculateLatticeEnergy ( const Vec a[3])
virtual

Calculate the energy of an atom in a regular fcc(?) lattice.

Given the lattice vectors, this function calculates the energy of a single atom in the lattice. Used for the QuasiContinuum method.

Reimplemented from AsapPotential.

◆ CalculateSigmas()

virtual void EMT::CalculateSigmas ( int calculatesigma2 = 1)
protectedvirtual

Calculate sigma1 and perhaps sigma2.

◆ CalculateStuff()

virtual void EMT::CalculateStuff ( const Vec a[3],
double & sigma1,
double & sigma2,
double * diffs2,
double * wght,
double * dsigma1,
double * dsigma2 )
protectedvirtual

Internal function used for the QuasiContinuum stuff.

◆ CheckNeighborLists()

virtual void EMT::CheckNeighborLists ( )
virtual

Check that neighbor lists are up to date, update them if not.

Implements AsapPotential.

◆ force_batch()

void EMT::force_batch ( int * self,
int * other,
Vec rnb[],
double * sq_dist,
double dEdss[],
double dEdso[],
int zs,
int zo,
int n,
Vec * force,
double(*) stress[6] )
private

force_batch does the hard work in CalculateForcesAfterEnergy().

Not virtual, do not reimplement without reimplementing CalculateForcesAfterEnergy().

◆ GetCartesianForces()

virtual const Vec * EMT::GetCartesianForces ( )
virtual

Calculate the forces on all atoms and return the result.

Implements AsapPotential.

◆ GetCutoffRadius()

virtual double EMT::GetCutoffRadius ( ) const
inlinevirtual

Return the cutoff radius used in the potential.

Implements AsapPotential.

Definition at line 42 of file EMT.h.

42{ return rNbCut; }
double rNbCut
Definition EMT.h:135

◆ GetData()

virtual double EMT::GetData ( ) const
inlinevirtual

Get data used by the QuasiContinuum method.

Reimplemented from AsapPotential.

Definition at line 54 of file EMT.h.

54{ return dataSigma1; }
double dataSigma1
For the quasicontinuum stuff.
Definition EMT.h:178

◆ GetLatticeConstant()

virtual double EMT::GetLatticeConstant ( ) const
virtual

Return the lattice constant of the material, if well-defined.

If a lattice constant of the material can be defined, return it in Angstrom, otherwise throw an exception.

Implements AsapPotential.

◆ GetNeighborList()

NeighborList * EMT::GetNeighborList ( ) const
inline

Return a pointer to the neighbor list.

Definition at line 65 of file EMT.h.

65{ return nblist; }
NeighborList * nblist
The neighborlist object.
Definition EMT.h:120

◆ GetNumberOfAtoms()

virtual int EMT::GetNumberOfAtoms ( ) const
inlinevirtual

Get the number of atoms.

Implements AsapPotential.

Definition at line 44 of file EMT.h.

44{ return nAtoms; }
int nAtoms
The number of (real) atoms.
Definition EMT.h:118

◆ GetPotentialEnergies()

virtual const double * EMT::GetPotentialEnergies ( )
virtual

Calculate the energy of all atoms.

Implements AsapPotential.

◆ GetPotentialEnergy()

virtual double EMT::GetPotentialEnergy ( )
virtual

Calculate the total energy of the system.

Implements AsapPotential.

◆ GetSigma1()

const double * EMT::GetSigma1 ( int n)
inline

Return a pointer to the EMT "density" sigma1.

Definition at line 57 of file EMT.h.

57{ return &sigma1[n][0]; }
vector< vector< double > > sigma1
Temporary data for the atoms.
Definition EMT.h:145

◆ GetSigma2()

const double * EMT::GetSigma2 ( int n)
inline

Return a pointer to the EMT "density" sigma2.

Definition at line 59 of file EMT.h.

59{ return &sigma2[n][0]; }
vector< vector< double > > sigma2
Definition EMT.h:146

◆ GetStress()

virtual void EMT::GetStress ( double stress[6],
const Vec * momenta = 0 )
virtual

Calculate the total stress of the system.

Note that the output variable stress is not zeroed first. In quasicontinuum simulations and other situations where there is a contribution to the stress which is not from the atoms, the stress parameter can initially be set to the appropriate derivatives of the energy of that part of the calculation (without the volume normalization, which will be performed by the potential).

Implements AsapPotential.

◆ GetStresses()

virtual const symTensor * EMT::GetStresses ( const Vec * momenta = 0)
virtual

Calculate the stress on all atoms.

Implements AsapPotential.

◆ InitParameters()

virtual void EMT::InitParameters ( )
protectedvirtual

Initialization of the EMT parameters.

◆ PrintParameters()

void EMT::PrintParameters ( )

Print the EMT parameters.

◆ SetAtoms()

virtual void EMT::SetAtoms ( Atoms * a)
virtual

Set the atoms belonging to this potential.

This is called automatically by Atoms.SetCalculator() and should not be called elsewhere.

Implements AsapPotential.

◆ SetContinuumElement()

virtual void EMT::SetContinuumElement ( int z)
virtual

Specify the element in the continuum region of a QuasiContinuum simulation.

◆ SetSubtractE0()

void EMT::SetSubtractE0 ( bool subtractE0)
inline

Definition at line 31 of file EMT.h.

31{ this->subtractE0 = subtractE0; }
bool subtractE0
Whether we subtract E0 from atomic energies (defines the zero of potential energy; if we don't subtra...
Definition EMT.h:124

◆ sigma_batch()

void EMT::sigma_batch ( int * self,
int * other,
Vec rnb[],
double * sq_dist,
int zs,
int zo,
int n,
int calculatesigma2 )
private

sigma_batch does the hard work in CalculateSigmas().

Not virtual, do not reimplement without reimplementing CalculateSigmas().

◆ UpdateSuperCell()

virtual void EMT::UpdateSuperCell ( const SuperCell * newSuperCell)
virtual

Tell the Potential that a new SuperCell has been assigned to the atoms.

Implements AsapPotential.

Member Data Documentation

◆ atoms

Atoms* EMT::atoms
protected

The atoms we are working on.

Definition at line 116 of file EMT.h.

◆ beforeforces

int EMT::beforeforces

Definition at line 186 of file EMT.h.

◆ chi

const TinyDoubleMatrix* EMT::chi
protected

The Chi matrix of EMT.

Definition at line 132 of file EMT.h.

◆ coef

int(* EMT::coef)[6]
protected

For the quasicontinuum stuff.

Definition at line 177 of file EMT.h.

◆ continuumelement

const emt_parameters* EMT::continuumelement
protected

The element in the continuum region.

Definition at line 130 of file EMT.h.

◆ [struct]

struct { ... } EMT::counters

A structure of counters to check if recalculations are necessary.

◆ cutoffslope

double EMT::cutoffslope
protected

Cutoff slope.

Definition at line 137 of file EMT.h.

◆ dataSigma1

double EMT::dataSigma1
protected

For the quasicontinuum stuff.

Definition at line 178 of file EMT.h.

◆ dEds

vector<double> EMT::dEds
protected

Definition at line 154 of file EMT.h.

◆ Eas

vector<double> EMT::Eas
protected

Definition at line 151 of file EMT.h.

◆ Ec

vector<double> EMT::Ec
protected

Each atom has a single Ec, Eas, radius etc.

Definition at line 150 of file EMT.h.

◆ energies

int EMT::energies

Definition at line 187 of file EMT.h.

◆ force

vector<Vec> EMT::force
protected

Definition at line 155 of file EMT.h.

◆ forces

int EMT::forces

Definition at line 188 of file EMT.h.

◆ fullstresses

int EMT::fullstresses

Definition at line 190 of file EMT.h.

◆ ghostatoms

GhostAtoms* EMT::ghostatoms
protected

Non-NULL if atoms are GhostAtoms.

Definition at line 117 of file EMT.h.

◆ id

vector<int> EMT::id
protected

The atomic numbers are translated into IDs, integers in [0, nelements-1].

Definition at line 167 of file EMT.h.

◆ ids

int EMT::ids

Definition at line 182 of file EMT.h.

◆ nAtoms

int EMT::nAtoms
protected

The number of (real) atoms.

Definition at line 118 of file EMT.h.

◆ nAtomsRes

int EMT::nAtomsRes
protected

Definition at line 163 of file EMT.h.

◆ nblist [1/2]

int EMT::nblist

Definition at line 183 of file EMT.h.

◆ nblist [2/2]

NeighborList* EMT::nblist
protected

The neighborlist object.

Definition at line 120 of file EMT.h.

◆ nelements

int EMT::nelements
protected

The number of different elements in the simulation.

Definition at line 133 of file EMT.h.

◆ nHalfNeighbors

int EMT::nHalfNeighbors
protected

For the quasicontinuum stuff.

Definition at line 176 of file EMT.h.

◆ nSize

int EMT::nSize
protected

Number of atoms including ghost atoms.

Definition at line 119 of file EMT.h.

◆ nSizeRes

int EMT::nSizeRes
protected

If there are ghostatoms, some extra space is reserved for the arrays.

Definition at line 163 of file EMT.h.

◆ ownProvider

bool EMT::ownProvider
protected

May we delete the provider?

Definition at line 122 of file EMT.h.

◆ parameters

std::vector<const emt_parameters *> EMT::parameters
protected

The EMT parameters.

Definition at line 129 of file EMT.h.

◆ potentialenergy

vector<double> EMT::potentialenergy
protected

Definition at line 152 of file EMT.h.

◆ provider

EMTParameterProvider* EMT::provider
protected

The source of the EMT parameters.

Definition at line 121 of file EMT.h.

◆ radius

vector<double> EMT::radius
protected

Definition at line 153 of file EMT.h.

◆ rFermi

double EMT::rFermi
protected

Cutoff parameters (from EMTParameterProvider).

Definition at line 135 of file EMT.h.

◆ rNbCut

double EMT::rNbCut
protected

Definition at line 135 of file EMT.h.

◆ sigma1 [1/2]

int EMT::sigma1

Definition at line 184 of file EMT.h.

◆ sigma1 [2/2]

vector<vector<double> > EMT::sigma1
protected

Temporary data for the atoms.

Each atom has two sigmas for each possible neighboring element. So these are arrays (nelements long).

Definition at line 145 of file EMT.h.

◆ sigma2 [1/2]

int EMT::sigma2

Definition at line 185 of file EMT.h.

◆ sigma2 [2/2]

vector<vector<double> > EMT::sigma2
protected

Definition at line 146 of file EMT.h.

◆ sigma2isvalid

int EMT::sigma2isvalid
protected

For consistency checks.

Definition at line 139 of file EMT.h.

◆ stress

vector<double> EMT::stress
protected

The stresses. Always remember to use six per atoms!

Should really be declared as vector<double[6]>, but that breaks the vector library when attempting to resize!

Definition at line 160 of file EMT.h.

◆ stresses

int EMT::stresses

Definition at line 189 of file EMT.h.

◆ subtractE0

bool EMT::subtractE0
protected

Whether we subtract E0 from atomic energies (defines the zero of potential energy; if we don't subtract, zero corresponds to infinite seperation.

If we do, it is the bulk fcc crystal at the equilibrium lattice constant.)

Definition at line 124 of file EMT.h.

◆ totalvolume

double EMT::totalvolume
protected

Total volume during stresscalculation.

Definition at line 174 of file EMT.h.

◆ unnormalizedstress

double EMT::unnormalizedstress[6]
protected

The total stress before division by volume.

Definition at line 173 of file EMT.h.


The documentation for this class was generated from the following file:
  • /home/runner/work/eOn/eOn/include/eon/potentials/EMT/Asap/EMT.h