Ejemplo n.º 1
0
def get_calibration_task(structure, phase="CalibrateBulk", \
                         slab_interface_params={'hkl':[1,0,0], 'ligand': None},\
                         turn_knobs={}, incar_params={}, other_params={}):
    """
    returns general calibration task for a structure
    
    Args:
        structure    : pymatgen structure to be calibrated (can be a bulk, ligand, slab
                       or interface)  
        phase        : calibration type, viz. CalibrateBulk, CalibrateMolecule,
                       CalibrateSlab, CalibrateInterface
        hkl          : in case of Slab and Interface miller indices of facet 
        turn_knobs   : specifies the parameters to be calibrated 
        incar_params : dictionary of additional incar parameters, refer defined 
                       incar_dict for defaults 
        other_params : other parameters for calibration, viz. job_dir, is_matrix, etc. 
                       described in the calibrate module
    """
    #structure definition 
    
    poscar = Poscar(structure)
    incar_dict = { 'SYSTEM': 'slab',
                   'ENCUT': 500, 
                   'ISIF': 2, 
                   'IBRION': 2, 
                   'ISMEAR': 1, 
                   'EDIFF': 1e-05, 
                   'NPAR': 4, 
                   'SIGMA': 0.1, 
                   'PREC': 'Accurate'
                 }
    if incar_params: 
        incar_dict.update(incar_params)
    incar = Incar.from_dict(incar_dict)
    kpoints = Kpoints.monkhorst_automatic(kpts=(8, 8, 1))
    que  = { 'nnodes':1,
             'nprocs':16,
             'walltime':'48:00:00',
             'job_bin': '/home/km468/Software/VASP/vaspsol_kappa.5.3.5/vasp'             
            }
    # calibration task: relax hkl
    calparams = {}
    calparams['calibrate'] = phase
    calparams['incar'] = incar.as_dict()
    calparams['poscar'] = poscar.as_dict()
    calparams['kpoints'] = kpoints.as_dict()
    calparams['que_params'] = que
    calparams['turn_knobs'] = turn_knobs
    if phase == 'CalibrateSlab':
         calparams['system'] = {'hkl':slab_interface_params['hkl'],
                                'ligand':slab_interface_params['ligand']
                               }
    elif phase == 'CalibrateInterface':
         calparams['system'] = {'hkl':hkl,
                                'ligand':structure.ligand.reduced_formula
                               }
    calparams['other_params'] = {
        'is_matrix':False,
        'from_ase':True,
        'Grid_type':'M'
        }
    if other_params:
        calparams['other_params'].update(other_params)
    return MPINTCalibrateTask(calparams)
Ejemplo n.º 2
0
def get_calibration_task(structure, phase="CalibrateBulk", \
                         slab_interface_params={'hkl':[1,0,0], 'ligand': None},\
                         turn_knobs={}, incar_params={}, other_params={}):
    """
    returns general calibration task for a structure
    
    Args:
        structure    : pymatgen structure to be calibrated (can be a bulk, ligand, slab
                       or interface)  
        phase        : calibration type, viz. CalibrateBulk, CalibrateMolecule,
                       CalibrateSlab, CalibrateInterface
        hkl          : in case of Slab and Interface miller indices of facet 
        turn_knobs   : specifies the parameters to be calibrated 
        incar_params : dictionary of additional incar parameters, refer defined 
                       incar_dict for defaults 
        other_params : other parameters for calibration, viz. job_dir, is_matrix, etc. 
                       described in the calibrate module
    """
    #structure definition

    poscar = Poscar(structure)
    incar_dict = {
        'SYSTEM': 'slab',
        'ENCUT': 500,
        'ISIF': 2,
        'IBRION': 2,
        'ISMEAR': 1,
        'EDIFF': 1e-05,
        'NPAR': 4,
        'SIGMA': 0.1,
        'PREC': 'Accurate'
    }
    if incar_params:
        incar_dict.update(incar_params)
    incar = Incar.from_dict(incar_dict)
    kpoints = Kpoints.monkhorst_automatic(kpts=(8, 8, 1))
    que = {
        'nnodes': 1,
        'nprocs': 16,
        'walltime': '48:00:00',
        'job_bin': '/home/km468/Software/VASP/vaspsol_kappa.5.3.5/vasp'
    }
    # calibration task: relax hkl
    calparams = {}
    calparams['calibrate'] = phase
    calparams['incar'] = incar.as_dict()
    calparams['poscar'] = poscar.as_dict()
    calparams['kpoints'] = kpoints.as_dict()
    calparams['que_params'] = que
    calparams['turn_knobs'] = turn_knobs
    if phase == 'CalibrateSlab':
        calparams['system'] = {
            'hkl': slab_interface_params['hkl'],
            'ligand': slab_interface_params['ligand']
        }
    elif phase == 'CalibrateInterface':
        calparams['system'] = {
            'hkl': hkl,
            'ligand': structure.ligand.reduced_formula
        }
    calparams['other_params'] = {
        'is_matrix': False,
        'from_ase': True,
        'Grid_type': 'M'
    }
    if other_params:
        calparams['other_params'].update(other_params)
    return MPINTCalibrateTask(calparams)