'''MgO shell model optimisation'''

from chemsh       import *
from chemsh.utils import testutils

mgo = Fragment(coords="mgo.cjson", shellatoms=[0,1,2,3,4,5,6,7])

ff = '''species
Mg core  1.580
Mg shel  0.420
O  core  0.513
O  shel -2.513
buckingham
Mg shel O shel 2457.243 0.2610  0.00 0.0 10.0
O  shel O shel   25.410 0.6937 32.32 0.0 12.0
spring
Mg 349.95
O   20.53
'''


mm = GULP(frag=mgo, ff=ff)

opt = Opt(theory=mm)
opt.run()

ecalc = opt.result.energy

# Test result
eref = -6.026118994974


testutils.validate(ecalc, eref)
