# ORCA DFT (BLYP) single point energy

from chemsh       import *
from chemsh.utils import testutils

water = Fragment(coords='another_water.xyz')

str_buff = '''
! ri-mp2 def2-TZVPP def2/J def2-TZVPP/C RIJCOSX extremescf
! engrad
! normalprint
! printgap

# scf specifications
%scf
    hftyp rhf
    scfmode direct
    maxiter 100
end
'''

# freetext_only=True to replace the normal input blocks generated by ChemShell
# with freetext while restart and geometry are left determined by ChemShell;
# otherwise freetext is only used as an insertion (prior to normal input blocks)
orca = ORCA(frag=water, freetext=str_buff, freetext_only=True)

# alternatively, a filename of a file containing the freetext input can be used, e.g.:
#orca = ORCA(frag=water, freetext='my_orca_freetext.txt')

sp = SP(theory=orca).run()

ecalc = sp.result.energy

# standalone ORCA v5.0.4
eref = -76.272526001870

testutils.validate(ecalc, eref)
