| 47 | 
  | 
 | 
| 48 | 
  | 
using namespace std; | 
| 49 | 
  | 
namespace OpenMD { | 
| 50 | 
< | 
   | 
| 50 | 
> | 
 | 
| 51 | 
> | 
  /// Calculates the contact angle of a droplet with a surface | 
| 52 | 
> | 
  /// using a spherical cap approximation for the droplet. | 
| 53 | 
> | 
 | 
| 54 | 
> | 
  /**  The position of the spherical cap relative to the surface plane | 
| 55 | 
> | 
       is determined by the center-of-mass position of the selection, | 
| 56 | 
> | 
       and this method assumes a uniform density in the droplet.  The | 
| 57 | 
> | 
       angle of intersection between the surface of the spherical cap | 
| 58 | 
> | 
       and the plane defines the contact angle, which is related to | 
| 59 | 
> | 
       the center of mass height by: | 
| 60 | 
> | 
 | 
| 61 | 
> | 
       \f$ z_\mathrm{cm} = (2)^{-4/3} R_0 \left( | 
| 62 | 
> | 
       \frac{1-\cos\theta}{2+\cos\theta}\right)^{1/3) | 
| 63 | 
> | 
       \frac{3+\cos\theta}{2+\cos\theta} \f$ | 
| 64 | 
> | 
 | 
| 65 | 
> | 
       where \f$z_\mathrm{cm}\f$ is measured relative to the planar | 
| 66 | 
> | 
       surface, and \f$R_0\f$ is the radius of the free spherical | 
| 67 | 
> | 
       droplet. | 
| 68 | 
> | 
 | 
| 69 | 
> | 
       This method was first proposed in: | 
| 70 | 
> | 
 | 
| 71 | 
> | 
       J. Hautman and M.L. Klein, Phys. Rev. Lett. 67(13), 1763 (1991). | 
| 72 | 
> | 
       DOI: 10.1103/PhysRevLett.67.1763 | 
| 73 | 
> | 
 | 
| 74 | 
> | 
       This Analyzer requires statement of the reference height of the | 
| 75 | 
> | 
       solid surface, solidZ, and \f$R_0\f$, the dropletRadius. | 
| 76 | 
> | 
  | 
| 77 | 
> | 
  */  | 
| 78 | 
  | 
  class ContactAngle1 : public SequentialAnalyzer{ | 
| 79 | 
  | 
  public: | 
| 80 | 
  | 
    ContactAngle1(SimInfo* info, const std::string& filename,  |