[MMTK] 2D simulations?

khinsen at cea.fr khinsen at cea.fr
Thu Apr 7 19:19:29 CEST 2005

On 07.04.2005, at 16:46, mmtk-bounces at python.net wrote:

> A newbie question: is it possible to do strictly 2D simulations in  
> modified the argon.py example script with the intention of making it  
> work
> in 2D (to simulate a L-J gas in the plane) by setting the z dimension  
> of
> the OrthorhombicPeriodicUniverse to zero. No luck - I get a  
> segfault/NaNs.

MMTK doesn't like zero-volume universes. I guess it shouldn't crash,  
but this is certainly not supposed to work.

There are a couple of approaches of different complexity and  
flexibility. It all depends on what you need. A first approach would be  
to place your atoms on a plane (z=0 for example) in a periodic universe  
of finite z-extension, and make sure that their initial velocities are  
in the plane as well. With only pairwise potentials, the atoms should  
then always stay in the plane. The question is, however, if such an  
arrangement is numerically stable. If there are only slight deviations,  
you could get away with perdiodically resetting the z component of all  
positions and velocities to zero.

If that doens't work, and assuming you need only a straightforward  
Verlet-type integrator, you could write your own integrator in Python  
code that uses only the x and y coordinates. You would lose a bit of  
speed, but not that much, as a plain Verlet integrator can be expressed  
in terms of efficient array operations. If you need a thermostat, this  
approach might not be realistic any more. You would then have to write  
your 2D integrator in C, using the Langevin integrator in the Examples  
directory as a model.


PS: Your message didn't get through to the list because you are not  
subscribed to the list, at least not with the same address. Please  
Konrad Hinsen
Laboratoire Leon 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: khinsen at cea.fr

More information about the mmtk mailing list