| 54 | 
  | 
namespace oopse { | 
| 55 | 
  | 
 | 
| 56 | 
  | 
  void  Snapshot::setHmat(const Mat3x3d& m) { | 
| 57 | 
– | 
    const double orthoTolerance = NumericConstant::epsilon; | 
| 57 | 
  | 
    hmat_ = m; | 
| 58 | 
  | 
    invHmat_ = hmat_.inverse(); | 
| 59 | 
  | 
     | 
| 60 | 
  | 
    //prepare fortran Hmat  | 
| 61 | 
< | 
    double fortranHmat[9]; | 
| 62 | 
< | 
    double fortranInvHmat[9]; | 
| 61 | 
> | 
    RealType fortranHmat[9]; | 
| 62 | 
> | 
    RealType fortranInvHmat[9]; | 
| 63 | 
  | 
    hmat_.getArray(fortranHmat); | 
| 64 | 
  | 
    invHmat_.getArray(fortranInvHmat); | 
| 65 | 
  | 
 | 
| 66 | 
  | 
    //determine whether the box is orthoTolerance or not | 
| 67 | 
  | 
    int oldOrthoRhombic = orthoRhombic_; | 
| 68 | 
  | 
     | 
| 69 | 
< | 
    double smallDiag = fabs(hmat_(0, 0)); | 
| 69 | 
> | 
    RealType smallDiag = fabs(hmat_(0, 0)); | 
| 70 | 
  | 
    if(smallDiag > fabs(hmat_(1, 1))) smallDiag = fabs(hmat_(1, 1)); | 
| 71 | 
  | 
    if(smallDiag > fabs(hmat_(2, 2))) smallDiag = fabs(hmat_(2, 2));     | 
| 72 | 
< | 
    double tol = smallDiag * orthoTolerance; | 
| 72 | 
> | 
    RealType tol = smallDiag * orthoTolerance_; | 
| 73 | 
  | 
 | 
| 74 | 
  | 
    orthoRhombic_ = 1; | 
| 75 | 
  | 
 | 
| 90 | 
  | 
        sprintf( painCave.errMsg, | 
| 91 | 
  | 
                 "OOPSE is switching from the default Non-Orthorhombic\n" | 
| 92 | 
  | 
                 "\tto the faster Orthorhombic periodic boundary computations.\n" | 
| 93 | 
< | 
                 "\tThis is usually a good thing, but if you wan't the\n" | 
| 93 | 
> | 
                 "\tThis is usually a good thing, but if you want the\n" | 
| 94 | 
  | 
                 "\tNon-Orthorhombic computations, make the orthoBoxTolerance\n" | 
| 95 | 
  | 
                 "\tvariable ( currently set to %G ) smaller.\n", | 
| 96 | 
< | 
                 orthoTolerance); | 
| 96 | 
> | 
                 orthoTolerance_); | 
| 97 | 
  | 
        painCave.severity = OOPSE_INFO; | 
| 98 | 
  | 
        simError(); | 
| 99 | 
  | 
      } | 
| 102 | 
  | 
                 "OOPSE is switching from the faster Orthorhombic to the more\n" | 
| 103 | 
  | 
                 "\tflexible Non-Orthorhombic periodic boundary computations.\n" | 
| 104 | 
  | 
                 "\tThis is usually because the box has deformed under\n" | 
| 105 | 
< | 
                 "\tNPTf integration. If you wan't to live on the edge with\n" | 
| 105 | 
> | 
                 "\tNPTf integration. If you want to live on the edge with\n" | 
| 106 | 
  | 
                 "\tthe Orthorhombic computations, make the orthoBoxTolerance\n" | 
| 107 | 
  | 
                 "\tvariable ( currently set to %G ) larger.\n", | 
| 108 | 
< | 
                 orthoTolerance); | 
| 108 | 
> | 
                 orthoTolerance_); | 
| 109 | 
  | 
        painCave.severity = OOPSE_WARNING; | 
| 110 | 
  | 
        simError(); | 
| 111 | 
  | 
      } |