Name

readAtomicConfigurations Returns the atomic configurations stored in a VNL input file.

Synopsis

Namespace: ATK.KohnSham or ATK.TwoProbe
dictionary readAtomicConfigurations(

Description

The method readAtomicConfigurations() belongs to a VNLFile object. It reads the atomic configurations of the individual samples stored in the VNL file, and returns them in a dictionary.

The returned dictionary has the sample name as the key, and the sample atomic configuration (which can be a MoleculeConfiguration, BulkConfiguration, PeriodicAtomConfiguration, or a TwoProbeConfiguration) as the associated value.

Usage examples

Read atomic configurations from a VNL file and extract a bulk configuration called "Gold":

from ATK.KohnSham import *

file = VNLFile('mysessionfile.vnl')
all_samples = file.readAtomicConfigurations()
my_sample = all_samples["Gold"]

The following script prints the names of all samples stored in a VNL file, given as an argument on the command line:

from ATK.KohnSham import *
import sys

for sample in VNLFile(sys.argv[2]).readAtomicConfigurations():
    print sample

Save the above script as ask_sample.py, and run it on an existing VNL file as follows:

atk ask_sample.py my_vnl_file.vnl