dyn.run(fmax=0.00, steps=1100) #dyn = BFGS(box) #dyn.run(fmax=0.01, steps=200) #dyn = BFGS(box) #dyn.run(fmax=0.01, steps=200) Eng = struc.get_potential_energy() * 96 / len(struc) * 3 Vol = struc.get_volume() / len(struc) * 3 stress = np.max(struc.get_stress()) struc = sort(struc) try: spg = get_symmetry_dataset(struc, symprec=1e-1)['number'] except: spg = 1 struc.write(out_folder + '/' + str(i) + ".vasp", format='vasp', vasp5=True) logging.info( '{:4d} Spg: {:4d} Eng: {:8.4f} Vol: {:8.4f} Stress: {:5.2f}'.format( i, spg, Eng, Vol, stress)) abc = struc.get_cell_lengths_and_angles() abc = [int(i * 1000) / 1000 for i in abc] #data['ID'].append(i) data['Sym'].append(spg) data['Eng'].append(Eng) data['abc'].append(abc) data['Volume'].append(Vol) df = pd.DataFrame(data) df = df.sort_values(['Eng', 'Volume'], ascending=[True, True]) print(df)
from utilities import relax_atoms_cell, phonons import numpy as np # set up cell try: with open("../model-{}-test-bulk_diamond-properties.json".format( model.name)) as f: j = json.load(f) a0 = j["diamond_a0"] bulk = Atoms(diamond2(a0, 14, 14)) except: bulk = Atoms(diamond2(5.43, 14, 14)) bulk.set_calculator(model.calculator) bulk = relax_atoms_cell(bulk, tol=1.0e-4, traj_file=None) a0 = bulk.get_cell_lengths_and_angles()[0] * np.sqrt(2.0) bulk = Atoms(diamond2(a0, 14, 14)) supercell = [[4, 0, 0], [0, 4, 0], [0, 0, 4]] dx = 0.03 mesh = [16, 16, 16] points = np.array([[0, 0, 0], [0, 0.5, 0.5], [1, 1, 1], [0.5, 0.5, 0.5]]) n_points = 50 phonon_properties = phonons(model, bulk, supercell=supercell,
], # NB atomic_numbers may contain ECPs cell=[ ejp_result['final']['primitive_cell']['cell_vectors']['a']['magnitude'], ejp_result['final']['primitive_cell']['cell_vectors']['b']['magnitude'], ejp_result['final']['primitive_cell']['cell_vectors']['c']['magnitude'] ], positions=ejp_result['final']['primitive_cell']['ccoords']['magnitude'], pbc=ejp_result['final']['primitive_cell']['pbc'] ) except KeyError: logging.critical("PROBLEMATIC STRUCTURE: %s" % ejp_result['final']['primitive_cell']['symbols']) continue if not all(ejp_struct.get_pbc()): # account non-periodic directions adjust, cellpar = False, ejp_struct.get_cell_lengths_and_angles() for n in range(3): if cellpar[n] > CRYSTOUT.PERIODIC_LIMIT: adjust, cellpar[n] = True, CRYSTOUT.PERIODIC_LIMIT if adjust: ejp_struct.set_cell(cellpar) else: logging.critical("CANNOT GET EJP STRUCTURE") continue pcy_struct = pcy_result['structures'][-1] args = np.argsort(ejp_struct.positions[:, 2]) ejp_struct = ejp_struct[args] args = np.argsort(pcy_struct.positions[:, 2]) pcy_struct = pcy_struct[args]