| 97 | 
  | 
 | 
| 98 | 
  | 
  setFortranBoxSize(FortranHmat, FortranHmatInv, &orthoRhombic); | 
| 99 | 
  | 
  | 
| 100 | 
< | 
  smallestBoxL = boxLx; | 
| 101 | 
< | 
  if (boxLy < smallestBoxL) smallestBoxL = boxLy; | 
| 102 | 
< | 
  if (boxLz < smallestBoxL) smallestBoxL = boxLz; | 
| 100 | 
> | 
  smallestBoxL = boxL[0]; | 
| 101 | 
> | 
  if (boxL[1] < smallestBoxL) smallestBoxL = boxL[1]; | 
| 102 | 
> | 
  if (boxL[2] > smallestBoxL) smallestBoxL = boxL[2]; | 
| 103 | 
  | 
 | 
| 104 | 
  | 
  maxCutoff = smallestBoxL / 2.0; | 
| 105 | 
  | 
 | 
| 109 | 
  | 
             maxCutoff ); | 
| 110 | 
  | 
    painCave.isFatal = 0; | 
| 111 | 
  | 
    simError(); | 
| 112 | 
– | 
 | 
| 112 | 
  | 
    rList = maxCutoff; | 
| 113 | 
  | 
 | 
| 114 | 
< | 
    sprintf( painCave.errMsg, | 
| 115 | 
< | 
             "New Box size is forcing cutoff radius down to %lf\n", | 
| 116 | 
< | 
             maxCutoff - 1.0 ); | 
| 117 | 
< | 
    painCave.isFatal = 0; | 
| 118 | 
< | 
    simError(); | 
| 119 | 
< | 
 | 
| 120 | 
< | 
    rCut = rList - 1.0; | 
| 121 | 
< | 
 | 
| 123 | 
< | 
    // list radius changed so we have to refresh the simulation structure. | 
| 124 | 
< | 
    refreshSim(); | 
| 125 | 
< | 
  } | 
| 126 | 
< | 
 | 
| 127 | 
< | 
  if( ecr > maxCutoff ){ | 
| 128 | 
< | 
 | 
| 129 | 
< | 
    sprintf( painCave.errMsg, | 
| 130 | 
< | 
             "New Box size is forcing electrostatic cutoff radius " | 
| 131 | 
< | 
             "down to %lf\n", | 
| 132 | 
< | 
             maxCutoff ); | 
| 133 | 
< | 
    painCave.isFatal = 0; | 
| 134 | 
< | 
    simError(); | 
| 114 | 
> | 
    if (rCut > (rList - 1.0)) { | 
| 115 | 
> | 
      sprintf( painCave.errMsg, | 
| 116 | 
> | 
               "New Box size is forcing LJ cutoff radius down to %lf\n", | 
| 117 | 
> | 
               rList - 1.0 ); | 
| 118 | 
> | 
      painCave.isFatal = 0; | 
| 119 | 
> | 
      simError(); | 
| 120 | 
> | 
      rCut = rList - 1.0; | 
| 121 | 
> | 
    } | 
| 122 | 
  | 
 | 
| 123 | 
< | 
    ecr = maxCutoff; | 
| 124 | 
< | 
    est = 0.05 * ecr; | 
| 123 | 
> | 
    if( ecr > (rList - 1.0) ){ | 
| 124 | 
> | 
      sprintf( painCave.errMsg, | 
| 125 | 
> | 
               "New Box size is forcing electrostaticCutoffRadius " | 
| 126 | 
> | 
               "down to %lf\n" | 
| 127 | 
> | 
               "electrostaticSkinThickness is now %lf\n", | 
| 128 | 
> | 
               rList - 1.0, 0.05*(rList-1.0) ); | 
| 129 | 
> | 
      painCave.isFatal = 0; | 
| 130 | 
> | 
      simError();       | 
| 131 | 
> | 
      ecr = maxCutoff; | 
| 132 | 
> | 
      est = 0.05 * ecr; | 
| 133 | 
> | 
    } | 
| 134 | 
  | 
 | 
| 135 | 
+ | 
    // At least one of the radii changed, so we need a refresh: | 
| 136 | 
  | 
    refreshSim(); | 
| 137 | 
< | 
  } | 
| 141 | 
< | 
     | 
| 137 | 
> | 
  }     | 
| 138 | 
  | 
} | 
| 139 | 
  | 
  | 
| 140 | 
  | 
 | 
| 309 | 
  | 
   | 
| 310 | 
  | 
  dx = Hmat[0][0]; dy = Hmat[1][0]; dz = Hmat[2][0]; | 
| 311 | 
  | 
  dsq = dx*dx + dy*dy + dz*dz; | 
| 312 | 
< | 
  boxLx = sqrt( dsq ); | 
| 312 | 
> | 
  boxL[0] = sqrt( dsq ); | 
| 313 | 
  | 
 | 
| 314 | 
  | 
  // boxLy | 
| 315 | 
  | 
   | 
| 316 | 
  | 
  dx = Hmat[0][1]; dy = Hmat[1][1]; dz = Hmat[2][1]; | 
| 317 | 
  | 
  dsq = dx*dx + dy*dy + dz*dz; | 
| 318 | 
< | 
  boxLy = sqrt( dsq ); | 
| 318 | 
> | 
  boxL[1] = sqrt( dsq ); | 
| 319 | 
  | 
 | 
| 320 | 
  | 
  // boxLz | 
| 321 | 
  | 
   | 
| 322 | 
  | 
  dx = Hmat[0][2]; dy = Hmat[1][2]; dz = Hmat[2][2]; | 
| 323 | 
  | 
  dsq = dx*dx + dy*dy + dz*dz; | 
| 324 | 
< | 
  boxLz = sqrt( dsq ); | 
| 324 | 
> | 
  boxL[2] = sqrt( dsq ); | 
| 325 | 
  | 
   | 
| 326 | 
  | 
} | 
| 327 | 
  | 
 |