Loading...
Searching...
No Matches
Potential.h
Go to the documentation of this file.
1// Emacs: this is -*- C++ -*-
2
3#ifndef ASAP_POTENTIAL_H
4#define ASAP_POTENTIAL_H
5
6#include "Exception.h"
7#include <assert.h>
8
9class Atoms;
10class Vec;
11class SuperCell;
12
13typedef double symTensor[6];
14
16
30public:
31 virtual ~AsapPotential() {}
32
34
38 virtual void SetAtoms(Atoms *a) = 0;
39
41 virtual double GetPotentialEnergy() = 0;
42
44 virtual const Vec *GetCartesianForces() = 0;
45
47 virtual const symTensor *GetStresses(const Vec *momenta = 0) = 0;
48
50
58 virtual void GetStress(double stress[6], const Vec *momenta = 0) = 0;
59
61 virtual const double *GetPotentialEnergies() = 0;
62
63 virtual void CheckNeighborLists() = 0;
65
68 virtual double CalculateLatticeEnergy(const Vec a[3]) {
69 throw Exception("The QC method is not implemented for this potential");
70 return 0.0;
71 }
72
74
77 virtual void CalculateDerivatives(const Vec a[3], double dEdaDota[6]) {
78 throw Exception("The QC method is not implemented for this potential");
79 }
80
82 virtual double GetData() const {
83 throw Exception("GetData() not implemented.");
84 return 0.0;
85 }
86
88 virtual double GetCutoffRadius() const = 0;
89
91
94 virtual double GetLatticeConstant() const = 0;
95
97 virtual void UpdateSuperCell(const SuperCell *newSuperCell) = 0;
98
100 virtual int GetNumberOfAtoms() const = 0;
101};
102
103#endif // POTENTIAL_H
Abstract base class of all potentials.
Definition Potential.h:29
virtual double CalculateLatticeEnergy(const Vec a[3])
Calculate the energy of an atom in a regular fcc(?) lattice.
Definition Potential.h:68
virtual ~AsapPotential()
Definition Potential.h:31
virtual int GetNumberOfAtoms() const =0
Get the number of atoms.
virtual void CheckNeighborLists()=0
virtual const double * GetPotentialEnergies()=0
Calculate the energy of all atoms.
virtual void CalculateDerivatives(const Vec a[3], double dEdaDota[6])
Calculate derivative of the energy of an atom in a regular lattice.
Definition Potential.h:77
virtual void SetAtoms(Atoms *a)=0
Set the atoms belonging to this potential.
virtual void UpdateSuperCell(const SuperCell *newSuperCell)=0
Tell the Potential that a new SuperCell has been assigned to the atoms.
virtual double GetCutoffRadius() const =0
Return the cutoff radius used in the potential.
virtual double GetData() const
Get data used by the QuasiContinuum method.
Definition Potential.h:82
virtual double GetPotentialEnergy()=0
Calculate the total energy of the system.
virtual double GetLatticeConstant() const =0
Return the lattice constant of the material, if well-defined.
virtual const symTensor * GetStresses(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 Vec * GetCartesianForces()=0
Calculate the forces on all atoms and return the result.
The main list of atoms class.
Definition Atoms.h:36
The SuperCell defines the size, shape and boundary condx of a simulation.
Definition SuperCell.h:20
A 3-vector useful for postions etc.
Definition Vec.h:18
double symTensor[6]
Definition Potential.h:13