[gmx-developers] pbc.c: put_atoms_in_triclinic_box

Tsjerk Wassenaar t.a.wassenaar at chem.rug.nl
Wed Dec 10 13:46:03 CET 2003


Hi guys,

I would like to make a suggestion for replacing the function 
put_atoms_in_triclinic_box in pbc.c, because the current one, which I 
find a bit hard to understand, produces a shift between the box and the 
atoms. The following puts all of the atoms in the triclinic box:

void put_atoms_in_triclinic_unitcell(matrix box, int natoms, rvec x[])
{
  matrix S,T;
  int    i,j;

  transpose(box, S);
  m_inv(S,T);
  for(i=0; i<natoms; i++)
  {
    mvmul(T, x[i], x[i]);
    x[i][0] = trunc(x[i][0]);
    x[i][1] = trunc(x[i][1]);
    x[i][2] = trunc(x[i][2]);
    mvmul(S, x[i], x[i]);
  }
}

Greetings,

Tsjerk

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- :)
-- :) 	Tsjerk A. Wassenaar, M.Sc.
-- :) 	Molecular Dynamics Group
-- :) 	Dept. of Biophysical Chemistry
-- :) 	University of Groningen
-- :) 	Nijenborgh 4
-- :) 	9747 AG Groningen
-- :) 	The Netherlands
-- :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- :)
-- :) 	Hi! I'm a .signature virus!
-- :) 	Copy me into your ~/.signature to help me spread!
-- :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






More information about the gromacs.org_gmx-developers mailing list