Author Topic: Is there a convenient way to constraint atoms?  (Read 2384 times)

0 Members and 1 Guest are viewing this topic.

Offline fanjiaping

  • Heavy QuantumATK user
  • ***
  • Posts: 67
  • Reputation: 0
    • View Profile
Is there a convenient way to constraint atoms?
« on: October 28, 2010, 16:51 »
   dear
     when I want to optimize the bulk of my own, it is so trivial to constraint the atoms of electrode which have so many atoms. Is there any convenient way to select the atoms which we want to constraint instead of clicking the atoms one by one using the mouse!!!!! ???

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5447
  • Country: dk
  • Reputation: 89
    • View Profile
    • QuantumATK at Synopsys
Re: Is there a convenient way to constraint atoms?
« Reply #1 on: October 28, 2010, 18:29 »
The constraint is just a list. This list can be constructed (in Python) using advanced rules, like pick out all the atoms of a particular elements, and so on. It depends on the situation, whether it's more convenient to click each one or use rules. If the atoms you want to fixate are "random" in the sense that it's an atom here and another atom over there, then clicking is easier since you get a visual feedback on which atoms you actually picked. But if it's more straightforward, then simple Python constructs is very powerful. For example, I had a carbon nanotube with a Stone-Wales defect and wanted to optimize it (as bulk) while constraining all the "outer" atom, which were the first and last 40 atoms out of the total 160 carbons. So, I did
Code
bulk_configuration = OptimizeGeometry(
        bulk_configuration,
        maximum_forces=0.05*eV/Ang,
        constraints=range(40)+range(120,160),
        trajectory_filename='sw_defect.nc',
    )
« Last Edit: October 28, 2010, 18:31 by Anders Blom »