Skip to content

crystal_lattice

esta.vaspBag.inout.crystal_lattice

CrystalLattice

Crystal lattice class to define lattice parameters and basis; crystal = lattice + basis (atoms or molecules )

Author: Sonu Kumar Email: sonukumar.physics@gmail.com

Date: April, 2017 updates:2019, 2020, 2022

get_atm_symbol property

by reading POSCAR, find the atomic labels of the atoms

to_cartesian property

get atomic position in cartesin cooridnates

to_crystal property

get atomic position in crystal cooridnates

is_crystal property

check if atom positions in crytal coordinates

is_cartesian property

check if atom positions in cartesian coordinates

get_rVolume property

get real space lattice volume

get_volume property

get real space lattice volume

get_cell_vectors property

geta tuple of set of three cell/lattice vectors lv1, lv2, and lv3 in c-style format

get_cell_matrix property

get lattice matrix of three cell/lattice vectors lv1, lv2, and lv3 in c-style format or fortran stype format default is c style format.

get_atm_type property

get symbolic representation of atoms of each type in the form of list

get_natm_type property

get no. of atoms of each type in a list format

get_each_atm_type property

get same integer for atoms of same type

is_selective_dynamics property

check whether selective dynamics True or False

read_poscar(verbosity=None)

read poscar file present in the current dir or in the location specified.

parameters crysatal lattice object

return if l_SelectDynamics: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms, self.atomFix, self.atomMove else: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms

read_poscar_adv(verbosity=None)

read poscar file present in the current dir or in the location specified.

parameters crysatal lattice object

return if l_SelectDynamics: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms, self.atomFix, self.atomMove, self.atomFixDir else: return self.tau_cartesian, self.real_volume, self.LV1, self.LV2, self.LV3,self.atm_type, self.natm_type, self.natoms

get_poscar()

XXXXXXXXXXXXXXXXXXXXXXXXXX---DEPRECATED-------DEPRECATED ------------------XXXXXXXXXXXXXXXXXXXXXX ** get_poscar is deprecated; use read_poscar instead!! ** read poscar file present in the current dir or in the location specified.

get_reciprocal_lattice()

return the reciprocal lattice vectors
input: real space lattice vectors: LV1, LV2, LV3 output: reciprocal space lattice vectors: b1, b2, b3 - note: a factor of 2pi is included in b1, b2, and b3

reciprocal_lattice()

deprecated: method to calculate the reciprocal lattice vectors

get_all_atoms_labels()

by reading POSCAR, find the atomic labels of the atoms and total no of atoms

Parameters:
string: POSCAR file in current dir.
Return:
list : strings of atomic lebels of all atoms according to the numbering of atoms in POSCAR file
scalar: total number of atoms in the POSCAR file
list:  integer numbers starting from 1 to ntotal for all atoms(e.g. 1 1 1 2 3 4 4 ..)

author: sk email: sonukumar.physics@gmail.com

get_unique_list(inp)

get unique elements of list

return: string for each type of atoms

get_grouped_list(llist)

get same string elements of list grouped together

get_neach_type(inp)

get number of list entries of each type

return:

  list of integers for each type of atoms specifying their number

get_selectivePOSCAR(ldisp=True, disp_atoms_num=None, outfile=None)

get displaced poscar with selective tag and atomic positions tagged by T T T or F F F

Parameters:

  • ldisp

    whether fix atoms or not

  • disp_atoms_num

    list of atoms indices as strings; e.g: ["1-2", '3']

  • outfile

    output file name

Returns:

  • POSCAR file with selective dynamics tags

get_selectivePOSCAR_adv(ldisp=True, disp_atoms_num=None, fix_direction=None, coord='cartesian', outfile=None)

get displaced poscar with selective tag and atomic positions tagged by T T T or F F F

Parameters:

  • ldisp

    whether fix atoms or not

  • disp_atoms_num

    list of atoms indices as strings to be fixed during DFT relaxation; e.g: ["1-2", '3']

  • fix_direction

    x, y, or z direciton; by default atoms are fixed in all directions

  • coord

    cartesian or direct coordinates; default: cartesian

  • outfile

    output file name

Returns:

  • POSCAR file with selective dynamics tags

get_dispPOSCAR(ldisp=None, disp_atoms_num=None)

deprecated: use get_selectivePOSCAR