import ase.units as units from numpy import array, linspace import matplotlib.pyplot as plt import numpy # Create the MgO crystal a = 4.194 cryst = Crystal( crystal(['Mg', 'O'], [(0, 0, 0), (0.5, 0.5, 0.5)], spacegroup=225, cellpar=[a, a, a, 90, 90, 90])) # Create the calculator running on one, eight-core node. # This is specific to the setup on my cluster. # You have to adapt this part to your environment calc = ClusterVasp(nodes=1, ppn=8) # Assign the calculator to the crystal cryst.set_calculator(calc) # Set the calculation parameters calc.set(prec='Accurate', xc='PBE', lreal=False, nsw=30, ediff=1e-8, ibrion=2, kpts=[3, 3, 3]) # Set the calculation mode first. # Full structure optimization in this case.
print(n+1,end='') while not r.get_calculator().calc_finished() : print('.',end='') sys.stdout.flush() sleep(10) print(end=' ') sys.stdout.flush() print() a=4 ; c=crystal('Si',[(0,0,0)],spacegroup=221,cellpar=[a,a,a,90,90,90]) spglib.get_spacegroup(c) block=False calc = ClusterVasp(block=block) calc.set(prec = 'Accurate', xc = 'PBE', lreal = False, nsw=30, ediff=1e-8, ibrion=2, kpts=[3,3,3]) calc.set(isif=3) c.set_calculator(calc) l=ParCalculate(c,calc,cleanup=False,block=block) s = l[0] wait_for_results(l) print(s.get_forces(), s.get_cell(), s.get_stress(), s.get_pressure())