[MMTK] object or module for molecule-centered grid

konrad.hinsen@cea.fr konrad.hinsen at cea.fr
Tue Mar 14 12:26:04 CET 2006

On 10.03.2006, at 21:00, Andrew D. Fant wrote:

>     Is there code in MMTK, or has anyone written any, that will  
> take a molecule,
> orient it to the usual standards (center of gravity, aligned to  
> principal
> moments of inertia) and generate a uniformly-spaced set of grid  
> points to
> surround it?  I'll admit to being a novice, so I apologize if this  
> is already in

The first part is straightforward:


will do the alignment that you want to have. As for generating a  
uniformly spaces set of grid points around the molecule, it all  
depends on what exactly you need and what you want to do with it.  
Here is one approach that should be fine:

	from MMTK.Geometry import SCLattice
	cell_size = 0.1*Units.nm
	grid_size = 10  # 10 cells in each direction
	grid_origin = -(grid_size/2) * cell_size
	for point in SCLattice(cell_size, grid_size):
		print point + origin

You could also calculate the grid size as a function of  
molecule.boundingBox(), for example.

Konrad Hinsen
Laboratoire Leon Brillouin (CEA-CNRS), CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: konrad.hinsen at cea.fr

More information about the mmtk mailing list