1 |
#ifndef __NANOBUILDER_H__ |
2 |
#define __NANOBUILDER_H__ |
3 |
|
4 |
#define DEFAULT 1 |
5 |
#define BUILD_CORE_SHELL 2 |
6 |
#define BUILD_CORE_SHELL_VACANCY 3 |
7 |
#define BUILD_RANDOM_PARTICLE 4 |
8 |
#define BUILD_NMOL_PARTICLE 5 |
9 |
|
10 |
|
11 |
namespace IHATECPP{ |
12 |
struct Mols |
13 |
{ |
14 |
double pos[3]; // Center of Molecule position |
15 |
MoleculeStamp* myStamp; |
16 |
int isCore; |
17 |
int isShell; |
18 |
int isVacancy; |
19 |
}; |
20 |
} |
21 |
|
22 |
|
23 |
|
24 |
// returns 1 if successful, 0 otherwise |
25 |
class nanoBuilder{ |
26 |
|
27 |
public: |
28 |
nanoBuilder(int thisIsRandom, int thisHasVacancies,int thisLatticeType, |
29 |
double thisParticleRadius, double thisCoreRadius, |
30 |
double thisVacancyFraction,double thisVacancyRadius, |
31 |
double thisLatticeSpacing, |
32 |
double solute_x, int &hasError); |
33 |
~nanoBuilder(); |
34 |
|
35 |
int buildNanoParticle(void); |
36 |
|
37 |
|
38 |
private: |
39 |
|
40 |
//Support Fncs. |
41 |
int sanityCheck( void ); |
42 |
void buildVacancies(void); |
43 |
void orientationMunger(double A[3][3]); |
44 |
void placeRandom(int totalMol); |
45 |
// Builder Fncs |
46 |
void buildWithVacancies(double dist, double pos[3]); |
47 |
void buildRandomlyMixed(double dist, double pos[3]); |
48 |
void buildWithCoreShell(double dist,double pos[3]); |
49 |
void buildNmolParticle(double dist, double pos[3]); |
50 |
|
51 |
//Logicals |
52 |
int isRandom; |
53 |
int hasVacancies; |
54 |
int latticeType; |
55 |
int buildNmol; |
56 |
int buildType; |
57 |
int coreHasOrientation; |
58 |
int shellHasOrientation; |
59 |
|
60 |
// Int values |
61 |
int nVacancies; |
62 |
int nInterface; |
63 |
int nCells; |
64 |
int nMol; |
65 |
int nCoreModelAtoms; // Number of atoms in Core model |
66 |
int nShellModelAtoms; // Number of atoms in Shell model |
67 |
int moleculeCount; |
68 |
int coreAtomCount; // Count number of core atoms in system. |
69 |
int shellAtomCount; // Count number of shell atoms in system. |
70 |
int atomCount; |
71 |
int totalMolecules; // Total number of molecules |
72 |
int nCoreMolecules; // Total number of core molecules. |
73 |
int nShellMolecules; // Total number of shell molecules. |
74 |
int maxModelNatoms; |
75 |
double particleRadius; |
76 |
double coreRadius; |
77 |
double vacancyFraction; |
78 |
double vacancyRadius; |
79 |
double shellRadius; |
80 |
double latticeSpacing; |
81 |
double soluteX; //Mole fraction for randomly mixed nanoparticle. |
82 |
|
83 |
//Vector to store atoms while were building nanoparticle. |
84 |
std::vector<IHATECPP::Mols> moleculeVector; |
85 |
std::vector<int> vacancyInterface; |
86 |
|
87 |
|
88 |
IHATECPP::Mols myMol; |
89 |
|
90 |
MoleculeStamp* coreStamp; |
91 |
MoleculeStamp* shellStamp; |
92 |
|
93 |
|
94 |
|
95 |
|
96 |
}; |
97 |
|
98 |
|
99 |
|
100 |
#endif // __NANOBUILDER_H__ |