--- trunk/src/applications/sequentialProps/ContactAngle2.cpp 2015/03/07 21:41:51 2071 +++ trunk/src/applications/sequentialProps/ContactAngle2.cpp 2015/03/07 22:54:56 2072 @@ -122,11 +122,14 @@ namespace OpenMD { // z is possibly symmetric around 0 z = pos.z(); - std::size_t whichRBin = int(r / dr); - std::size_t whichZBin = int( (zLen/2.0 + z) / dz); + int whichRBin = int(r / dr); + int whichZBin = int( (zLen/2.0 + z) / dz); - if ((whichRBin < nRBins_) && (whichZBin >= 0) && (whichZBin < nZBins_)) - histo[whichRBin][whichZBin] += sd->getMass(); + if ((whichRBin < nRBins_) && (whichZBin >= 0) && (whichZBin < nZBins_)) { + std::size_t i = static_cast(whichRBin); + std::size_t j = static_cast(whichZBin); + histo[i][j] += sd->getMass(); + } }