QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: fangyongxinxi on December 13, 2012, 14:44

Title: Is there any tricks to control the output log file ?
Post by: fangyongxinxi on December 13, 2012, 14:44
Hello,

In the ATK-2008.10 version manual, there are some examples to show the test of input parameters, and get simple and beautful log files, such as below(page 100 in the manual):

   Energy eigenvalues for water (in eV)
-----------------------------------------
  LDA             GGA             diff
-----------------------------------------
-24.243         -24.376           0.133
-12.470         -12.442          -0.028
 -8.187          -8.129          -0.058
 -6.140          -5.988          -0.152

so my question is: is there any method to control the log output? Manytimes we just need simple log files, not all the details.

for example, I run a *.py and get  a nc file, five configurations and five Total Energies in this nc file. I just want to see the five energies in my output log file, not a very long log file. Any way can do this ?


Thanks
Title: Re: Is there any tricks to control the output log file ?
Post by: Anders Blom on December 13, 2012, 21:41
Definitely possible - but it depends on what you want. But let's say you have 5 converged calculations in a NetCDF file, and you want the total energies (which I also assume are not computed already and saved in the NC file - if they are, it's even easier), then you can do

Code: python
all_configs = nlread("file.nc")
energies = []
for config in all_configs:
    energies.append(TotalEnergy(config))
for ix,E in enumerate(energies):
    print ix, E.evaluate()

This may or may not work out-of-the-box for you, depending on if the NC file contains other things too, etc, but it should give you a starting point.
Title: Re: Is there any tricks to control the output log file ?
Post by: fangyongxinxi on December 14, 2012, 06:37
Thanks for your reply.