# -*- coding: utf-8 mode: shell-script -*-

Test         : Photoelectron - PFFT
Program      : octopus
TestGroups   : long-run, photo_electron
Enabled      : Yes

# Note: the discrepancy between the numbers in test 02 and 03
# is due to the fact that we are not converged wrt the box
# parameters. The box size is optimized for quick-run (~60s)
# rather than numerical value accuracy.

# Ground state
Processors : 4
Input      : 05-pfft.01-gs.inp
match ; SCF convergence ; GREPCOUNT(static/info, 'SCF converged') ; 1
match ; Total energy   ; GREPFIELD(static/info, 'Total       =', 3) ;  -0.49919533

# Hydrogen PES spectrum mask-method
# This test basically checks the forward transform
Processors : 4
Input      : 05-pfft.02-mask.inp
if (available pfft); then
  match ; PES [val  1] ; LINEFIELD(td.general/PESM_power.sum, 23, 2) ;  8.176805667601E-07 
  match ; PES [val  2] ; LINEFIELD(td.general/PESM_power.sum, 25, 2) ;  3.449654452396E-05
  match ; PES [val  3] ; LINEFIELD(td.general/PESM_power.sum, 60, 2) ;  1.174295927407E-07
else
  match; Error; GREPCOUNT(err, 'PFFT but that library was not linked'); 1
endif

# Hydrogen PES spectrum full mask-method
# This test checks both forward and backward transforms
Processors : 4
Input      : 05-pfft.03-ba.inp
if (available pfft); then
  match ; PES [val  1] ; LINEFIELD(td.general/PESM_power.sum, 23, 2) ;  3.384099673837E-05
  match ; PES [val  2] ; LINEFIELD(td.general/PESM_power.sum, 25, 2) ;  6.990706948261E-06
  match ; PES [val  3] ; LINEFIELD(td.general/PESM_power.sum, 60, 2) ;  3.931730291888E-08
else
  match; Error; GREPCOUNT(err, 'PFFT but that library was not linked'); 1
endif