def setUp(self): _jdata = { "structures": ["confs/mp-141"], "interaction": { "type": "vasp", "incar": "vasp_input/INCAR.rlx", "potcar_prefix": ".", "potcars": { "Yb": "vasp_input/POTCAR" } }, "properties": [{ "type": "surface", "min_slab_size": 10, "min_vacuum_size": 11, "pert_xz": 0.01, "max_miller": 1, "cal_type": "relaxation" }] } self.equi_path = 'confs/mp-141/relaxation/relax_task' self.source_path = 'equi/vasp' self.target_path = 'confs/mp-141/surface_00' if not os.path.exists(self.equi_path): os.makedirs(self.equi_path) self.confs = _jdata["structures"] self.inter_param = _jdata["interaction"] self.prop_param = _jdata['properties'] self.surface = Surface(_jdata['properties'][0])
def make_property_instance(paramters): """ Make an instance of Property """ prop_type = paramters['type'] if prop_type == 'eos': return EOS(paramters) elif prop_type == 'elastic': return Elastic(paramters) elif prop_type == 'vacancy': return Vacancy(paramters) elif prop_type == 'interstitial': return Interstitial(paramters) elif prop_type == 'surface': return Surface(paramters) else: raise RuntimeError(f'unknown property type {prop_type}')