| 51 | 
  | 
#include "math/Eigenvalue.hpp" | 
| 52 | 
  | 
 | 
| 53 | 
  | 
namespace OpenMD { | 
| 54 | 
< | 
 | 
| 54 | 
> | 
   | 
| 55 | 
  | 
  ContactAngle2::ContactAngle2(SimInfo* info, const std::string& filename,  | 
| 56 | 
  | 
                               const std::string& sele, RealType solidZ, | 
| 57 | 
< | 
                               RealType threshDens, int nrbins, int nzbins) | 
| 58 | 
< | 
    : SequentialAnalyzer(info, filename), selectionScript_(sele),  | 
| 59 | 
< | 
      evaluator_(info), seleMan_(info), solidZ_(solidZ), | 
| 60 | 
< | 
      threshDens_(threshDens), nRBins_(nrbins), nZBins_(nzbins) { | 
| 61 | 
< | 
 | 
| 57 | 
> | 
                               RealType threshDens, RealType bufferLength, | 
| 58 | 
> | 
                               int nrbins, int nzbins) | 
| 59 | 
> | 
  : SequentialAnalyzer(info, filename), solidZ_(solidZ),  | 
| 60 | 
> | 
    threshDens_(threshDens), bufferLength_(bufferLength), nRBins_(nrbins),  | 
| 61 | 
> | 
    nZBins_(nzbins), selectionScript_(sele), seleMan_(info),  | 
| 62 | 
> | 
    evaluator_(info) { | 
| 63 | 
> | 
     | 
| 64 | 
  | 
    setOutputName(getPrefix(filename) + ".ca2"); | 
| 65 | 
  | 
     | 
| 66 | 
  | 
    evaluator_.loadScriptString(sele); | 
| 122 | 
  | 
      // z is possibly symmetric around 0 | 
| 123 | 
  | 
      z = pos.z(); | 
| 124 | 
  | 
           | 
| 125 | 
< | 
      int whichRBin = int(r / dr); | 
| 126 | 
< | 
      int whichZBin = int( (zLen/2.0 + z) / dz); | 
| 125 | 
> | 
      std::size_t whichRBin = int(r / dr); | 
| 126 | 
> | 
      std::size_t whichZBin = int( (zLen/2.0 + z) / dz); | 
| 127 | 
  | 
       | 
| 128 | 
  | 
      if ((whichRBin < nRBins_) && (whichZBin >= 0) && (whichZBin < nZBins_))  | 
| 129 | 
  | 
        histo[whichRBin][whichZBin] += sd->getMass(); | 
| 156 | 
  | 
      bool foundThresh = false; | 
| 157 | 
  | 
      int rloc = 0; | 
| 158 | 
  | 
       | 
| 159 | 
< | 
      for (unsigned int i = 0; i < nRBins_;  ++i) { | 
| 160 | 
< | 
        RealType ther = dr * (i + 0.5); | 
| 159 | 
> | 
      for (std::size_t i = 0; i < nRBins_;  ++i) { | 
| 160 | 
> | 
 | 
| 161 | 
  | 
        if (histo[i][j] >= threshDens_) aboveThresh = true; | 
| 162 | 
  | 
 | 
| 163 | 
  | 
        if (aboveThresh && (histo[i][j] <= threshDens_)) { | 
| 171 | 
  | 
        Vector<RealType,2> point; | 
| 172 | 
  | 
        point[0] = dr*(rloc+0.5); | 
| 173 | 
  | 
        point[1] = thez; | 
| 174 | 
< | 
        points.push_back( point );        | 
| 174 | 
> | 
 | 
| 175 | 
> | 
        if (thez > bufferLength_) { | 
| 176 | 
> | 
          points.push_back( point ); | 
| 177 | 
> | 
        } | 
| 178 | 
  | 
      }       | 
| 179 | 
  | 
    } | 
| 180 | 
  | 
 | 
| 251 | 
  | 
    center[1] = -((RealType)0.5)*coeff[2]; | 
| 252 | 
  | 
    RealType radius = sqrt(fabs(center[0]*center[0] + center[1]*center[1] | 
| 253 | 
  | 
                                - coeff[0])); | 
| 249 | 
– | 
    RealType ev0 =  fabs(evals[0]); | 
| 254 | 
  | 
 | 
| 255 | 
  | 
    int i1; | 
| 256 | 
  | 
    for (i1 = 0; i1 < 100; ++i1) { | 
| 288 | 
  | 
    if (fabs(zCen) > rDrop) { | 
| 289 | 
  | 
      ca = 180.0; | 
| 290 | 
  | 
    } else { | 
| 291 | 
< | 
     | 
| 288 | 
< | 
      if (zCen >= 0.0) { | 
| 289 | 
< | 
        ca = 90.0 + asin(zCen/rDrop)*(180.0/M_PI); | 
| 290 | 
< | 
      } else { | 
| 291 | 
< | 
        ca = 90 - asin(zCen/rDrop)*(180.0/M_PI); | 
| 292 | 
< | 
      } | 
| 291 | 
> | 
      ca = 90.0 + asin(zCen/rDrop)*(180.0/M_PI); | 
| 292 | 
  | 
    } | 
| 293 | 
  | 
 | 
| 294 | 
  | 
    values_.push_back( ca ); |