QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: atk_user on November 28, 2014, 12:46

Title: Extract optimized structures
Post by: atk_user 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.

Title: Re: Extract optimized structures
Post by: Anders Blom 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".