'''MgO rigid ion optimisation'''

from chemsh       import *
from chemsh.utils import testutils

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

ff = '''species
Mg core  2.0
O  core -2.0
buckingham
Mg core O core 2457.243 0.2610  0.00 0.0 10.0
O  core O core   25.410 0.6937 32.32 0.0 12.0
'''


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

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

ecalc = opt.result.energy

# Test result
eref = -6.026118995271


testutils.validate(ecalc, eref)
