def test_from_functional_and_symbols(self): if "VASP_PSP_DIR" not in os.environ: test_potcar_dir = os.path.abspath( os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "test_files")) os.environ["VASP_PSP_DIR"] = test_potcar_dir p = PotcarSingle.from_symbol_and_functional("Li_sv", "PBE") self.assertEqual(p.enmax, 271.649)
def test_from_functional_and_symbols(self): if "VASP_PSP_DIR" not in os.environ: test_potcar_dir = os.path.abspath( os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", "test_files") ) os.environ["VASP_PSP_DIR"] = test_potcar_dir p = PotcarSingle.from_symbol_and_functional("Li_sv", "PBE") self.assertEqual(p.enmax, 271.649)
def test_functional_types(self): self.assertEqual(self.psingle.functional, 'PBE') self.assertEqual(self.psingle.functional_class, 'GGA') self.assertEqual(self.psingle.potential_type, 'PAW') psingle = PotcarSingle.from_file(os.path.join(test_dir, "POT_LDA_PAW", "POTCAR.Fe.gz")) self.assertEqual(psingle.functional, 'Perdew-Zunger81') self.assertEqual(psingle.functional_class, 'LDA') self.assertEqual(psingle.potential_type, 'PAW')
def get_POTCAR(poscar): list_postfix = ['_pv','_sv',''] potcar = Potcar() list_potcar_singles = [] for symbol in poscar.site_symbols: for postfix in list_postfix: potcar_path = PSEUDOPOTENTIALS_DIRECTORY+'%s%s/POTCAR'%(symbol,postfix) if os.path.isfile(potcar_path): single = PotcarSingle.from_file(potcar_path) list_potcar_singles.append(single) potcar.insert(-1,single) break return list_potcar_singles, potcar
def setUp(self): with zopen( os.path.join(test_dir, "POT_GGA_PAW_PBE", "POTCAR.Mn_pv.gz"), 'r') as f: self.psingle = PotcarSingle(f.read())
def setUp(self): #with zopen(os.path.join(test_dir, "POT_GGA_PAW_PBE", # "POTCAR.Mn_pv.gz"), 'rb') as f: self.psingle = PotcarSingle.from_file(os.path.join(test_dir, "POT_GGA_PAW_PBE", "POTCAR.Mn_pv.gz"))
def setUp(self): with zopen( os.path.join(test_dir, "POT_GGA_PAW_PBE", "POTCAR.Mn_pv.gz"), 'rb') as f: self.psingle = PotcarSingle(f.read().decode(encoding="utf-8"))