| 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; | 
| 122 | < | for (i = tuples_.begin(); i != tuples_.end(); ++i) { | 
| 123 | < | Vector3d zAxis = i->third->getPos() - i->first->getPos(); | 
| 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 | > |  | 
| 125 | > | Vector3d zAxis =   i->third->getPos() - i->first->getPos(); | 
| 126 |  | snapshot->wrapVector(zAxis); | 
| 127 |  | Vector3d v12 =  i->second->getPos() - i->first->getPos(); | 
| 128 |  | snapshot->wrapVector(v12); | 
| 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(); |