Author Topic: Extract optimized structures  (Read 2085 times)

0 Members and 1 Guest are viewing this topic.

Offline atk_user

  • Heavy QuantumATK user
  • ***
  • Posts: 48
  • Country: 00
  • Reputation: 0
    • View Profile
Extract optimized structures
« on: November 28, 2014, 12:46 »
Dear, all

Is it possible to extract the optimized geometry file (.py) in the linux command line using Python script after complete the geometry optimization?
I know it is possible to extract the geometry in the VNL but this process is not handy in the linux.


Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5558
  • Country: dk
  • Reputation: 91
    • View Profile
    • QuantumATK at Synopsys
Re: Extract optimized structures
« Reply #1 on: November 28, 2014, 13:34 »
For any configuration, you can extract the Python code defining it using the (semi-secret) method _script(). So, you could do
Code: python
optimized_config=nlread("file.nc", BulkConfiguration)[-1]
with open("new_script.py", "w") as f:
    f.write(optimized_config._script())
to write a Python file corresponding to the LAST configuration in the file "file.nc".