Author Topic: Is there any tricks to control the output log file ?  (Read 2838 times)

0 Members and 1 Guest are viewing this topic.

Offline fangyongxinxi

  • QuantumATK Guru
  • ****
  • Posts: 143
  • Reputation: 0
    • View Profile
Is there any tricks to control the output log file ?
« 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
« Last Edit: December 13, 2012, 15:30 by fangyongxinxi »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5576
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Is there any tricks to control the output log file ?
« Reply #1 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.

Offline fangyongxinxi

  • QuantumATK Guru
  • ****
  • Posts: 143
  • Reputation: 0
    • View Profile
Re: Is there any tricks to control the output log file ?
« Reply #2 on: December 14, 2012, 06:37 »
Thanks for your reply.