[MMTK] shake

hinsen at llb.saclay.cea.fr hinsen at llb.saclay.cea.fr
Fri Nov 5 12:10:02 CET 2004


On Nov 4, 2004, at 16:15, Patrick Fleming wrote:

> Just to be sure I understand - the following code seems to give me the 
> correct distance constraints list. That is H1-O, H2-O, H1-H2 are 
> specified.
>
> Any problems with doing it this way?

No, that's fine. You can shorten it a bit if you like:


water = Collection()
for object in universe:
     try:
         if object.name == 'water':
            water.addObject(object)
     except AttributeError:
         pass

water.setBondConstraints()

That's for the most general of systems, there are simpler ways if you 
have some knowledge about what your system is. In particular, you can 
build up the "water collection" while constructing your system with 
almost no extra effort.

Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Laboratoire Léon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: hinsen at llb.saclay.cea.fr
---------------------------------------------------------------------




More information about the mmtk mailing list