Author Topic: Constraints_data parameter in function "writePOSCAR"  (Read 3442 times)

0 Members and 1 Guest are viewing this topic.

Offline sukhito teh

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: tw
  • Reputation: 1
    • View Profile
Dear developers and users,
I am using QATK Version: T-2022.03 . May I know how can I pass information to parameter 'constrained_data' within the 'writePOSCAR' function? Thanks for your attention.

best regards
Sukhito Teh

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5574
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Constraints_data parameter in function "writePOSCAR"
« Reply #1 on: April 12, 2024, 23:44 »
It requires 2 steps. 1) Define constraints via tags. Supported tags are "constrain" and "constrain_x" (y, z) in order to constrain each atom fully or only in x/y/z 2) Use a few lines of code
Code: python
from AddOns.VASPPlugins.Scripter.VASPConstraintsWidget import extractConstraintsFromTags
from AddOns.VASPPlugins.IO import writePOSCAR
vasp_constraints = extractConstraintsFromTags(configuration)
writePOSCAR(configuration, "POSCAR", vasp_constraints)
Example config attached, with the resulting POSCAR. Note that you can also do this directly from the Builder, using Export and choosing the VASP format.

Offline sukhito teh

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Country: tw
  • Reputation: 1
    • View Profile
Re: Constraints_data parameter in function "writePOSCAR"
« Reply #2 on: April 15, 2024, 11:48 »
Thanks for your reply.