| 20 | 
  | 
  return ( x >= 0 ) ? floor( x + 0.5 ) : ceil( x - 0.5 ); | 
| 21 | 
  | 
} | 
| 22 | 
  | 
           | 
| 23 | 
+ | 
inline double min( double a, double b ){ | 
| 24 | 
+ | 
  return (a < b ) ? a : b; | 
| 25 | 
+ | 
} | 
| 26 | 
  | 
 | 
| 27 | 
  | 
SimInfo* currentInfo; | 
| 28 | 
  | 
 | 
| 542 | 
  | 
void SimInfo::setDefaultEcr( double theEcr ){ | 
| 543 | 
  | 
 | 
| 544 | 
  | 
  haveEcr = 1; | 
| 545 | 
+ | 
  ecr = theEcr; | 
| 546 | 
  | 
   | 
| 547 | 
  | 
  ( rCut > ecr )? rList = rCut + 1.0: rList = ecr + 1.0; | 
| 548 | 
  | 
 | 
| 545 | 
– | 
  ecr = theEcr; | 
| 546 | 
– | 
 | 
| 549 | 
  | 
  notifyFortranCutOffs( &rCut, &rList, &ecr, &est ); | 
| 550 | 
  | 
} | 
| 551 | 
  | 
 | 
| 565 | 
  | 
    if( rCut > maxCutoff ){ | 
| 566 | 
  | 
      sprintf( painCave.errMsg, | 
| 567 | 
  | 
               "Box size is too small for the long range cutoff radius, " | 
| 568 | 
< | 
               "%lf, at time %lf\n", | 
| 569 | 
< | 
               rCut, currentTime ); | 
| 568 | 
> | 
               "%G, at time %G\n" | 
| 569 | 
> | 
               "  [ %G %G %G ]\n" | 
| 570 | 
> | 
               "  [ %G %G %G ]\n" | 
| 571 | 
> | 
               "  [ %G %G %G ]\n", | 
| 572 | 
> | 
               rCut, currentTime, | 
| 573 | 
> | 
               Hmat[0][0], Hmat[0][1], Hmat[0][2], | 
| 574 | 
> | 
               Hmat[1][0], Hmat[1][1], Hmat[1][2], | 
| 575 | 
> | 
               Hmat[2][0], Hmat[2][1], Hmat[2][2]); | 
| 576 | 
  | 
      painCave.isFatal = 1; | 
| 577 | 
  | 
      simError(); | 
| 578 | 
  | 
    } | 
| 581 | 
  | 
      if( ecr > maxCutoff ){ | 
| 582 | 
  | 
        sprintf( painCave.errMsg, | 
| 583 | 
  | 
                 "Box size is too small for the electrostatic cutoff radius, " | 
| 584 | 
< | 
                 "%lf, at time %lf\n", | 
| 585 | 
< | 
                 ecr, currentTime ); | 
| 584 | 
> | 
                 "%G, at time %G\n" | 
| 585 | 
> | 
                 "  [ %G %G %G ]\n" | 
| 586 | 
> | 
                 "  [ %G %G %G ]\n" | 
| 587 | 
> | 
                 "  [ %G %G %G ]\n", | 
| 588 | 
> | 
                 ecr, currentTime, | 
| 589 | 
> | 
                 Hmat[0][0], Hmat[0][1], Hmat[0][2], | 
| 590 | 
> | 
                 Hmat[1][0], Hmat[1][1], Hmat[1][2], | 
| 591 | 
> | 
                 Hmat[2][0], Hmat[2][1], Hmat[2][2]); | 
| 592 | 
  | 
        painCave.isFatal = 1; | 
| 593 | 
  | 
        simError(); | 
| 594 | 
  | 
      } |