lattices

Konrad Hinsen hinsen@cnrs-orleans.fr
Mon, 2 Nov 1998 17:14:23 +0100


> examples provided with the MMTK distribution.  One thing that I would
> like to do is to place the atoms of a molecule on a lattice and view
> them.

I suppose you want to place whole molecules at each lattice point,
right? There are not so many molecules whose atomic structure is
a lattice!

Here's an example which will become part of the next MMTK distribution:

---------------------------------------------------------------------------
# Example: water molecules on a lattice
#
# This example creates a system of water molecules whose centers
# of mass are positioned simple cubic lattice consisting of
# 3x4x5 cells, i.e. there are 60 water molecules in total.
# The molecules are put into a suitably sized periodic universe.

from mmtk import *

# Define parameters of the lattice
edge_length = 0.5*Units.nm
lattice_size = (3, 4, 5)

# Construct the universe
world = OrthorhombicPeriodicUniverse((edge_length*lattice_size[0],
                                      edge_length*lattice_size[1],
                                      edge_length*lattice_size[2]))

# Add the water molecules
for point in SCLattice(edge_length, lattice_size):
    world.addObject(Molecule('water', position = point))

# Visualization
view(world)
---------------------------------------------------------------------------

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