xml_vasp_ASE
esta.vaspBag.inout.xml_vasp_ASE
¶
This module contains functionality for reading and writing an ASE Atoms object in VASP POSCAR format.
get_atomtypes(fname)
¶
Given a file name, get the atomic symbols.
The function can get this information from OUTCAR and POTCAR format files. The files can also be compressed with gzip or bzip2.
atomtypes_outpot(posfname, numsyms)
¶
Try to retreive chemical symbols from OUTCAR or POTCAR
If getting atomtypes from the first line in POSCAR/CONTCAR fails, it might be possible to find the data in OUTCAR or POTCAR, if these files exist.
posfname -- The filename of the POSCAR/CONTCAR file we're trying to read
numsyms -- The number of symbols we must find
get_atomtypes_from_formula(formula)
¶
Return atom types from chemical formula (optionally prepended with and underscore).
read_vasp(filename='CONTCAR')
¶
Import POSCAR/CONTCAR type file.
Reads unitcell, atom positions and constraints from the POSCAR/CONTCAR file and tries to read atom types from POSCAR/CONTCAR header, if this fails the atom types are read from OUTCAR or POTCAR file.
read_vasp_out(filename='OUTCAR', index=-1)
¶
Import OUTCAR type file.
Reads unitcell, atom positions, energies, and forces from the OUTCAR file and attempts to read constraints (if any) from CONTCAR/POSCAR, if present.
read_vasp_xdatcar(filename, index=-1)
¶
Import XDATCAR file
Reads all positions from the XDATCAR and returns a list of Atoms objects. Useful for viewing optimizations runs from VASP5.x
Constraints ARE NOT stored in the XDATCAR, and as such, Atoms objects retrieved from the XDATCAR will not have constraints set.
read_vasp_xml(filename='vasprun.xml', index=-1)
¶
Parse vasprun.xml file.
Reads unit cell, atom positions, energies, forces, and constraints from vasprun.xml file
write_vasp(filename, atoms, label='', direct=False, sort=None, symbol_count=None, long_format=True, vasp5=False)
¶
Method to write VASP position (POSCAR/CONTCAR) files.
Writes label, scalefactor, unitcell, # of various kinds of atoms, positions in cartesian or scaled coordinates (Direct), and constraints to file. Cartesian coordiantes is default and default label is the atomic species, e.g. 'C N H Cu'.