[ase-users] Query for constraints atoms in VASP

BHATTI Asif Asif.BHATTI at lspm.cnrs.fr
Tue Oct 20 13:38:50 CEST 2020


Hello all,

I would like to ask how to constrain the atoms only in the X and Y direction in POSCAR file (F F T). I have used this command but it constraints only the selected atoms only,

# Read initial and final states:
initial = ase.io.read('POSCAR')
pos = initial.get_positions()
ucell = initial.get_cell()

atoms = Atoms(positions=pos, symbols='Hf81Nb81',
       cell=ucell, pbc=[True,True,True])
c = FixAtoms(indices=[atom.index for atom in atoms if atom.positions == 'Hf']')
atoms.set_constraint(c)
print (c)
write_vasp("ASIF.vasp", atoms=atoms, vasp5=True, ignore_constraints=False)

Regards,
Asif

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20201020/7d0b08c7/attachment.html>


More information about the ase-users mailing list