[ase-users] Query for constraints atoms in VASP

Alexander Sougaard Tygesen alexty at dtu.dk
Wed Oct 21 11:01:31 CEST 2020


Hi Asif,


You should also be aware that VASP itself cannot handle very many kinds of constraints. I don't believe it can actually natively do a fixedline calculation, unless it's along one of the cell axis.


The usual workaround, is to instead let ASE  to the geometry optimizations (with the constraints), and then only use VASP for evaluating energies and forces.


Best,

Alexander

________________________________
From: ase-users-bounces at listserv.fysik.dtu.dk <ase-users-bounces at listserv.fysik.dtu.dk> on behalf of Michael Joseph Waters via ase-users <ase-users at listserv.fysik.dtu.dk>
Sent: Tuesday, October 20, 2020 5:06:35 PM
To: ase-users at listserv.fysik.dtu.dk
Subject: Re: [ase-users] Query for constraints atoms in VASP


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/20201021/f10590a5/attachment-0001.html>


More information about the ase-users mailing list