| 4 |
|
#include "simError.h" |
| 5 |
|
|
| 6 |
|
|
| 7 |
< |
Lattice::Lattice(int latticeType, double latticeSpacing){ |
| 7 |
> |
Lattice::Lattice(int latticeType, double latticeParameter){ |
| 8 |
|
int hasError; |
| 9 |
|
|
| 10 |
|
latticePosX = NULL; |
| 15 |
|
switch(latticeType){ |
| 16 |
|
|
| 17 |
|
case FCC_LATTICE_TYPE: |
| 18 |
< |
hasError = createFccLattice(latticeSpacing); |
| 18 |
> |
hasError = createFccLattice(latticeParameter); |
| 19 |
|
break; |
| 20 |
|
|
| 21 |
|
case BCC_LATTICE_TYPE: |
| 22 |
< |
hasError = createBccLattice(latticeSpacing); |
| 22 |
> |
hasError = createBccLattice(latticeParameter); |
| 23 |
|
break; |
| 24 |
|
|
| 25 |
|
case HCP_LATTICE_TYPE: |
| 26 |
< |
hasError = createHcpLattice(latticeSpacing); |
| 26 |
> |
hasError = createHcpLattice(latticeParameter); |
| 27 |
|
break; |
| 28 |
|
|
| 29 |
|
case HCPWATER_LATTICE_TYPE: |
| 30 |
< |
hasError = createHcpWaterLattice(latticeSpacing); |
| 30 |
> |
hasError = createHcpWaterLattice(latticeParameter); |
| 31 |
|
break; |
| 32 |
|
|
| 33 |
|
default: |
| 34 |
< |
//simerror here..... |
| 35 |
< |
|
| 36 |
< |
latticePosX = new double[nCellSites]; |
| 37 |
< |
latticePosY = new double[nCellSites]; |
| 38 |
< |
latticePosZ = new double[nCellSites]; |
| 34 |
> |
//simerror here..... |
| 35 |
> |
; |
| 36 |
|
} |
| 37 |
+ |
|
| 38 |
+ |
latticePosX = new double[nCellSites]; |
| 39 |
+ |
latticePosY = new double[nCellSites]; |
| 40 |
+ |
latticePosZ = new double[nCellSites]; |
| 41 |
+ |
|
| 42 |
|
return; |
| 43 |
|
} |
| 44 |
|
|
| 50 |
|
} |
| 51 |
|
|
| 52 |
|
|
| 53 |
< |
int Lattice::createFccLattice(double latticeSpacing){ |
| 53 |
> |
int Lattice::createFccLattice(double latticeParameter){ |
| 54 |
|
double cell2; |
| 55 |
|
double rroot3; |
| 56 |
|
|
| 57 |
< |
cell2 = 0.5 * latticeSpacing; |
| 57 |
> |
cellLength = latticeParameter; |
| 58 |
> |
|
| 59 |
> |
cell2 = 0.5 * latticeParameter; |
| 60 |
|
rroot3 = 1.0 / sqrt(3.0); |
| 61 |
|
|
| 62 |
|
nCellSites = 4; |
| 106 |
|
|
| 107 |
|
|
| 108 |
|
// Body centered cubic lattice |
| 109 |
< |
int Lattice::createBccLattice(double latticeSpacing){ |
| 109 |
> |
int Lattice::createBccLattice(double latticeParameter){ |
| 110 |
|
return 0; |
| 111 |
|
} |
| 112 |
|
|
| 113 |
|
|
| 114 |
|
// Standard HCP lattice |
| 115 |
< |
int Lattice::createHcpLattice(double latticeSpacing){ |
| 115 |
> |
int Lattice::createHcpLattice(double latticeParameter){ |
| 116 |
|
return 0; |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
// HCP contains tetrahedral sites for waters |
| 120 |
< |
int Lattice::createHcpWaterLattice(double latticeSpacing){ |
| 120 |
> |
int Lattice::createHcpWaterLattice(double latticeParameter){ |
| 121 |
> |
|
| 122 |
> |
return 0; |
| 123 |
> |
|
| 124 |
|
double rroot3; |
| 125 |
|
double cell; |
| 126 |
|
double cell2; |
| 142 |
|
thisUnitCell.s_ez = new double[nCellSites]; |
| 143 |
|
|
| 144 |
|
rroot3 = 1.0 / sqrt(3.0); |
| 145 |
< |
cell = latticeSpacing; |
| 145 |
> |
cell = latticeParameter; |
| 146 |
|
cell2 = 0.5 * cell; |
| 147 |
|
cell4 = 0.25 * cell; |
| 148 |
|
cell16 = cell / 6.0; |
| 256 |
|
|
| 257 |
|
//Returns lattice points when called repeatedly |
| 258 |
|
int Lattice::getLatticePoints(double** thePosX, double** thePosY, |
| 259 |
< |
double** thePosZ, |
| 260 |
< |
int ix, int iy, int iz){ |
| 259 |
> |
double** thePosZ, |
| 260 |
> |
int ix, int iy, int iz){ |
| 261 |
|
|
| 262 |
|
int iref; |
| 263 |
|
|