Name

addToSample Adds an object (calculation result, atomic configuration, etc.) to a VNL input file.

Synopsis

Namespace: ATK.KohnSham or ATK.TwoProbe
string addToSample(
object,
sample_name,
label
)

Description

The method addToSample() belongs the VNLFile object. Its usage is to add different quantities to samples in the VNLFile, which in return can be imported into Virtual NanoLab in order to visualize the corresponding physical and geometric quantities.

List of arguments

object

The object to be added to sample_name. The object can be one of the following:

Default: None

sample_name

The sample name you want to add the calculated property under.

Default: None

label

The label you want to give the property you are adding; It is optional to specify the label. This will also be the label of the plot when you visualize it in the Nanoscope.

Default: None

Usage examples

from ATK.KohnSham import *

au_fcc = BulkConfiguration(...)
method = KohnShamMethod(...)
scf = method.apply(au_fcc)
electron_density = calculateElectronDensity(scf)

file = VNLFile("mysessionfile.vnl")
file.addToSample(au_fcc, "Gold sample", "configuration")
file.addToSample(electron_density, "Gold sample", "electron density")

Notes

Properties will be stored under the sample with the given label. If another object stored in the same sample with the same label, it will overwrite the already existing object. This ensures that the outcome, of running a script, always will be the same.

If the label is not given, it will choose an appropriate label.

If sample_name already exists in the VNLFile, the information is added to the given sample. If sample_name does not exists, a new sample with that name is created in the VNLFile.

Only one atomic configuration object (MoleculeConfiguration, BulkConfiguration, or TwoProbeConfiguration) can be added per sample, but a VNLFile can contain several samples. Attempting to add an atomic configuration to a sample will overwrite the existing atomic configuration in the sample.