# Unprotonated n-butanol
# using amber ff and scale { 0.5 0.5 }
#
# TWK 20/10/2021: note as this test reads in a DL_POLY format force field file
# directly without any processing, the 0.5 0.5 scaling is incorporated into
# the field file (rather than applied using the scale14 option as in the
# corresponding Tcl-ChemShell test)
#

from chemsh       import *
from chemsh.utils import testutils

butanol = Fragment(coords='butanol.cjson')

mm = DL_POLY(frag=butanol, ff='butanol.ff')

opt = Opt(theory=mm, 
          algorithm='lbfgs', tolerance=0.0003, trust_radius='energy',
          maxcycle=400, maxene=300).run()

ecalc = opt.result.energy

# Test result from Tcl-ChemShell
# cf GULP 0.01715176
eref = 0.0171513841

testutils.validate(ecalc, eref)
