# Partitions the solid-sate MgO cluster using the ionic embedding model

# Initialize py-chemshell
from chemsh import * 

# Loads the solid-state MgO cluster constructed in the 'construct_cluster' script
mgo = Fragment(coords='ss-mgo_shells_cluster.pun', connect_mode='ionic')

# Defines atoms to be in the QM region
n = 7
qm_region= range(0,n)

# Partitioning the cluster
regions = mgo.partition(qm_region=qm_region, cutoff_boundary=6.0, 
                        radius_active=12.0, origin=0, 
                        qmmm_interface='explicit', interface_exclude=["O"])

# Saving the new partioned cluster to disc
regions.save('ss-mgo_shells_regions.pun', 'pun')
regions.save('ss-mgo_shells_regions.xyz', 'xyz')

