1 |
#ifndef _BASELATTICE_H_ |
2 |
#define _BASELATTICE_H_ |
3 |
|
4 |
#include <vector> |
5 |
#include "math/Vector3.hpp" |
6 |
|
7 |
|
8 |
|
9 |
class BaseLattice{ |
10 |
protected: |
11 |
BaseLattice(){ |
12 |
Vector3d zeroVector3d(0.0, 0.0, 0.0); |
13 |
|
14 |
setOrigin(zeroVector3d); |
15 |
} |
16 |
|
17 |
public: |
18 |
|
19 |
//virtual destructor of BaseLattice |
20 |
virtual ~BaseLattice() {} |
21 |
|
22 |
//get lattice type |
23 |
virtual const std::string getLatticeType() = 0; |
24 |
|
25 |
int getNumSitesPerCell() {return nCellSites;} |
26 |
|
27 |
void getLatticePointsPos(vector<Vector3d>& latticePos, int nx, int ny, int nz); |
28 |
|
29 |
std::vector<Vector3d> getLatticePointsOrt() {return cellSitesOrt;} |
30 |
|
31 |
//get lattice constant of unit cell |
32 |
virtual std::vector<double> getLatticeConstant() =0; |
33 |
|
34 |
//set lattice constant of unit cell |
35 |
virtual void setLatticeConstant(const std::vector<double>& lc)=0; |
36 |
|
37 |
//get origin of unit cell |
38 |
Vector3d getOrigin( ) {return origin;} |
39 |
|
40 |
//set origin of unit cell |
41 |
void setOrigin(const Vector3d& newOrigin){ |
42 |
this->origin = newOrigin; |
43 |
} |
44 |
|
45 |
protected: |
46 |
virtual void update() =0; |
47 |
|
48 |
int nCellSites; |
49 |
Vector3d origin; |
50 |
std::vector<Vector3d> cellSitesPos; |
51 |
std::vector<Vector3d> cellSitesOrt; |
52 |
Vector3d cellLen; |
53 |
}; |
54 |
|
55 |
|
56 |
#endif |