-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpotential.h
39 lines (31 loc) · 1.06 KB
/
potential.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _POTENTIAL_H_
#define _POTENTIAL_H_
class Atom;
class Vector3;
class SimulationParams;
/* Base class for potential that will be used in the project
Cannot be instatiated.
*/
class AtomicPotential
{
public:
AtomicPotential() = default;
virtual ~AtomicPotential() = default;
// shall return a Vector3 that indicates by what force the first Atom affects the second
virtual Vector3 interaction(const Atom&, const Atom&, const SimulationParams&);
virtual Vector3 interaction(const Vector3&, const Vector3&, const SimulationParams&) = 0;
virtual double potentialEnergy(const Vector3&, const Vector3&, const SimulationParams&) = 0;
};
class LJPotential : public AtomicPotential
{
public:
LJPotential() = delete;
LJPotential(double eps, double sig)
: epsilon{eps}, sigma{sig} {}
virtual ~LJPotential() = default;
virtual Vector3 interaction(const Vector3&, const Vector3&, const SimulationParams&);
virtual double potentialEnergy(const Vector3&, const Vector3&, const SimulationParams&);
double epsilon; //in eV
double sigma; //in Angstrom
};
#endif