[MMTK] question on printing out all non-bonded interactions

Naomi Fox fox at cs.umass.edu
Wed Feb 1 20:43:17 UTC 2012


I would like to efficiently print out each non-bonded atom pair interaction
and its associated LJ and coulombic potentials.

I have used the example the MMTK file
'Examples/Miscellaneous/force_field_parameters.py' as a template.

I am able to get the set in an O(n^2) fashion as so:

nonbondedparams = parameters['nonbonded']
allatoms = universe.atomCollection()
notexcludedlj = []
for i in range(0, universe.numberOfAtoms()):
    for j in range(i+1,  universe.numberOfAtoms() ):
        energyterms = universe.energyTerms(allatoms[i], allatoms[j])
        if (i,j) in nonbondedparams['excluded_pairs'] or (i,j) in
nonbondedparams['one_four_pairs']:
            print i, j, "excluded or one_four_pair"
        else:
            print i, j, energyterms['Lennard-Jones']


How do I get all the atom pairs with a distance below some cutoff?
Do the forcefields, for example Amber99, maintain some internal list of
these?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://starship.python.net/pipermail/mmtk/attachments/20120201/9181b833/attachment.html>


More information about the mmtk mailing list