# Import the KohnSham module from ATK from ATK.KohnSham import * from os import path, rename class MyVNLFile(VNLFile): def __init__(self, filename, backup=False): # Check if VNL file exists if ( path.isfile(filename) and backup ): rename(filename,filename+'.bak') VNLFile.__init__(self,filename) # Set up elements and positions elm = [ Hydrogen, Hydrogen ] pos = [ ( +0.4, 0.0, 0.0)*Angstrom, ( -0.4, 0.0, 0.0)*Angstrom ] # Add them to a configuration h2 = MoleculeConfiguration(elm,pos) # Open a VNL file and add the molecule to it vnl_file = MyVNLFile('h2.vnl', True) vnl_file.addToSample(h2, 'h2')