[MMTK] Creating arbitrary molecules

Konrad Hinsen hinsen at cnrs-orleans.fr
Thu Jul 31 12:58:58 EDT 2003

On Wednesday 30 July 2003 22:33, Rick Muller wrote:

> Here's a trivial example:
> universe = InfiniteUniverse(Amber94ForceField())
> universe.addObject(Atom('O',position=Vector(0*Units.Ang,0*Units.Ang,0*Un
> its.Ang)))
> universe.addObject(Atom('H',position=Vector(1*Units.Ang,0*Units.Ang,0*Un
> its.Ang)))
> universe.addObject(Atom('H',position=Vector(0*Units.Ang,1*Units.Ang,0*Un
> its.Ang)))
> temperature = 298*Units.K
> universe.initializeVelocitiesToTemperature(temperature)
> integrator = VelocityVerletIntegrator(universe)
> integrator(steps=2000)
> If I replace the addObject calls with universe.molecule('water'), the
> example runs without problem. So I'm doing something wrong when I add
> the objects. Can anyone point out what I'm doing wrong?

Your system is not a water molecule, but three atoms. Moreover, no force field 
parameters are defined for those atoms, so you cannot do any energy-based 

At the moment, MMTK has no molecule-building code other than what is necessary 
to build chain molecules from pieces. The number one reason is that I never 
needed anything like that for my own applications (I just write molecule 
definition files for the database). Adding model-building features would not 
be difficult, but a bit tedious, because of all the information that one 
could possibly need.

If you do need to build molecules in your code (as opposed to defining them 
beforehand), the best solution for now is to have your code produce a 
database file and then use that.

Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-
Rue Charles Sadron                       | Fax:  +33-
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais

More information about the mmtk mailing list