-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCont.hpp
More file actions
79 lines (62 loc) · 1.27 KB
/
Copy pathCont.hpp
File metadata and controls
79 lines (62 loc) · 1.27 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef _Cont_
#define _Cont_
#include "Part.hpp"
#include <iostream>
/* Class Cont
* A cubic container of particles with volume
* equal to side^3.
* Center in (0,0,0).
* Periodic Boundary condition.
* Based on Lennard-Jones energy and
* Verlet time steps.
*/
class Cont {
private:
int n;
double side;
Part * part; //particle array
double potentialEnergy;
public:
/***
* Constructors and destructor
*/
Cont(double side, int part_count);
~Cont();
/***
* Getters and Setters
*/
int getN() const;
double getSide() const;
Part& getParticle(int i) const;
double getPotentialEnergy() const;
double getKineticEnergy() const;
void setParticle(Part p, int i) const;
/***
* Other Methods
*/
void lennard_jones();
void nextPositionStep(double tau);
void nextVelocityStep(double tau);
void periodicBoundaryCondition();
Cont & operator =(const Cont &);
friend std::ostream & operator <<(std::ostream &,const Cont &);
};
/***
* Inline Methods
*/
inline int Cont::getN() const {
return n;
}
inline double Cont::getSide() const{
return side;
}
inline void Cont::setParticle(Part p, int i) const {
part[i] = p;
}
inline Part& Cont::getParticle(int i) const {
return part[i];
}
inline double Cont::getPotentialEnergy() const{
return potentialEnergy;
}
#endif