35 |
|
* |
36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
< |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 |
|
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
< |
* [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). * |
40 |
> |
* [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
> |
*/ |
42 |
> |
|
43 |
> |
/* |
44 |
|
* Created by Kelsey M. Stocker on 2/9/12. |
45 |
|
* @author Kelsey M. Stocker |
46 |
|
* @version $Id: shapedLatticeRod.cpp 1665 2011-11-22 20:38:56Z gezelter $ |
56 |
|
|
57 |
|
shapedLatticeRod::shapedLatticeRod(RealType latticeConstant, |
58 |
|
std::string latticeType, |
59 |
< |
RealType radius, RealType length) : shapedLattice(latticeConstant, latticeType){ |
59 |
> |
RealType radius, |
60 |
> |
RealType length) : shapedLattice(latticeConstant, latticeType){ |
61 |
|
|
62 |
|
rodRadius_= radius; |
63 |
|
rodLength_= length; |
60 |
– |
|
64 |
|
Vector3d dimension; |
65 |
|
dimension[0] = 3.0*radius; |
66 |
|
dimension[1] = 3.0*radius; |
67 |
|
dimension[2] = length + 3.0*radius; |
65 |
– |
cerr << "using dimension = " << dimension << "\n"; |
68 |
|
setGridDimension(dimension); |
67 |
– |
cerr << "done!\n"; |
69 |
|
Vector3d origin; |
70 |
|
origin[0] = 0; |
71 |
|
origin[1] = 0; |
73 |
|
setOrigin(origin); |
74 |
|
} |
75 |
|
|
75 |
– |
|
76 |
|
/** |
77 |
< |
* Determines whether a point lies within a spherically-capped nanorod at origin (0,0,0) |
77 |
> |
* Determines whether a point lies within a spherically-capped |
78 |
> |
* nanorod at origin (0,0,0) |
79 |
|
* |
80 |
|
*/ |
80 |
– |
|
81 |
|
bool shapedLatticeRod::isInterior(Vector3d point){ |
82 |
|
|
83 |
< |
RealType x, y, z, distance, delta_z; |
83 |
> |
RealType x, y, z, distance; |
84 |
|
|
85 |
|
distance = 0; |
86 |
|
|
87 |
|
x = point[0]; |
88 |
|
y = point[1]; |
89 |
|
z = point[2]; |
90 |
– |
// std::cerr << "Testing xyz = " << point << " \n"; |
90 |
|
|
91 |
|
if ( abs(z) >= rodLength_/2.0 ) { |
92 |
< |
delta_z = abs(z) - rodLength_/2.0; |
92 |
> |
RealType delta_z = abs(z) - rodLength_/2.0; |
93 |
|
distance = sqrt((x*x) + (y*y) + (delta_z*delta_z)); |
95 |
– |
// std::cerr << "abs_end " ; |
94 |
|
} else { |
95 |
|
distance = sqrt((x*x) + (y*y)); |
98 |
– |
// std::cerr << "middle "; |
96 |
|
} |
97 |
|
|
98 |
|
bool isIT=false; |
99 |
|
if ( distance <= rodRadius_ ) { |
103 |
– |
// cerr << "accepted!\n"; |
100 |
|
isIT=true; |
105 |
– |
} else { |
106 |
– |
// cerr << "rejected!\n"; |
101 |
|
} |
102 |
|
return isIT; |
103 |
|
} |