Skip to content

Commit

Permalink
Merge pull request #5 from BaozCWJ/master
Browse files Browse the repository at this point in the history
Update testcase and necessary comment of results
  • Loading branch information
amcadmus authored Jun 24, 2019
2 parents c2fdaf7 + fec8c9f commit 92b33ea
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions auto_test/cmpt_01_eos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def comput_lmp_eos(conf_dir, task_name) :
conf_path = os.path.join(conf_path, task_name)
vol_paths = glob.glob(os.path.join(conf_path, 'vol-*'))
vol_paths.sort()
print('Vpa(A^3)\tEpA(eV)')
for ii in vol_paths :
log_lammps = os.path.join(ii, 'log.lammps')
natoms, epa, vpa = lammps.get_nev(log_lammps)
Expand All @@ -24,6 +25,7 @@ def comput_vasp_eos(jdata, conf_dir) :
conf_path = os.path.join(conf_path, 'vasp-k%.2f' % kspacing)
vol_paths = glob.glob(os.path.join(conf_path, 'vol-*'))
vol_paths.sort()
print('Vpa(A^3)\tEpA(eV)')
for ii in vol_paths :
outcar = os.path.join(ii, 'OUTCAR')
natoms, epa, vpa = vasp.get_nev(outcar)
Expand Down
2 changes: 2 additions & 0 deletions auto_test/cmpt_03_vacancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def cmpt_vasp(jdata, conf_dir, supercell) :
struct_path_list.sort()
if len(struct_path_list) == 0:
print("# cannot find results for conf %s supercell %s" % (conf_dir, supercell))
sys.stdout.write ("Structure: \tVac_E(eV) E(eV) equi_E(eV)\n")
for ii in struct_path_list :
struct_poscar = os.path.join(ii, 'POSCAR')
energy_shift = comput_e_shift(struct_poscar, 'vasp-k%.2f' % kspacing)
Expand Down Expand Up @@ -76,6 +77,7 @@ def cmpt_deepmd_lammps(jdata, conf_dir, supercell, task_name) :
struct_path_list.sort()
if len(struct_path_list) == 0:
print("# cannot find results for conf %s supercell %s" % (conf_dir, supercell))
sys.stdout.write ("Structure: \tVac_E(eV) E(eV) equi_E(eV)\n")
for ii in struct_path_list :
struct_poscar = os.path.join(ii, 'POSCAR')
energy_shift = comput_e_shift(struct_poscar, task_name)
Expand Down
2 changes: 2 additions & 0 deletions auto_test/cmpt_04_interstitial.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _cmpt_vasp(jdata, conf_dir, supercell, insert_ele) :
struct_path_list.sort()
if len(struct_path_list) == 0:
print("# cannot find results for conf %s supercell %s" % (conf_dir, supercell))
sys.stdout.write ("Insert_ele-Struct: Inter_E(eV)\n")
for ii in struct_path_list :
structure_dir = os.path.basename(ii)
outcar = os.path.join(ii, 'OUTCAR')
Expand Down Expand Up @@ -113,6 +114,7 @@ def _cmpt_deepmd_lammps(jdata, conf_dir, supercell, insert_ele, task_name) :
struct_path_list.sort()
if len(struct_path_list) == 0:
print("# cannot find results for conf %s supercell %s" % (conf_dir, supercell))
sys.stdout.write ("Insert_ele-Struct: Inter_E(eV) E(eV) equi_E(eV)\n")
for ii in struct_path_list :
structure_dir = os.path.basename(ii)
lmp_log = os.path.join(ii, 'log.lammps')
Expand Down
2 changes: 2 additions & 0 deletions auto_test/cmpt_05_surf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def cmpt_vasp(jdata, conf_dir, static = False) :
struct_path_list.sort()
if len(struct_path_list) == 0:
print("# cannot find results for conf %s supercell %s" % (conf_dir, supercell))
sys.stdout.write ("Miller_Indices: \tSurf_E(J/m^2) EpA(eV) equi_EpA(eV)\n")
for ii in struct_path_list :
structure_dir = os.path.basename(ii)
outcar = os.path.join(ii, 'OUTCAR')
Expand Down Expand Up @@ -63,6 +64,7 @@ def cmpt_deepmd_lammps(jdata, conf_dir, task_name, static = False) :
struct_path_list.sort()
if len(struct_path_list) == 0:
print("# cannot find results for conf %s" % (conf_dir))
sys.stdout.write ("Miller_Indices: \tSurf_E(J/m^2) EpA(eV) equi_EpA(eV)\n")
for ii in struct_path_list :
structure_dir = os.path.basename(ii)
lmp_log = os.path.join(ii, 'log.lammps')
Expand Down
8 changes: 4 additions & 4 deletions auto_test/param.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"_comment": "models",
"potcar_map" : {
"Cu" : "/somewhere/POTCAR"
"Cu" : "/somewhere/example/POTCAR"
},
"conf_dir":"the folder of configuration",
"conf_dir":"confs/Cu/mp-30",
"task_type":"deepmd",
"task":"eos",
"task":"all",

"vasp_params": {
"ecut": 520,
Expand All @@ -16,7 +16,7 @@
"kpar": 1,
"_comment": " that's all "
},
"deepmd_model_dir": "the folder of deepmd model",
"deepmd_model_dir": "somewhere/example/Cu_pb",
"deepmd_type_map": [
"Cu"
],
Expand Down
3 changes: 3 additions & 0 deletions auto_test/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,14 +455,17 @@ def cmpt_equi(task_type,jdata,mdata):
#vasp
if task_type=="vasp":
vn, ve, vv = cmpt_00_equi.comput_vasp_nev(jdata, conf_dir, stable)
print('conf_dir:\t EpA(eV) VpA(A^3)')
print("%s\t %8.4f %7.3f " % (conf_dir, ve, vv))
#deepmd
elif task_type=="deepmd":
ln, le, lv = cmpt_00_equi.comput_lmp_nev(conf_dir, 'deepmd', stable)
print('conf_dir:\t EpA(eV) VpA(A^3)')
print("%s\t %8.4f %7.3f " % (conf_dir, le, lv))
#meam
elif task_type=="meam":
ln, le, lv = cmpt_00_equi.comput_lmp_nev(conf_dir, 'meam', stable)
print('conf_dir:\t EpA(eV) VpA(A^3)')
print("%s\t %8.4f %7.3f " % (conf_dir, le, lv))
else :
raise RuntimeError ("unknow task %s, something wrong" % task_type)
Expand Down

0 comments on commit 92b33ea

Please sign in to comment.