[ase-users] Query for constraints atoms in VASP

Igor Kowalec KowalecI at cardiff.ac.uk
Tue Oct 20 14:03:11 CEST 2020


Dear Asif,

I believe you are looking for the FixedPlane or FixedLine classes of constraints:

https://wiki.fysik.dtu.dk/ase/ase/constraints.html?highlight=constraints#module-ase.constraints

Kind regards,

Igor
________________________________
From: ase-users-bounces at listserv.fysik.dtu.dk <ase-users-bounces at listserv.fysik.dtu.dk> on behalf of BHATTI Asif via ase-users <ase-users at listserv.fysik.dtu.dk>
Sent: 20 October 2020 12:38
To: ase-users at listserv.fysik.dtu.dk <ase-users at listserv.fysik.dtu.dk>
Subject: [ase-users] Query for constraints atoms in VASP

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/2aae3bdb/attachment.html>


More information about the ase-users mailing list