--- trunk/src/applications/staticProps/SCDOrderParameter.cpp 2005/05/27 21:11:24 545 +++ trunk/src/applications/staticProps/SCDOrderParameter.cpp 2006/05/17 21:51:42 963 @@ -115,12 +115,14 @@ SCDElem::SCDElem(SimInfo* info, const std::string& sel } -double SCDElem::calcSCD(Snapshot* snapshot) { +RealType SCDElem::calcSCD(Snapshot* snapshot) { std::vector::iterator i; Vector3d normal(0.0, 0.0, 1.0); - double scd = 0.0; - for (i = tuples_.begin(); i != tuples_.end(); ++i) { - Vector3d zAxis = i->third->getPos() - i->first->getPos(); + RealType scd = 0.0; + for (i = tuples_.begin(); i != tuples_.end(); ++i) { + //Egberts B. and Berendsen H.J.C, J.Chem.Phys. 89(6), 3718-3732, 1988 + + Vector3d zAxis = i->third->getPos() - i->first->getPos(); snapshot->wrapVector(zAxis); Vector3d v12 = i->second->getPos() - i->first->getPos(); snapshot->wrapVector(v12); @@ -130,10 +132,10 @@ double SCDElem::calcSCD(Snapshot* snapshot) { xAxis.normalize(); yAxis.normalize(); zAxis.normalize(); - double cosThetaX = dot(xAxis, normal); - double sxx = 0.5*(3*cosThetaX * cosThetaX - 1.0); - double cosThetaY = dot(yAxis, normal); - double syy = 0.5*(3*cosThetaY * cosThetaY - 1.0); + RealType cosThetaX = dot(xAxis, normal); + RealType sxx = 0.5*(3*cosThetaX * cosThetaX - 1.0); + RealType cosThetaY = dot(yAxis, normal); + RealType syy = 0.5*(3*cosThetaY * cosThetaY - 1.0); scd += 2.0/3.0*sxx + 1.0/3.0*syy; } scd /= tuples_.size();