| 115 |
|
|
| 116 |
|
} |
| 117 |
|
|
| 118 |
< |
double SCDElem::calcSCD(Snapshot* snapshot) { |
| 118 |
> |
RealType SCDElem::calcSCD(Snapshot* snapshot) { |
| 119 |
|
std::vector<SDTuple3>::iterator i; |
| 120 |
|
Vector3d normal(0.0, 0.0, 1.0); |
| 121 |
< |
double scd = 0.0; |
| 121 |
> |
RealType scd = 0.0; |
| 122 |
|
for (i = tuples_.begin(); i != tuples_.end(); ++i) { |
| 123 |
|
//Egberts B. and Berendsen H.J.C, J.Chem.Phys. 89(6), 3718-3732, 1988 |
| 124 |
|
|
| 132 |
|
xAxis.normalize(); |
| 133 |
|
yAxis.normalize(); |
| 134 |
|
zAxis.normalize(); |
| 135 |
< |
double cosThetaX = dot(xAxis, normal); |
| 136 |
< |
double sxx = 0.5*(3*cosThetaX * cosThetaX - 1.0); |
| 137 |
< |
double cosThetaY = dot(yAxis, normal); |
| 138 |
< |
double syy = 0.5*(3*cosThetaY * cosThetaY - 1.0); |
| 135 |
> |
RealType cosThetaX = dot(xAxis, normal); |
| 136 |
> |
RealType sxx = 0.5*(3*cosThetaX * cosThetaX - 1.0); |
| 137 |
> |
RealType cosThetaY = dot(yAxis, normal); |
| 138 |
> |
RealType syy = 0.5*(3*cosThetaY * cosThetaY - 1.0); |
| 139 |
|
scd += 2.0/3.0*sxx + 1.0/3.0*syy; |
| 140 |
|
} |
| 141 |
|
scd /= tuples_.size(); |