From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Apr 17 2008 - 04:52:29 CDT

On Thu, 17 Apr 2008, Olaf Lenz wrote:

OL> -----BEGIN PGP SIGNED MESSAGE-----
OL> Hash: SHA1
OL>
OL> Ana Vila Verde wrote:
OL> > I am trying to use the command measure hbonds to calculate the number of
OL> > hbonds between a molecule and water from a simulation with PBCs.
OL> > However, very often my molecule "sticks out" of the water box, and when
OL> > that happens I get an inaccurate count of hbonds.
OL>
OL> What I would probably do in this situation is to split the box into
OL> eight domains (2 subdomains in each dimension), and the to loop over all
OL> of these subdomains:
OL>
OL> 1. Wrap all atoms into a box that is centered on the subdomain, by using
OL> "pbc wrap -center $x $y $z", where (x,y,z) is the center of the subdomain.
OL> 2. Now measure all hbonds between all oxygens in this box and all
OL> hydrogens of the system. The selection for the oxygens will look
OL> something like
OL> "name O and x > 0 and x < 5 and y > 0 and y < 5 and z > 0 and z < 5"
OL> for the first subdomain of a 10x10x10 box.
OL>
OL> If you do this for all 8 domains, you should have all hbonds in the system.

why so complicated?

shouldn't:

pbc wrap -center "<selection text for molecule>" -all

do the trick, provided there is only one molecule?

axel.

OL>
OL> Olaf
OL> -----BEGIN PGP SIGNATURE-----
OL> Version: GnuPG v1.4.6 (GNU/Linux)
OL> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
OL>
OL> iD8DBQFIBxkxtQ3riQ3oo/oRAgNdAJ4+QwhM69iXBgFuowvk9kwhPGRUvQCgsgz7
OL> csZ2urJBT79aMUMH8Cu+Yc0=
OL> =iPmT
OL> -----END PGP SIGNATURE-----
OL>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.