casm.vasp.io.Poscar

class casm.vasp.io.Poscar(filename, species=None, legacy_support=True)[source]
The Poscar class contains:

self.header: Contains POSCAR header line with whitespace stripped from beginning and end self.scaling: lattice scale self._lattice: the lattice; lattice vectors are stored as rows in a numpy array self._reciprocal_lattice: the reciprocal lattice; lattice vectors are stored as rows in a numpy array self.SD_FLAG: True or False, Selective Dynamics Flag self.type_atoms: lists the specie names as in the POS (ex. [Mn3 Mn4]) self.type_atoms_alias: lists the POTCAR names for the species self.num_atoms: lists the atoms as in the POS (ex. [1 1]) self.coord_mode: Contains the coordinate mode text from POSCAR, with whitespace stripped from beginning and end self.basis: a list of Site objects

Construct a Poscar object from ‘filename’

Args:

filename = POS/POSCAR file or structure.json file to read species = (default None) If given a Species dict, it is used to set self.type_atoms_alias for determining which POTCARs to use

__init__(filename, species=None, legacy_support=True)[source]

Construct a Poscar object from ‘filename’

Args:

filename = POS/POSCAR file or structure.json file to read species = (default None) If given a Species dict, it is used to set self.type_atoms_alias for determining which POTCARs to use

Methods

__init__(filename[, species, legacy_support])

Construct a Poscar object from ‘filename’

apply_deformation([deformation])

applies a deformation which is array of size 3 X 3

basis_dict()

Return a dictionary where keys are unique specie ‘alias’ and values are lists of atoms.

lattice([index])

Returns the lattice, or lattice vector ‘index’, as numpy array

read(filename[, species, legacy_support])

Reads a POS/POSCAR from ‘filename’

read_structure_json(filename[, species])

Reads a structure from structure.json file ‘filename’

reciprocal_lattice([index])

Returns the reciprocal lattice vector ‘index’, as numpy array

reciprocal_volume([reciprocal_lattice])

Returns scalar triple product of reciprocal lattice vector

unsort_dict()

Return a dict to unsort atom order.

update(species)

Set self.type_atoms_alias and self.basis[x].alias according to Species dict.

volume([lattice])

Returns scalar triple product of lattice vectors

write(filename[, sort])

Write Poscar to ‘filename’.