# DFTB++ SCC optimisation

from chemsh       import *
from chemsh.utils import testutils

water = Fragment(coords="water.cjson")

dftbplus = DFTBplus(frag=water, skf_path="slakos/mio-1-1/")

opt = Opt(theory=dftbplus,
          algorithm="lbfgs", tolerance=0.0003, trust_radius="energy",
          maxcycle=100, maxene=100, maxstep=1.0)
          
opt.run()

ecalc = opt.result.energy

# Test result from DFTB+ standalone optimisation
eref = -4.077937934000


testutils.validate(ecalc, eref)
