<div dir='auto'>Hi,<div dir="auto"><br></div><div dir="auto">GROMACS first shifts the distance by box vectors to make the Cartesian distance components within half the box diagonals and then tries the max 14 different PBC shifts that could potentially make the distance shorter.</div><div dir="auto">But I can assure you that this code is correct, it has been tested for decades.</div><div dir="auto">Only using an inverted cell matrix will not work.</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto"><br></div><div dir="auto">Berk</div><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On Apr 21, 2017 08:05, Jicun LI &lt;JicunLi@whu.edu.cn&gt; wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Berk,<div><br></div><div>Thanks for your comments. Do you know the method GMX used to apply PBC for triclinic box? There are different approaches for this problem, but I think only the method using inverted cell matrix will be correct for any cases. Please look at&nbsp;https://scicomp.stackexchange.com/questions/3107/minimum-image-convention-for-triclinic-unit-cell. For my case, I did not put bonds in my topology, otherwise the angle will not change dramatically and GMX may not encounter the problems.</div><div><br></div><div>Regards,</div><div>Jicun</div></div><div><br><div class="elided-text">2017-04-20 14:51 GMT-05:00 Berk Hess <span dir="ltr">&lt;<a href="mailto:hess@kth.se">hess@kth.se</a>&gt;</span>:<br><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div>
    <div>Hi,<br>
      <br>
      I think GROMACS is correct. The distances between your atoms are
      longer than half of two of the box vector lengths, so it's very
      difficult to see what the closest periodic image is.<br>
      It looks like the real issue is that you forgot to put bonds in
      your topology.<br>
      <br>
      Cheers,<br>
      <br>
      Berk<div><div><br>
      <br>
      On 04/20/2017 09:00 PM, Jicun LI wrote:<br>
    </div></div></div><div><div>
    <blockquote>
      
      <div dir="ltr">Hi,<br>
        <br>
        It seems to me there is a bug in GMX 5.1.4 when calculating the angles in
        a triclinic
        box. For some special cases GMX does not apply the PBC well. For example, the
        HOH angle of
        the following configuration is about 2 degree, but both `mdrun` and `gangle` will give
        about 89 degree.<br>
        <br>
        <font face="monospace, monospace">Generated by trjconv : SOL t= &nbsp;
          0.00900<br>
          &nbsp; &nbsp; 3<br>
          &nbsp; &nbsp; 1SOL &nbsp; &nbsp; &nbsp;H &nbsp; &nbsp;1 &nbsp; 0.063 &nbsp; 0.448 &nbsp; 0.045 &nbsp;9.3129-17.0644
          &nbsp;4.3188<br>
          &nbsp; &nbsp; 1SOL &nbsp; &nbsp; &nbsp;O &nbsp; &nbsp;2 &nbsp; 0.746 &nbsp; 0.604 &nbsp; 0.203-23.5642 10.7484
          10.1804<br>
          &nbsp; &nbsp; 1SOL &nbsp; &nbsp; &nbsp;H &nbsp; &nbsp;3 &nbsp; 0.059 &nbsp; 0.435 &nbsp; 0.056 14.2513
          &nbsp;6.3160-14.4992<br>
          &nbsp; &nbsp;1.04000 &nbsp; 0.60975 &nbsp; 0.52565 &nbsp; 0.00000 &nbsp; 0.00000 &nbsp;-0.28175 &nbsp;
          0.00000 &nbsp;-0.28063 &nbsp;-0.01980</font><br>
        <br>
        Any advice or suggestions will be appreciated. If anyone wants
        to repeat the results, please use the following input files:<br>
        <br>
        - `conf.gro`<br>
        <br>
        <font face="monospace, monospace">Ang<br>
          &nbsp; &nbsp;3<br>
          &nbsp; &nbsp; &nbsp;SOL &nbsp; &nbsp; H &nbsp; &nbsp; 1 &nbsp; 0.270 &nbsp;-0.034 &nbsp; 0.016<br>
          &nbsp; &nbsp; &nbsp;SOL &nbsp; &nbsp; O &nbsp; &nbsp; 2 &nbsp; 0.175 &nbsp;-0.092 &nbsp; 0.123<br>
          &nbsp; &nbsp; &nbsp;SOL &nbsp; &nbsp; H &nbsp; &nbsp; 3 &nbsp; 0.229 &nbsp;-0.217 &nbsp; 0.165<br>
          &nbsp; &nbsp;1.04000 &nbsp; 0.60975 &nbsp; 0.52565 0.00000 &nbsp; 0.00000 &nbsp;-0.28175 &nbsp;
          0.00000 &nbsp;-0.28063 &nbsp;-0.01980</font><br>
        <br>
        - `topol.top`<br>
        <br>
        <font face="monospace, monospace">[ defaults ]<br>
          ; nbfunc &nbsp;
          &nbsp; &nbsp; &nbsp;comb-rule &nbsp; &nbsp; &nbsp; gen-pairs &nbsp; &nbsp; &nbsp; fudgeLJ fudgeQQ<br>
          1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yes &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; 1<br>
          <br>
          [ atomtypes
          ]<br>
          ;name &nbsp; bond_type &nbsp; &nbsp; mass &nbsp; &nbsp; charge &nbsp; ptype &nbsp; sigma &nbsp; &nbsp; &nbsp; &nbsp;
          epsilon<br>
          &nbsp;O &nbsp; &nbsp; &nbsp; O &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.00000 &nbsp;0.00000 &nbsp; A &nbsp; &nbsp;0 0<br>
          &nbsp;H &nbsp; &nbsp; &nbsp; H &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.00000 &nbsp;0.00000 &nbsp; A &nbsp; &nbsp;0 0<br>
          <br>
          [ moleculetype
          ]<br>
          ;name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nrexcl<br>
          &nbsp;SOL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3<br>
          <br>
          [ atoms ]<br>
          ; &nbsp; nr
          &nbsp;type &nbsp;resi
          &nbsp;res &nbsp;atom &nbsp;cgnr
          &nbsp; &nbsp; charge &nbsp; &nbsp; &nbsp;mass<br>
          &nbsp; &nbsp; 1 &nbsp; H &nbsp; &nbsp; 1 &nbsp; SOL &nbsp; &nbsp;H &nbsp; &nbsp;1 &nbsp; 0 1<br>
          &nbsp; &nbsp; 2 &nbsp; O &nbsp; &nbsp; 1 &nbsp; SOL &nbsp; &nbsp;O &nbsp; &nbsp;2 &nbsp; 0 1<br>
          &nbsp; &nbsp; 3 &nbsp; H &nbsp; &nbsp; 1 &nbsp; SOL &nbsp; &nbsp;H &nbsp; &nbsp;3 &nbsp; 0 1<br>
          <br>
          [ angles ]<br>
          ; &nbsp; ai &nbsp; &nbsp;
          aj &nbsp; &nbsp; ak &nbsp; &nbsp;funct &nbsp; theta &nbsp;
          &nbsp; &nbsp; &nbsp; cth<br>
          &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp;3 &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp;1.0750e+01 &nbsp; &nbsp;5.8576e+02<br>
          [ system ]<br>
          &nbsp;SOL<br>
          <br>
          [ molecules ]<br>
          ; Compound &nbsp; &nbsp; &nbsp; &nbsp;nmols<br>
          &nbsp;SOL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1<br>
        </font><br>
        - `grompp.mdp`<br>
        <br>
        <font face="monospace, monospace">integrator &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = md<br>
          dt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 0.001<br>
          tinit &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 0<br>
          nsteps &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 10<br>
          nstcomm &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br>
          <br>
          nstxout &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br>
          nstvout &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br>
          nstfout &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br>
          nstxtcout &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br>
          nstenergy &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br>
          nstlog &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1<br>
          <br>
          nstlist &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 1<br>
          ns_type &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= grid<br>
          pbc &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= xyz<br>
          <br>
          rlist &nbsp; &nbsp;=
          .2<br>
          rcoulomb =
          .2<br>
          <br>
          coulombtype
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= PME<br>
          fourier-nx &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          = 80<br>
          fourier-ny &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          = 80<br>
          fourier-nz &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          = 80<br>
          pme-order &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 12<br>
          ewald_rtol &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; = 1E-9<br>
          <br>
          rvdw=0.2<br>
          vdw-type &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = Cut-off<br>
          <br>
          tcoupl &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = nose-hoover<br>
          tc-grps &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp;= system<br>
          tau_t &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 2<br>
          ref_t &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 298.15<br>
          <br>
          gen_vel &nbsp; &nbsp;
          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= no<br>
          gen_temp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 298.15</font><br>
        <br>
        - `index.ndx`<br>
        <br>
        <font face="monospace, monospace">[ System ]<br>
          &nbsp; &nbsp;1 &nbsp; &nbsp;2 &nbsp; &nbsp;3<br>
          [ SOL ]<br>
          &nbsp; &nbsp;1 &nbsp; &nbsp;2 &nbsp; &nbsp;3<br>
          [ ang ]<br>
          1 2 3</font><br>
        <br>
        For a 10 steps running, the output of `gangle` I got is<br>
        <br>
        <font face="monospace, monospace"># Command line:<br>
          # &nbsp; gmx gangle -f -n -oall<br>
          # gmx gangle is part
          of G R O M A C S:<br>
          #<br>
          # Good gRace!
          Old Maple Actually Chews Slate<br>
          #<br>
          @ &nbsp; &nbsp;title "Angle"<br>
          @ &nbsp; &nbsp;xaxis
          &nbsp;label "Time (ps)"<br>
          @ &nbsp; &nbsp;yaxis
          &nbsp;label "Angle (degrees)"<br>
          @TYPE xy<br>
          &nbsp; &nbsp; &nbsp; 0.000 &nbsp;107.495<br>
          &nbsp; &nbsp; &nbsp; 0.001 &nbsp; 96.084<br>
          &nbsp; &nbsp; &nbsp; 0.002 &nbsp; 78.024<br>
          &nbsp; &nbsp; &nbsp; 0.003 &nbsp; 59.745<br>
          &nbsp; &nbsp; &nbsp; 0.004 &nbsp; 43.710<br>
          &nbsp; &nbsp; &nbsp; 0.005 &nbsp; 30.884<br>
          &nbsp; &nbsp; &nbsp; 0.006 &nbsp; 20.977<br>
          &nbsp; &nbsp; &nbsp; 0.007 &nbsp; 13.337<br>
          &nbsp; &nbsp; &nbsp; 0.008 &nbsp; &nbsp;7.200<br>
          &nbsp; &nbsp; &nbsp; 0.009 &nbsp; 89.133<br>
          &nbsp; &nbsp; &nbsp; 0.010 &nbsp; &nbsp;0.907</font><br>
        <br>
        The angle of 0.009 ps
        is not correct, in my opinion.<br>
        &nbsp;<br>
        Regards,<br>
        Jicun</div>
      <br>
      <fieldset></fieldset>
      <br>
    </blockquote>
    <br>
  </div></div></div>

<br>--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/<wbr>Support/Mailing_Lists/GMX-<wbr>developers_List</a> before posting!<br>
<br>
* Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/<wbr>Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/<wbr>mailman/listinfo/gromacs.org_<wbr>gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@<wbr>gromacs.org</a>.<br></blockquote></div><br></div>
</blockquote></div><br></div></div>