# workflow to simulate Ar in a zeolite
# this done a bit more the "chemshell way" passing arguments through the 
# command line

import sys
#import subprocess
#import numpy as np

from collections import OrderedDict

from chemsh       import *
#from chemsh.utils import testutils
#from config import CONFIG


#Import the dlmonte (htk) module with alias "dlmonte"
import htk.sources.dlmonte as dlmonte


##############################################################################
# Create a config instance by reading from file
##############################################################################
def create_config_file():

    filename = "CONFIG.original"
    cfg = dlmonte.dlconfig.from_file(filename)

    return cfg

##############################################################################
# The 'main' program starts here
##############################################################################
try:

   cfg = create_config_file()

except:

    print("error reading CONFIG file!")
    print(" ")
    sys.exit(1)


my_dlm = DL_MONTE(
                  use = ["gaspressure"],
                  steps = 10000,
                  temperature = 298,
                  equilibration = 5000,
                  noewald = 1,
                  print = 10,
                  move_atom = ["Ar core"],
                  move_atom_frequency = 80,
                  move_gcinsertatom = ["Ar core 0.002"],
                  move_gcinsertatom_frequency = 20,
                  move_gcinsertatom_min_dist = 1.8,
                  ff='FIELD.original',
                  config = cfg.to_string(),
                  path='/home/jap93/DLMONTE3/DL_MONTE-2/bin/DLMONTE-SRL-VDW_dir-opt.X',
                 )

my_dlm.run()
