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