"""
chemsitry object
"""
print "chemistry solver setup..."
chemistry_obj = Chemistry(mechanism_path,composition,uniform_grid,atol,rtol)
print "Number of species:", chemistry_obj.gas.n_species, "Number of reactions:",chemistry_obj.gas.n_reactions
print "The absolute error is", chemistry_obj.network.atol, "The relative error is", chemistry_obj.network.rtol

"""
time evolution
"""
print "Initialize the composition..."
if restart == 0:
	# a new run, start from equilibrium abundances
    y = chemistry_obj.equilibrate()
    # write equilibrium values into files
    np.savetxt('./output/y_equilibrium.txt',y)
    t_0 = 0
else:
    # restart
    # read the starting time from file
    f=open('./output/time.txt','r')
    t_0=int(f.read())
    f.close()
    # read the array from file
    y = np.loadtxt('./output/y_t.txt')

print "start time evolution..."
t_start = time.time()
n_species = chemistry_obj.gas.n_species