コード例 #1
0
ファイル: test_make_fp.py プロジェクト: LiuGroupHNU/dpgen
 def test_make_fp_vasp_from_incar(self):
     ## Verify if user chooses to diy VASP INCAR totally.
     if os.path.isdir('iter.000000'):
         shutil.rmtree('iter.000000')
     with open(param_diy_file, 'r') as fp:
         jdata = json.load(fp)
     fp.close()
     with open(machine_file, 'r') as fp:
         mdata = json.load(fp)
     fp.close()
     md_descript = []
     nsys = 2
     nmd = 3
     n_frame = 10
     for ii in range(nsys):
         tmp = []
         for jj in range(nmd):
             tmp.append(np.arange(0, 0.29, 0.29 / 10))
         md_descript.append(tmp)
     atom_types = [0, 1, 0, 1]
     type_map = jdata['type_map']
     _make_fake_md(0, md_descript, atom_types, type_map)
     make_fp_vasp(0, jdata)
     _check_sel(self, 0, jdata['fp_task_max'],
                jdata['model_devi_f_trust_lo'],
                jdata['model_devi_f_trust_hi'])
     _check_poscars(self, 0, jdata['fp_task_max'], jdata['type_map'])
     _check_incar_exists(self, 0)
     _check_incar(self, 0)
     _check_kpoints_exists(self, 0)
     _check_kpoints(self, 0)
     _check_potcar(self, 0, jdata['fp_pp_path'], jdata['fp_pp_files'])
     shutil.rmtree('iter.000000')
コード例 #2
0
 def test_make_fp_vasp_less_sel(self):
     if os.path.isdir('iter.000000') :
         shutil.rmtree('iter.000000')
     with open (param_file, 'r') as fp :
         jdata = json.load (fp)
     with open (machine_file, 'r') as fp:
         mdata = json.load (fp)
     md_descript = []
     nsys = 1
     nmd = 1
     n_frame = 8
     for ii in range(nsys) :
         tmp = []
         for jj in range(nmd) :
             tmp.append(np.arange(0, 0.29, 0.29/10))
         md_descript.append(tmp)
     atom_types = [0, 1, 0, 1]
     type_map = jdata['type_map']
     _make_fake_md(0, md_descript, atom_types, type_map)
     make_fp_vasp(0, jdata)
     _check_sel(self, 0, jdata['fp_task_max'], jdata['model_devi_f_trust_lo'], jdata['model_devi_f_trust_hi'])
     _check_poscars(self, 0, jdata['fp_task_max'], jdata['type_map'])
     _check_incar_exists(self, 0)
     _check_incar(self, 0)
     _check_potcar(self, 0, jdata['fp_pp_path'], jdata['fp_pp_files'])
     shutil.rmtree('iter.000000')