| 51 | 
  | 
#include "utils/NumericConstant.hpp" | 
| 52 | 
  | 
#include "utils/simError.h" | 
| 53 | 
  | 
#include "utils/Utility.hpp" | 
| 54 | 
+ | 
#include <cstdio> | 
| 55 | 
+ | 
 | 
| 56 | 
  | 
namespace OpenMD { | 
| 57 | 
  | 
 | 
| 58 | 
  | 
  void  Snapshot::setHmat(const Mat3x3d& m) { | 
| 59 | 
  | 
    hmat_ = m; | 
| 60 | 
  | 
    invHmat_ = hmat_.inverse(); | 
| 61 | 
  | 
     | 
| 60 | 
– | 
 | 
| 62 | 
  | 
    //prepare fortran Hmat  | 
| 63 | 
  | 
    RealType fortranHmat[9]; | 
| 64 | 
  | 
    RealType fortranInvHmat[9]; | 
| 136 | 
  | 
      // calc the wrapped real coordinates from the wrapped scaled coordinates | 
| 137 | 
  | 
      pos = hmat_ * scaled;     | 
| 138 | 
  | 
 | 
| 139 | 
< | 
    } else {//if it is orthoRhombic, we could improve efficiency by only caculating the diagonal element | 
| 139 | 
> | 
    } else { | 
| 140 | 
> | 
 | 
| 141 | 
> | 
      // if it is orthoRhombic, we could improve efficiency by only | 
| 142 | 
> | 
      // caculating the diagonal element | 
| 143 | 
  | 
     | 
| 144 | 
  | 
      // calc the scaled coordinates. | 
| 145 | 
  | 
      for (i=0; i<3; i++) { | 
| 154 | 
  | 
      // calc the wrapped real coordinates from the wrapped scaled coordinates | 
| 155 | 
  | 
      for (i=0; i<3; i++) { | 
| 156 | 
  | 
        pos[i] = scaled[i] * hmat_(i, i); | 
| 157 | 
< | 
      } | 
| 154 | 
< | 
         | 
| 157 | 
> | 
      }    | 
| 158 | 
  | 
    } | 
| 156 | 
– | 
 | 
| 159 | 
  | 
  } | 
| 160 | 
  | 
 | 
| 161 | 
  | 
  Vector3d Snapshot::getCOM() { | 
| 184 | 
  | 
    } | 
| 185 | 
  | 
    return COMw_; | 
| 186 | 
  | 
  } | 
| 185 | 
– | 
  | 
| 187 | 
  | 
} | 
| 188 | 
  | 
   |