Пример #1
0
def Minimisation_Function(cluster, collection, cluster_name):
    cluster.pbc = False
    ####################################################################################################################
    # Perform the local optimisation method on the cluster.
    # Parameter sequence: [p, q, a, xi, r0]
    Gupta_parameters = {'Cu': [10.960, 2.2780, 0.0855, 1.224, 2.556]}
    cluster.set_calculator(Gupta(Gupta_parameters, cutoff=1000, debug=False))
    dyn = FIRE(cluster, logfile=None)
    startTime = time.time()
    converged = False
    try:
        dyn.run(fmax=0.01, steps=5000)
        converged = dyn.converged()
        if not converged:
            errorMessage = 'The optimisation of cluster ' + str(
                cluster_name) + ' did not optimise completely.'
            print(errorMessage, file=sys.stderr)
            print(errorMessage)
    except:
        print('Local Optimiser Failed for some reason.')
    endTime = time.time()
    ####################################################################################################################
    # Write information about the algorithm
    Info = {}
    Info["INFO.txt"] = ''
    Info["INFO.txt"] += ("No of Force Calls: " +
                         str(dyn.get_number_of_steps()) + '\n')
    Info["INFO.txt"] += ("Time (s): " + str(endTime - startTime) + '\n')
    #Info["INFO.txt"] += ("Cluster converged?: " + str(dyn.converged()) + '\n')
    ####################################################################################################################
    return cluster, converged, Info
Пример #2
0
def Minimisation_Function(cluster,collection,cluster_name):
	####################################################################################################################
	cluster.pbc = False
	####################################################################################################################
	# Perform the local optimisation method on the cluster.
	# Parameter sequence: [p, q, a, xi, r0]
	#Gupta_parameters = {'Au': [10.529999999999999, 4.2999999999999998, 0.21970000000000001, 1.855, 2.8779245994292486]}
	Gupta_parameters = {'Pd': [10.867, 3.742, 0.1746, 1.718, 2.7485], 'Au': [10.229, 4.036, 0.2061, 1.79, 2.884], ('Au','Pd'): [10.54, 3.89, 0.19, 1.75, 2.816]}
	cluster.set_calculator(Gupta(Gupta_parameters, cutoff=1000, debug=False))
	dyn = FIRE(cluster,logfile=None)
	startTime = time.time(); converged = False
	try:
		dyn.run(fmax=0.01,steps=5000)
		converged = dyn.converged()
		if not converged:
			errorMessage = 'The optimisation of cluster ' + str(cluster_name) + ' did not optimise completely.'
			print(errorMessage, file=sys.stderr)
			print(errorMessage)
	except Exception:
		print('Local Optimiser Failed for some reason.')
	endTime = time.time()
	####################################################################################################################
	# Write information about the algorithm
	Info = {}
	Info["INFO.txt"] = ''
	Info["INFO.txt"] += ("No of Force Calls: " + str(dyn.get_number_of_steps()) + '\n')
	Info["INFO.txt"] += ("Time (s): " + str(endTime - startTime) + '\n')
	#Info["INFO.txt"] += ("Cluster converged?: " + str(dyn.converged()) + '\n')
	####################################################################################################################
	return cluster, converged, Info
Пример #3
0
def Minimisation_Function(cluster, collection, cluster_dir):
    cluster.pbc = False
    rCut = 1000
    #sigma = 1; epsilon = 1; lj_calc = LennardJones(sigma=sigma, epsilon=epsilon,rc=rCut)
    elements = [atomic_numbers[cluster[0].symbol]]
    sigma = [1]
    epsilon = [1]
    lj_calc = LennardJones(elements, epsilon, sigma, rCut=rCut, modified=True)
    cluster.set_calculator(lj_calc)
    dyn = FIRE(cluster, logfile=None)
    startTime = time.time()
    converged = False
    try:
        dyn.run(fmax=0.01, steps=5000)
        converged = dyn.converged()
        if not converged:
            errorMessage = 'The optimisation of cluster ' + str(
                cluster_dir) + ' did not optimise completely.'
            print(errorMessage, file=sys.stderr)
            print(errorMessage)
    except Exception:
        print('Local Optimiser Failed for some reason.')
    endTime = time.time()
    # Write information about the algorithm
    Info = {}
    Info["INFO.txt"] = ''
    Info["INFO.txt"] += ("No of Force Calls: " +
                         str(dyn.get_number_of_steps()) + '\n')
    Info["INFO.txt"] += ("Time (s): " + str(endTime - startTime) + '\n')
    #Info.write("Cluster converged?: " + str(dyn.converged()) + '\n')
    return cluster, converged, Info
Пример #4
0
def Minimisation_Function(cluster,collection,cluster_dir):
	####################################################################################################################
	# Read the BeforeOpt file and record the elements, the
	# number of each element in the cluster and their positions
	#cluster = ase_read("BeforeOpt",format='vasp')
	cluster.pbc = False
	####################################################################################################################
	#Construct atoms using the ASE class "Atoms".
	####################################################################################################################
	# Perform the local optimisation method on the cluster.
	# Parameter sequence: [p, q, a, xi, r0]
	rCut = 1000
	#sigma = 1; epsilon = 1; lj_calc = LennardJones(sigma=sigma, epsilon=epsilon,rc=rCut)
	elements = [atomic_numbers[cluster[0].symbol]]; sigma = [1]; epsilon = [1]; 
	lj_calc = LennardJones(elements, epsilon, sigma, rCut=rCut, modified=True)
	cluster.set_calculator(lj_calc)
	dyn = FIRE(cluster,logfile=None)
	startTime = time.time(); converged = False
	try:
		dyn.run(fmax=0.01,steps=5000)
		converged = dyn.converged()
		if not converged:
			import os
			name = os.path.basename(os.getcwd())
			errorMessage = 'The optimisation of cluster ' + name + ' did not optimise completely.'
			print(errorMessage, file=sys.stderr)
			print(errorMessage)
	except:
		print('Local Optimiser Failed for some reason.')
	endTime = time.time()
	#ase_write('AfterOpt.traj',cluster)
	####################################################################################################################
	# Write information about the algorithm
	Info = {}
	Info["INFO.txt"] = ''
	Info["INFO.txt"] += ("No of Force Calls: " + str(dyn.get_number_of_steps()) + '\n')
	Info["INFO.txt"] += ("Time (s): " + str(endTime - startTime) + '\n')
	#Info.write("Cluster converged?: " + str(dyn.converged()) + '\n')
	####################################################################################################################
	return cluster, converged, Info
Пример #5
0
def Minimisation_Function(cluster, collection, cluster_dir):
    ####################################################################################################################
    # Read the BeforeOpt file and record the elements, the
    # number of each element in the cluster and their positions
    #cluster = ase_read("BeforeOpt",format='vasp')
    cluster.pbc = False
    ####################################################################################################################
    #Construct atoms using the ASE class "Atoms".
    ####################################################################################################################
    # Perform the local optimisation method on the cluster.
    # Parameter sequence: [p, q, a, xi, r0]
    Gupta_parameters = {'Cu': [10.960, 2.2780, 0.0855, 1.224, 2.556]}
    cluster.set_calculator(Gupta(Gupta_parameters, cutoff=1000, debug=False))
    dyn = FIRE(cluster, logfile=None)
    startTime = time.time()
    converged = False
    try:
        dyn.run(fmax=0.01, steps=5000)
        converged = dyn.converged()
        if not converged:
            import os
            name = os.path.basename(os.getcwd())
            errorMessage = 'The optimisation of cluster ' + name + ' did not optimise completely.'
            #print sys.stderr >> errorMessage
            print(errorMessage)
    except:
        print('Local Optimiser Failed for some reason.')
    endTime = time.time()
    #ase_write('AfterOpt.traj',cluster)
    ####################################################################################################################
    # Write information about the algorithm
    Info = {}
    Info["INFO.txt"] = ''
    Info["INFO.txt"] += ("No of Force Calls: " +
                         str(dyn.get_number_of_steps()) + '\n')
    Info["INFO.txt"] += ("Time (s): " + str(endTime - startTime) + '\n')
    #Info.write("Cluster converged?: " + str(dyn.converged()) + '\n')
    ####################################################################################################################
    return cluster, converged, Info
Пример #6
0
def Minimisation_Function(cluster, collection, cluster_name):
    #######################################################################################
    cluster.pbc = False  # make sure that the periodic boundry conditions are set off
    #######################################################################################
    # Perform the local optimisation method on the cluster.
    # Parameter sequence: [p, q, a, xi, r0]
    #
    # RGL parameters below from:
    # Crossover among structural motifs in transition and noble-metal clusters
    # F. Baletto, R. Ferrando, A. Fortunelli, F. Montalenti and C. Mottet, J. Chem. Phys., 2002, 116, 3856–3863.
    # https://doi.org/10.1063/1.1448484
    r0 = 4.07 / (2.0**0.5)
    Gupta_parameters = {'Au': [10.53, 4.30, 0.2197, 1.855, r0]}
    cluster.set_calculator(Gupta(Gupta_parameters, cutoff=1000, debug=False))
    dyn = FIRE(cluster, logfile=None)
    startTime = time.time()
    converged = False
    try:
        dyn.run(fmax=0.01, steps=5000)
        converged = dyn.converged()
        if not converged:
            errorMessage = 'The optimisation of cluster ' + str(
                cluster_name) + ' did not optimise completely.'
            print(errorMessage, file=sys.stderr)
            print(errorMessage)
    except Exception:
        print('Local Optimiser Failed for some reason.')
    endTime = time.time()
    ####################################################################################################################
    # Write information about the algorithm
    Info = {}
    Info["INFO.txt"] = ''
    Info["INFO.txt"] += ("No of Force Calls: " +
                         str(dyn.get_number_of_steps()) + '\n')
    Info["INFO.txt"] += ("Time (s): " + str(endTime - startTime) + '\n')
    #Info["INFO.txt"] += ("Cluster converged?: " + str(dyn.converged()) + '\n')
    ####################################################################################################################
    return cluster, converged, Info