Re: Code question: Partitioning the patch contents into water and non-water

From: Jim Phillips (
Date: Fri Aug 17 2007 - 11:10:55 CDT

Unless "splitPatch atom" is used (it probably never is) atoms in the path
are ordered with heavy atoms immediately followed by their bonded
hydrogens. This is used by the pairlist code, which first generates a
group pairlist before generating the atom pairlist.

You would need to sort the atoms at the very end of
HomePatch::doAtomMigration(), where by sorting I mean just splitting them
into water and non-waters. I don't think is_water() works other than on
node 0, so it's probably better to just look up the atom type (you only
have to do this for the atoms that are migrating). Adding a flag to the
CompAtom struct that is set during startup would work too. During startup
waters are identified by the masses of O and H.


On Fri, 17 Aug 2007, Vincent Kraeutler wrote:

> Hi,
> I'm currently looking into customized water-water interactions. So one
> thing I need to do is to partition the atoms contained in a patch into
> water and non-water. From what I can tell so far, this seems to be
> non-trivial, i.e. it looks like the atoms contained in a given patch
> come in no particular order.
> I would be deeply grateful if anyone could answer the following questions:
> i) Are the atoms in a patch sorted in any particular way? (I think they
> are not, but I'm not sure). If so, which one?
> ii) If I need to sort the atoms, I suppose it would be best to perform
> the sort right after atom migration and before the assignment to compute
> objects. Could you suggest where (in the code) I would best do that?
> (I'm currently looking at PatchMgr.* and friends with limited success)
> iii) How would I go about distinguishing water from non-water atoms? Or
> even just solvent from solute atoms? Is there an explicit way to do it,
> or would I have to go via topological information?
> Thanks & cheers,
> v.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:45:07 CST