Ymol


Ymol available freely for downloading!

Ymol is a molecular visualisation and animation program for the X Window System. It can be used to create production quality images, and movies, using either the built in renderer or by exporting the scenes to POVRAY (Persistence of Vision).

The rotating nanocluster below was rendered with Ymol.

Rotating nanocluster, 328x276 pixels

For more examples see the picture gallery.


The current version of ymol is 0.8.154. Ymol is available as a binary and source distribution free for non commercial use. Although development and testing mainly occurs on Linux (x86_64), Ymol has been tested to run on many *nix-like operating system (Linux, OS X, FreeBSD, IRIX, OSF/1, ULTRIX, AIX, Solaris, HP-UX (PA), and Win32 (Cygwin)). Ymol should be fairly easy to port to anything running *nix and X11.
Pretty-looking pictures with many atoms might take some time to render, but in the default mode Ymol operates very fast and is very suitable for interactive use. Using only core Xlib calls to draw circles, polygons and lines, Ymol shows real time movies on slow (486) machines. Ymol can also use the POVRay raytracer.


Download ymol

Go to Ymol distribution directory

NOTE: New simpler installation from source

Only grab the ymol-allsource-VERSION.tar.gz archive. Unpack. Type make. Type make install. Done.
Note though that this installs into ~/bin, so put this into your path:

PATH="$HOME/bin:$PATH"
export PATH

Latest updates

Picture gallery


The ymol library

The ymol library makes it easy to use ymol as a visualization package. An example C-program:

#include <stdio.h>
#include <math.h>
#include "ymolsock.h"

int main()
{
  double t=0.;
  int n=200;
  double radius=5.;
  double step=1./(n*50);
  double pi=3.1415926;
  ymolsock_init();
  while (1)
    {
      int i;
      if (ymolsock_check_ymol())
	{
	  if (ymolsock_write_natoms(n))
	    {
	      for (i=0; i<n; i++)
		{
		  double x=radius*sin(3*(t+i*pi*2/n));
		  double y=radius*cos(5*(t+i*pi*2/n));
		  double z=radius*cos(7*(t+i*pi*2/n));
		  ymolsock_write_atom(i,1,x,y,z);
		}
	    }
	}
      t+=pi*2*step;
    }

  ymolsock_deinit();
  return 0;
}
An example Fortran-program:
      program testsock
      implicit double precision (a-h,o-z)
      t=0.d0
      n=200
      r=5.d0
      step=1.d0/(n*50);
      pi=3.1415926
      call yscini
 10   call yscchy(ierr)
      if (ierr.ne.0) then
        call yscwna(n,ierr)
        if (ierr.ne.0) then
          do i=1,n
            x=r*sin(3*(t+i*pi*2/n))
            y=r*cos(5*(t+i*pi*2/n))
            z=r*cos(7*(t+i*pi*2/n))
            call yscwat(i,1,x,y,z,ierr)
          enddo
        endif
      endif
      t=t+pi*2*step
      goto 10
      call yscdin
      stop
      end
When ymol is compiled and installed as an ordinary user on a Linux x86_64 platform an include file and a library is installed in $HOME/lib/Linux.x86_64. The C program above can then easily be compiled using:
gcc -O2 -o testsock testsock.c -L$HOME/lib/Linux.x86_64 -I$HOME/lib/Linux.x86_64 -lymol -lm
The Fortran program above is easily compiled as well using:
g77 -O2 -o testsock testsock.for -L$HOME/lib/Linux.x86_64 -lymol

The ymolssh command

ymolssh

The ymolssh command can be used to visualize a simulation running on a remote computer if you or the remote computer is behind a firewall. If there's no firewall in between, it is only necessary to start ymol and copy the "ymol_sockimport" to the directory where the simulation is running. If the simulation is running on the computer named simmachine in the directory simdirectory it is only necessary to type

ymolssh simmachine:simdirectory 10201
The port (10201) on the remote host (simmachine) used to forward the ymol data is necessary to give as well. Use any unused port. Should the simulation be running on a remote computer with no ssh-access, it may be necessary to go to that machine in steps. This is also supported by ymolssh:
ymolssh simmachinefrontend:simdirectory 10201 simmachine 10201
See the image for a real example of this.


This page contains graphics rendered with Ymol.