[ase-users] Query for constraints atoms in VASP

Michael Joseph Waters michael.j.waters at northwestern.edu
Tue Oct 20 17:06:35 CEST 2020


Hi Asif,

FixAtoms prevents an atom from moving. You want this: https://wiki.fysik.dtu.dk/ase/ase/constraints.html#the-fixedline-class

The fixed line class will let you constrain the atoms to one direction.

Best,
-Mike

________________________________
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: Tuesday, October 20, 2020 6:38 AM
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/08588397/attachment-0001.html>


More information about the ase-users mailing list