###################################################################
## Automatic test for ABINIT:                                    ##
## determine U from change of occupation on atoms upon potential ##
##  shift on atom 1                                              ##
## Fe bcc structure - ferromagnetic PAW                 DJA 2010 ##
###################################################################
 
# 2 atomic supercell
      acell  3*5.42
    chkprim  0                  # 0: do not check if uc primitive
      rprim  1.00 0.00 0.00
             0.00 1.00 0.00
             0.00 0.00 1.00
     nsppol  2        

#Definition of the atom types
     ntypat  1
      znucl  26

#Definition of the atoms
      natom  2
      typat  2*1               # atomic types
       xred
             0.0 0.0 0.0
             0.5 0.5 0.5
       ecut  8                   # Energy cutoff
  pawecutdg  40                  # pawecutdg > 2*ecut
      nband  25                  # Fe_2 minband=17

#Definition of the k-point grid
     kptopt  1                    # 1:  automatic generation of k points
      ngkpt  3 3 3                # n x n x n
    nshiftk  1
     shiftk  0.5 0.5 0.5

#Smearing
     occopt  4
     tsmear  0.05 eV

#DFT+U
    usepawu  1                    # 1 at lim dble cnt / 2 rnd m fld dle cnt
      lpawu  2                    # ang moments corrrected
       nsym  48                   # nsym&symrel: break cubic symmetry of crystal: allow 
                                  # individual ionicoccupations
     symrel   1  0  0   0  1  0   0  0  1      -1  0  0   0 -1  0   0  0 -1
             -1  0  0   0  1  0   0  0 -1       1  0  0   0 -1  0   0  0  1
             -1  0  0   0 -1  0   0  0  1       1  0  0   0  1  0   0  0 -1
              1  0  0   0 -1  0   0  0 -1      -1  0  0   0  1  0   0  0  1
              0  1  0   1  0  0   0  0  1       0 -1  0  -1  0  0   0  0 -1
              0 -1  0   1  0  0   0  0 -1       0  1  0  -1  0  0   0  0  1
              0 -1  0  -1  0  0   0  0  1       0  1  0   1  0  0   0  0 -1
              0  1  0  -1  0  0   0  0 -1       0 -1  0   1  0  0   0  0  1
              0  0  1   1  0  0   0  1  0       0  0 -1  -1  0  0   0 -1  0
              0  0 -1   1  0  0   0 -1  0       0  0  1  -1  0  0   0  1  0
              0  0 -1  -1  0  0   0  1  0       0  0  1   1  0  0   0 -1  0
              0  0  1  -1  0  0   0 -1  0       0  0 -1   1  0  0   0  1  0
              1  0  0   0  0  1   0  1  0      -1  0  0   0  0 -1   0 -1  0
             -1  0  0   0  0  1   0 -1  0       1  0  0   0  0 -1   0  1  0
             -1  0  0   0  0 -1   0  1  0       1  0  0   0  0  1   0 -1  0
              1  0  0   0  0 -1   0 -1  0      -1  0  0   0  0  1   0  1  0
              0  1  0   0  0  1   1  0  0       0 -1  0   0  0 -1  -1  0  0
              0 -1  0   0  0  1  -1  0  0       0  1  0   0  0 -1   1  0  0
              0 -1  0   0  0 -1   1  0  0       0  1  0   0  0  1  -1  0  0
              0  1  0   0  0 -1  -1  0  0       0 -1  0   0  0  1   1  0  0
              0  0  1   0  1  0   1  0  0       0  0 -1   0 -1  0  -1  0  0
              0  0 -1   0  1  0  -1  0  0       0  0  1   0 -1  0   1  0  0
              0  0 -1   0 -1  0   1  0  0       0  0  1   0  1  0  -1  0  0
              0  0  1   0 -1  0  -1  0  0       0  0 -1   0  1  0   1  0  0
    pawujat  1                    # default, the atom on which U is determined
     pawujv  0.1 eV               # default, size of the potential shift
   macro_uj  1                    # activate determination of U
   pawujrad  2.66866              # optional, radius ASA-sphere to which U should be extrapolated 

#Only to accelerate test
     irdwfk  1                    # default for macro_uj = 1                     
 #    nline  2 
 #   nnsclo  2
     tolvrs  10d-9                # default for macro_uj = 1
 
 
#Save disk space 
     prteig  0
      prtwf  0
     prtden  0


## After modifying the following section, one might need to regenerate the pickle database with runtests.py -r
#%%<BEGIN TEST_INFO>
#%% [setup]
#%% executable = abinit
#%% test_chain = tudet_1.in, tudet_2.in, tudet_3.in
#%% input_prefix = tudet_1o
#%% [files]
#%% files_to_test = 
#%%   tudet_2.out, tolnlines=  4, tolabs=  8.000e-03, tolrel=  6.500e-01, fld_options = -easy
#%% psp_files =  26fe.paw
#%% [paral_info]
#%% max_nprocs = 1
#%% [extra_info]
#%% authors = D.J. Adams
#%% keywords = PAW, LDAU
#%% description = 
#%%  Fe bcc structure - ferromagnetic PAW 
#%%  determine U from change of occupation on atoms upon potential
#%%  shift on atom 1                                              
#%%<END TEST_INFO>
