--- trunk/src/applications/sequentialProps/ContactAngle1.cpp 2014/10/30 18:51:38 2029 +++ trunk/src/applications/sequentialProps/ContactAngle1.cpp 2015/03/07 21:41:51 2071 @@ -54,9 +54,9 @@ namespace OpenMD { ContactAngle1::ContactAngle1(SimInfo* info, const std::string& filename, const std::string& sele, RealType solidZ, RealType dropletRadius) - : SequentialAnalyzer(info, filename), selectionScript_(sele), - evaluator_(info), seleMan_(info), solidZ_(solidZ), - dropletRadius_(dropletRadius) { + : SequentialAnalyzer(info, filename), solidZ_(solidZ), + dropletRadius_(dropletRadius), selectionScript_(sele), + seleMan_(info), evaluator_(info) { setOutputName(getPrefix(filename) + ".ca1"); @@ -121,17 +121,23 @@ namespace OpenMD { vector realRoots = poly.FindRealRoots(); RealType ct; - std::cerr << "nRealRoots = " << realRoots.size() << "\n"; vector::iterator ri; - vector > rps; + + + RealType maxct = -1.0; for (ri = realRoots.begin(); ri !=realRoots.end(); ++ri) { ct = *ri; if (ct > 1.0) ct = 1.0; if (ct < -1.0) ct = -1.0; + + // use the largest magnitude of ct that it finds: + if (ct > maxct) { + maxct = ct; + } } - values_.push_back( acos(ct)*(180.0/M_PI) ); + values_.push_back( acos(maxct)*(180.0/M_PI) ); } } }