def load_default_vasp(vasp: Vasp, structure=None): vasp.has_nlep = False vasp.maxiter = 100 if not vasp.kpoints: if structure == None: vasp.kpoints = "\n0\nAuto\n14" else: kpoints_density = 4000 vasp.kpoints = pylada.gen_kpts(structure, kpoints_density) vasp.program = '$VASP_PYLADA' # default vasp program try: vasp.npar = int(os.environ['PBS_NUM_NODES']) except: vasp.npar = int(os.environ['SLURM_JOB_NUM_NODES']) vasp.prec = "accurate" vasp.ediff = 1.0e-6 # total, not per atom vasp.ediffg = -0.02 vasp.addgrid = True vasp.ismear = 0 vasp.sigma = 0.01 vasp.lwave = True vasp.lcharg = True vasp.lmaxmix = 4 vasp.convergence = 1.0e-5 vasp.algo = "Normal" vasp.lorbit = 11 vasp.nsw = 5000 return (vasp)
def set_ncore_auto(vasp: Vasp, structure=None): vasp.npar = None try: vasp.add_keyword('ncore', int(os.environ['PBS_NUM_PPN'])) except: vasp.add_keyword('ncore', int(os.environ['SLURM_CPUS_ON_NODE'])) return vasp
def set_kpar_auto(vasp: Vasp, structure=None): try: nodes = int(os.environ['PBS_NUM_NODES']) procs = int(os.environ['PBS_NP']) except: nodes = int(os.environ['SLURM_JOB_NUM_NODES']) procs = int(os.environ['SLURM_NTASKS']) atoms = len(structure) if procs / atoms > 1: kpar = math.ceil(procs / atoms) * 2 print(vasp.kpoints) print(vasp.kpoints) print(vasp.kpoints) print(vasp.kpoints) print(vasp.kpoints) kpoint_str = vasp.kpoints.split('\n')[3] kpoints = [int(x) for x in kpoint_str.split()] if len(kpoints) > 1: num_kpoints = kpoints[0] * kpoints[1] * kpoints[2] else: density = kpoints[0] num_kpoints = math.ceil( density / np.linalg.norm(structure.cell[:, 0])) * math.ceil( density / np.linalg.norm(structure.cell[:, 1])) * math.ceil( density / np.linalg.norm(structure.cell[:, 2])) while kpar > 1: if num_kpoints % kpar == 0 and nodes % kpar == 0: vasp.add_keyword('kpar', kpar) vasp.npar = int(nodes / kpar) return vasp else: kpar = kpar - 1 vasp.add_keyword('kpar', 1) vasp.npar = int(nodes) return vasp
def hse06(vasp: Vasp, structure=None): vasp.nelmdl = 0 vasp.nelm = 1000 vasp.add_keyword('lhfcalc', True) vasp.precfock = 'Fast' vasp.add_keyword('hfscreen', 0.2) vasp.algo = 'All' vasp.npar = None vasp.ldau = False vasp.lwave = True vasp.lcharg = True vasp.ismear = 0 vasp.add_keyword('metagga', False) vasp.add_keyword('ncore', 8) return vasp
def set_ncore_12(vasp: Vasp, structure=None): vasp.npar = None vasp.add_keyword('ncore', 12) return vasp
def set_npar_1(vasp: Vasp, structure=None): vasp.npar = 1 return vasp
def set_npar_2(vasp: Vasp, structure=None): vasp.npar = 2 return vasp