Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
38b2eb6
Merge branch 'dispatcher' of https://github.com/amcadmus/dpgen into d…
njzjz Sep 9, 2019
262cd4f
Merge pull request #8 from deepmodeling/devel
BaozCWJ Sep 24, 2019
9566641
Update cmpt_06_phonon.py
BaozCWJ Sep 24, 2019
a92ec14
Merge branch 'devel' of github.com:njzjz/dpgen into devel
njzjz Sep 25, 2019
925ab17
Merge branch 'devel' of https://github.com/deepmodeling/dpgen into devel
njzjz Sep 25, 2019
cb51045
Merge pull request #9 from deepmodeling/devel
BaozCWJ Oct 3, 2019
11ad4b4
Update cmpt_06_phonon.py
BaozCWJ Oct 3, 2019
3b822e7
Update cmpt_01_eos.py
BaozCWJ Oct 3, 2019
8b7cea3
Update cmpt_02_elastic.py
BaozCWJ Oct 3, 2019
a5f68b9
Update cmpt_05_surf.py
BaozCWJ Oct 3, 2019
6f356f7
new class AWS
felix5572 Oct 6, 2019
4ad4868
Merge pull request #130 from felix5572/devel
AnguseZhang Oct 6, 2019
f4cc011
mv tools. nicer brief report
Oct 6, 2019
fe495b7
fix bug: record job_uuid for lazy mode in pmap
Oct 6, 2019
5e9fbbc
Merge pull request #131 from amcadmus/devel
amcadmus Oct 6, 2019
f2b3e59
brief report total number of explored configs of a system
Oct 6, 2019
9e1e316
AWS support restrat
felix5572 Oct 6, 2019
bc6a300
provide run/report, which reports the number of labels for systems an…
Oct 6, 2019
dd05827
update .gitignores
Oct 6, 2019
109487d
fix bug in unittest for tools
Oct 6, 2019
2154ede
Merge pull request #132 from felix5572/devel
amcadmus Oct 6, 2019
a5e50a1
Merge pull request #133 from amcadmus/devel
amcadmus Oct 7, 2019
53bd443
build surface by using ASE interface
haidi-ustc Oct 7, 2019
c23d1d0
Merge pull request #134 from haidi-ustc/devel
amcadmus Oct 7, 2019
e374f42
bugfix
njzjz Oct 9, 2019
8d884cd
Merge pull request #135 from njzjz/patch-4
amcadmus Oct 9, 2019
c3bf692
cleanup the generator/lib/vasp
Oct 9, 2019
7394758
add auto calculator for nbands. not extensively tested!
Oct 9, 2019
e093d89
add an example
njzjz Oct 9, 2019
6a72939
Merge pull request #136 from njzjz/patch-1
amcadmus Oct 9, 2019
8f09038
make vasp incar with ele temp
Oct 10, 2019
6f2999c
enable nbands estimate
Oct 10, 2019
c869b8e
save temp_ele as fparam if there is any. Stop dangerous exception pas…
Oct 10, 2019
de95823
support for ele temp
Oct 13, 2019
905e872
add missing files and links
Oct 14, 2019
1ff8cb5
add missing file
Oct 14, 2019
c7e871e
add missing file
Oct 14, 2019
4e056e9
add missing file
Oct 14, 2019
94132dd
Merge pull request #138 from amcadmus/devel
amcadmus Oct 14, 2019
f8b4abf
fix_bug
Silvia-liu Oct 14, 2019
e4725a1
make slurm & decide_machine compatible with deepmdkit1.0
Oct 14, 2019
82acbde
remove extra comma
njzjz Oct 14, 2019
4ed105e
Merge pull request #139 from LiuGroupHNU/devel
amcadmus Oct 14, 2019
ebf6ec0
Merge pull request #141 from njzjz/patch-2
amcadmus Oct 14, 2019
fa3ddbf
Merge pull request #140 from AnguseZhang/devel
amcadmus Oct 14, 2019
348724d
make init_data compatible with dispatcher
Oct 15, 2019
599fefb
make init_data compatible with dispatcher
Oct 15, 2019
7d2a22d
Make init_bulk compatible with dispatcher
Oct 15, 2019
b4fa249
Update Readme & Machine in init_bulk can be None
AnguseZhang Oct 15, 2019
acdbc71
Merge pull request #142 from AnguseZhang/devel
AnguseZhang Oct 15, 2019
d526ef4
support atom param
Oct 15, 2019
9cb3b48
example for atom param
Oct 15, 2019
603ac84
readme for electron temperature
Oct 15, 2019
fb3a6da
Merge pull request #144 from amcadmus/devel
amcadmus Oct 15, 2019
523f5d3
unittest for make_train for deepmd-kit > v1.0, test fparam and aparam
Oct 15, 2019
95cc617
Merge remote-tracking branch 'upstream/devel' into devel
Oct 15, 2019
cc872c1
fix bug
Oct 15, 2019
93368a3
Merge pull request #145 from amcadmus/devel
amcadmus Oct 15, 2019
eee6fa2
AWS bug fix
felix5572 Oct 16, 2019
7891e20
Merge pull request #146 from felix5572/devel
amcadmus Oct 17, 2019
d27540d
AWS bug fixed 2
felix5572 Oct 18, 2019
e98eca6
add an example machine.json file for lsf
Cloudac7 Oct 18, 2019
f2586a5
comment for GPU part
Cloudac7 Oct 18, 2019
ddbeee7
Merge pull request #147 from Cloudac7/devel
amcadmus Oct 18, 2019
f4d2a61
auto scan file and write param.json
felix5572 Oct 19, 2019
f5fd1bf
modify AWS logic
felix5572 Oct 19, 2019
5dd77a5
update gen.py and surf.py
haidi-ustc Oct 20, 2019
d531712
Merge pull request #148 from haidi-ustc/devel
amcadmus Oct 20, 2019
faf9456
Merge pull request #10 from deepmodeling/devel
BaozCWJ Oct 22, 2019
d35990c
Merge pull request #150 from BaozCWJ/master
amcadmus Oct 22, 2019
cdcc390
fix bug: should pass the case of use_ele_temp
Oct 22, 2019
bb765a1
fix bug. unittest for no ele temp, deepmd-kit > 1.0.0
Oct 22, 2019
0401cb4
Merge pull request #151 from amcadmus/devel
amcadmus Oct 22, 2019
c02b77d
aws modify
felix5572 Oct 22, 2019
75ed032
bug fix
felix5572 Oct 24, 2019
91ec70f
Update cmpt_02_elastic.py
BaozCWJ Oct 24, 2019
bc71a4c
Update run.py
BaozCWJ Oct 24, 2019
fa76e70
Update cmpt_00_equi.py
BaozCWJ Oct 24, 2019
8548fee
Update cmpt_03_vacancy.py
BaozCWJ Oct 24, 2019
f15ddde
Update cmpt_04_interstitial.py
BaozCWJ Oct 24, 2019
159c750
Update cmpt_04_interstitial.py
BaozCWJ Oct 24, 2019
cb1c056
Update cmpt_05_surf.py
BaozCWJ Oct 24, 2019
6b9be07
Update gen_05_surf.py
BaozCWJ Oct 24, 2019
e36fff4
auto_gen_param
felix5572 Oct 24, 2019
0962e36
add auto gen basic paramjson & AWS bug fix
felix5572 Oct 24, 2019
3f98c53
Merge remote-tracking branch 'upstream/devel' into devel AWS bug fixe…
felix5572 Oct 24, 2019
a94f567
add insert_data
BaozCWJ Oct 24, 2019
c8a4e3f
Delete .DS_Store
BaozCWJ Oct 24, 2019
ed6b52b
Delete gen_08_dislocation.py
BaozCWJ Oct 24, 2019
267ea7f
Delete cmpt_08_dislocation.py
BaozCWJ Oct 24, 2019
1443eae
Delete commands
BaozCWJ Oct 24, 2019
b5c15d1
Update util.py
BaozCWJ Oct 24, 2019
f048c00
Update and rename param.json to deepmd_param.json
BaozCWJ Oct 24, 2019
88acf68
Create vasp_param.json
BaozCWJ Oct 24, 2019
4d4468c
Delete machine.json
BaozCWJ Oct 24, 2019
8d67a32
Delete param.yaml
BaozCWJ Oct 24, 2019
279c549
Delete machine.yaml
BaozCWJ Oct 24, 2019
327dca7
Create meam_param.json
BaozCWJ Oct 24, 2019
66fb607
Create vasp_poscar_param.json
BaozCWJ Oct 24, 2019
503d83f
Add files via upload
BaozCWJ Oct 25, 2019
bff1e2a
Add files via upload
BaozCWJ Oct 25, 2019
3a8ab95
aws bug fix 3
felix5572 Oct 25, 2019
89ed820
Merge pull request #152 from felix5572/devel
amcadmus Oct 25, 2019
f736586
modify run.py
BaozCWJ Oct 25, 2019
baedd55
support openbabel >=3.0
njzjz Oct 26, 2019
2b810d0
Update gen_01_eos.py
BaozCWJ Oct 27, 2019
63ef8fe
run/report for more properties
Oct 28, 2019
942b12e
fix bug in unittest
Oct 28, 2019
0fe2ae4
better name of test function
Oct 28, 2019
29a0e2b
Merge pull request #153 from njzjz/patch-4
amcadmus Oct 28, 2019
dae24a9
Delete .DS_Store
BaozCWJ Oct 28, 2019
c1139b1
Delete .DS_Store
BaozCWJ Oct 28, 2019
65849a5
Delete .DS_Store
BaozCWJ Oct 28, 2019
8b6dece
Delete insert_data.py
BaozCWJ Oct 28, 2019
34a82c8
Merge branch 'devel' of https://github.com/deepmodeling/dpgen into devel
njzjz Oct 28, 2019
1e3a8d4
add smtp logging
njzjz Oct 28, 2019
ee7d97f
add queue for smtp logging
njzjz Oct 28, 2019
7355c03
calculate time and iteration info
felix5572 Oct 28, 2019
d4187d6
time && iteration info
felix5572 Oct 28, 2019
ed8f894
Merge pull request #155 from njzjz/smtp
amcadmus Oct 29, 2019
f68ed9f
Merge pull request #154 from BaozCWJ/master
amcadmus Oct 29, 2019
6f5a248
Converge database interface and provide examples.
Oct 29, 2019
0e9dd10
rename update_time.py to .sh
felix5572 Oct 29, 2019
a1243d6
Merge remote-tracking branch 'upstream/devel' into devel
felix5572 Oct 29, 2019
41b6e46
Unittest for database
Oct 29, 2019
420b41d
Unittest for database
Oct 29, 2019
d0d0864
Merge pull request #159 from AnguseZhang/devel
amcadmus Oct 30, 2019
5289b98
Merge pull request #158 from felix5572/devel
amcadmus Oct 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ dpgen.egg-info
*/__pycache__
*.swp
.eggs
.coverage
dbconfig.json
46 changes: 33 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,42 @@ and if everything works, it gives
```
DeepModeling
------------
Version: 0.5.1.dev53+gddbeee7.d20191020
Date: Oct-07-2019
Path: /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/dpgen-0.5.1.dev53+gddbeee7.d20191020-py3.6.egg/dpgen

Version: 0.2.0
Path: /home/wanghan/.local/lib/python3.6/site-packages/dpgen-0.1.0-py3.6.egg/dpgen
Date: Aug 13, 2019

usage: dpgen [-h] {init_surf,init_bulk,run,test,db} ...
Dependency
------------
numpy 1.17.2 /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/numpy
dpdata 0.1.10 /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/dpdata-0.1.10-py3.6.egg/dpdata
pymatgen 2019.7.2 /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/pymatgen
monty 2.0.4 /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/monty
ase 3.17.0 /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/ase-3.17.0-py3.6.egg/ase
paramiko 2.6.0 /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/paramiko
custodian 2019.2.10 /home/me/miniconda3/envs/py363/lib/python3.6/site-packages/custodian

Description
------------
usage: dpgen [-h] {init_surf,init_bulk,run,run/report,test,db} ...

dpgen is a convenient script that uses DeepGenerator to prepare initial data,
drive DeepMDkit and analyze results. This script works based on several sub-
commands with their own options. To see the options for the sub-commands, type
"dpgen sub-command -h".

positional arguments:
{init_surf,init_bulk,run,test,db}
{init_surf,init_bulk,run,run/report,test,db}
init_surf Generating initial data for surface systems.
init_bulk Generating initial data for bulk systems.
run Main process of Deep Generator.
run Main process of Deep Potential Generator.
run/report Report the systems and the thermodynamic conditions of
the labeled frames.
test Auto-test for Deep Potential.
db Collecting data from DP-GEN.

db Collecting data from Deep Generator.

optional arguments:
-h, --help show this help message and exit

```


Expand All @@ -108,8 +121,10 @@ optional arguments:
You may prepare initial data for bulk systems with VASP by:

```bash
dpgen init_bulk PARAM MACHINE
dpgen init_bulk PARAM [MACHINE]
```
The MACHINE configure file is optional. If this parameter exists, then the optimization
tasks or MD tasks will be submitted automatically according to MACHINE.json.

Basically `init_bulk` can be devided into four parts , denoted as `stages` in `PARAM`:
1. Relax in folder `00.place_ele`
Expand All @@ -119,6 +134,8 @@ Basically `init_bulk` can be devided into four parts , denoted as `stages` in `P

All stages must be **in order**. One doesn't need to run all stages. For example, you may run stage 1 and 2, generating supercells as starting point of exploration in `dpgen run`.

If MACHINE is None, there should be only one stage in stages. Corresponding tasks will be generated, but user's intervention should be involved in, to manunally run the scripts.

Following is an example for `PARAM`, which generates data from a typical structure hcp.
```json
{
Expand Down Expand Up @@ -176,8 +193,10 @@ The bold notation of key (such as **Elements**) means that it's a necessary key.
You may prepare initial data for surface systems with VASP by:

```bash
dpgen init_surf PARAM MACHINE
dpgen init_surf PARAM [MACHINE]
```
The MACHINE configure file is optional. If this parameter exists, then the optimization
tasks or MD tasks will be submitted automatically according to MACHINE.json.

Basically `init_surf` can be devided into two parts , denoted as `stages` in `PARAM`:
1. Build specific surface in folder `00.place_ele`
Expand All @@ -199,7 +218,7 @@ Following is an example for `PARAM`, which generates data from a typical structu
2,
2
],
"z_min": 9,
"layer_numb": 3,
"vacuum_max": 9,
"vacuum_resol": [
0.5,
Expand Down Expand Up @@ -251,7 +270,7 @@ The bold notation of key (such as **Elements**) means that it's a necessary key.
| **Elements** | List of String | ["Mg"] | Atom types
| **cell_type** | String | "hcp" | Specifying which typical structure to be generated. **Options** include fcc, hcp, bcc, sc, diamond.
| **latt** | Float | 4.479 | Lattice constant for single cell.
| **z_min** | Float | 9 | Thickness of slab (Angstrom).
| **layer_numb** | Integer | 3 | Number of equavilent layers of slab.
| **vacuum_max** | Float | 9 | Maximal thickness of vacuum (Angstrom).
| **vacuum_resol** | List of float | [0.5, 1 ] | Interval of thichness of vacuum. If size of `vacuum_resol` is 1, the interval is fixed to its value. If size of `vacuum_resol` is 2, the interval is `vacuum_resol[0]` before `mid_point`, otherwise `vacuum_resol[1]` after `mid_point`.
| **millers** | List of list of Integer | [[1,0,0]] | Miller indices.
Expand Down Expand Up @@ -431,6 +450,7 @@ The bold notation of key (such aas **type_map**) means that it's a necessary key
| *#Basics*
| **type_map** | List of string | ["H", "C"] | Atom types
| **mass_map** | List of float | [1, 12] | Standard atom weights.
| **use_ele_temp** | int | 0 | Currently only support fp_style vasp. 0(default): no electron temperature. 1: eletron temperature as frame parameter. 2: electron temperature as atom parameter.
| *#Data*
| init_data_prefix | String | "/sharedext4/.../data/" | Prefix of initial data directories
| ***init_data_sys*** | List of string|["CH4.POSCAR.01x01x01/.../deepmd"] |Directories of initial data. You may use either absolute or relative path here.
Expand Down
2 changes: 2 additions & 0 deletions dpgen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_date.py
_version.py
File renamed without changes.
3 changes: 2 additions & 1 deletion dpgen/auto_test/cmpt_00_equi.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def comput_lmp_nev(conf_dir, task_name, write_stable = False) :
return None, None, None

def comput_vasp_nev(jdata, conf_dir, write_stable = False) :
kspacing = jdata['vasp_params']['kspacing']

conf_path = re.sub('confs', global_equi_name, conf_dir)
conf_path = os.path.abspath(conf_path)
poscar = os.path.join(conf_path, 'POSCAR')
Expand All @@ -59,6 +59,7 @@ def comput_vasp_nev(jdata, conf_dir, write_stable = False) :
if 'relax_incar' in jdata.keys():
vasp_str='vasp-relax_incar'
else:
kspacing = jdata['vasp_params']['kspacing']
vasp_str='vasp-k%.2f' % kspacing

ener_shift = comput_e_shift(poscar, vasp_str)
Expand Down
44 changes: 30 additions & 14 deletions dpgen/auto_test/cmpt_01_eos.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
#!/usr/bin/env python3

import os, glob, argparse, json, re
import dpgen.auto_test.lib.util as util
import dpgen.auto_test.lib.lammps as lammps
import dpgen.auto_test.lib.vasp as vasp

global_task_name = '01.eos'

def comput_lmp_eos(conf_dir, task_name) :
def comput_lmp_eos(jdata,conf_dir, task_name) :
conf_path = re.sub('confs', global_task_name, conf_dir)
conf_path = os.path.abspath(conf_path)
conf_path = os.path.join(conf_path, task_name)
vol_paths = glob.glob(os.path.join(conf_path, 'vol-*'))
vol_paths.sort()
result = os.path.join(conf_path,'result')
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)
print(vpa, epa)
with open(result,'w') as fp:
fp.write('conf_dir:%s\n VpA(A^3) EpA(eV)\n'% (conf_dir))
for ii in vol_paths :
log_lammps = os.path.join(ii, 'log.lammps')
natoms, epa, vpa = lammps.get_nev(log_lammps)
print(vpa, epa)
fp.write('%7.3f %8.4f \n' % (vpa,epa))
fp.close()
if 'upload_username' in jdata.keys() and task_name =='deepmd':
upload_username=jdata['upload_username']
util.insert_data('eos','deepmd',upload_username,result)

def comput_vasp_eos(jdata, conf_dir) :
conf_path = re.sub('confs', global_task_name, conf_dir)
Expand All @@ -30,17 +39,25 @@ def comput_vasp_eos(jdata, conf_dir) :
task_path = os.path.join(conf_path, vasp_str)
vol_paths = glob.glob(os.path.join(task_path, 'vol-*'))
vol_paths.sort()
result = os.path.join(task_path,'result')
print('Vpa(A^3)\tEpA(eV)')
for ii in vol_paths :
outcar = os.path.join(ii, 'OUTCAR')
natoms, epa, vpa = vasp.get_nev(outcar)
print(vpa, epa)
with open(result,'w') as fp:
fp.write('conf_dir:%s\n VpA(A^3) EpA(eV)\n'% (conf_dir))
for ii in vol_paths :
outcar = os.path.join(ii, 'OUTCAR')
natoms, epa, vpa = vasp.get_nev(outcar)
print(vpa, epa)
fp.write('%7.3f %8.4f \n' % (vpa,epa))
fp.close()
if 'upload_username' in jdata.keys():
upload_username=jdata['upload_username']
util.insert_data('eos','vasp',upload_username,result)

def _main():
parser = argparse.ArgumentParser(
description="cmpt 01.eos")
parser.add_argument('TASK', type=str,
choices = ['vasp', 'deepmd', 'meam'],
choices = ['vasp', 'deepmd', 'meam'],
help='the task of generation, vasp or lammps')
parser.add_argument('PARAM', type=str,
help='json parameter file')
Expand All @@ -52,14 +69,13 @@ def _main():
jdata = json.load (fp)

if args.TASK == 'vasp':
comput_vasp_eos(jdata, args.CONF)
comput_vasp_eos(jdata, args.CONF)
elif args.TASK == 'deepmd' :
comput_lmp_eos(args.CONF, args.TASK)
comput_lmp_eos(jdata,args.CONF, args.TASK)
elif args.TASK == 'meam' :
comput_lmp_eos(args.CONF, args.TASK)
comput_lmp_eos(jdata,args.CONF, args.TASK)
else :
raise RuntimeError("unknow task ", args.TASK)

if __name__ == '__main__' :
_main()

56 changes: 40 additions & 16 deletions dpgen/auto_test/cmpt_02_elastic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,33 @@
import numpy as np
import dpgen.auto_test.lib.vasp as vasp
import dpgen.auto_test.lib.lammps as lammps
import dpgen.auto_test.lib.util as util
from pymatgen.analysis.elasticity.elastic import ElasticTensor
from pymatgen.analysis.elasticity.strain import Strain
from pymatgen.analysis.elasticity.stress import Stress

global_equi_name = '00.equi'
global_task_name = '02.elastic'

def print_et (et):
def result_et(et,conf_dir,result):
with open(result,'w') as fp:
fp.write('conf_dir:%s\n'% (conf_dir))
for ii in range(6) :
for jj in range(6) :
fp.write ("%7.2f " % (et.voigt[ii][jj] / 1e4))
fp.write('\n')
BV = et.k_voigt / 1e4
GV = et.g_voigt / 1e4
EV = 9*BV*GV/(3*BV+GV)
uV = 0.5*(3*BV-2*GV)/(3*BV+GV)
fp.write("# Bulk Modulus BV = %.2f GPa\n" % (BV))
fp.write("# Shear Modulus GV = %.2f GPa\n" % (GV))
fp.write("# Youngs Modulus EV = %.2f GPa\n" % (EV))
fp.write("# Poission Ratio uV = %.2f \n" % (uV))
fp.close()


def print_et (et):
for ii in range(6) :
for jj in range(6) :
sys.stdout.write ("%7.2f " % (et.voigt[ii][jj] / 1e4))
Expand All @@ -27,17 +46,15 @@ def print_et (et):
print("# Poission Ratio uV = %.2f " % (uV))

def cmpt_vasp(jdata, conf_dir) :
fp_params = jdata['vasp_params']
kspacing = fp_params['kspacing']
kgamma = fp_params['kgamma']

conf_path = os.path.abspath(conf_dir)
conf_poscar = os.path.join(conf_path, 'POSCAR')
task_path = re.sub('confs', global_task_name, conf_path)
if 'relax_incar' in jdata.keys():
vasp_str='vasp-relax_incar'
else:
vasp_str='vasp-k%.2f' % kspacing
fp_params = jdata['vasp_params']
kspacing = fp_params['kspacing']
vasp_str='vasp-k%.2f' % kspacing
task_path = os.path.join(task_path, vasp_str)

equi_stress = Stress(np.loadtxt(os.path.join(task_path, 'equi.stress.out')))
Expand All @@ -55,14 +72,16 @@ def cmpt_vasp(jdata, conf_dir) :
et = ElasticTensor.from_independent_strains(lst_strain, lst_stress, eq_stress = equi_stress, vasp = False)
# et = ElasticTensor.from_independent_strains(lst_strain, lst_stress, eq_stress = None)
# bar to GPa
# et = -et / 1e4
# et = -et / 1e4
print_et(et)
result = os.path.join(task_path,'result')
result_et(et,conf_dir,result)
if 'upload_username' in jdata.keys():
upload_username=jdata['upload_username']
util.insert_data('elastic','vasp',upload_username,result)

def cmpt_deepmd_lammps(jdata, conf_dir, task_name) :
deepmd_model_dir = jdata['deepmd_model_dir']
deepmd_type_map = jdata['deepmd_type_map']
ntypes = len(deepmd_type_map)

def cmpt_deepmd_lammps(jdata, conf_dir, task_name) :
conf_path = os.path.abspath(conf_dir)
conf_poscar = os.path.join(conf_path, 'POSCAR')
task_path = re.sub('confs', global_task_name, conf_path)
Expand All @@ -82,8 +101,15 @@ def cmpt_deepmd_lammps(jdata, conf_dir, task_name) :
et = ElasticTensor.from_independent_strains(lst_strain, lst_stress, eq_stress = equi_stress, vasp = False)
# et = ElasticTensor.from_independent_strains(lst_strain, lst_stress, eq_stress = None)
# bar to GPa
# et = -et / 1e4
# et = -et / 1e4
print_et(et)
result = os.path.join(task_path,'result')
result_et(et,conf_dir,task_path)
if 'upload_username' in jdata.keys() and task_name=='deepmd':
upload_username=jdata['upload_username']
util.insert_data('elastic','deepmd',upload_username,result)



def _main() :
parser = argparse.ArgumentParser(
Expand All @@ -101,15 +127,13 @@ def _main() :

print('# generate %s task with conf %s' % (args.TASK, args.CONF))
if args.TASK == 'vasp':
cmpt_vasp(jdata, args.CONF)
cmpt_vasp(jdata, args.CONF)
elif args.TASK == 'deepmd' :
cmpt_deepmd_lammps(jdata, args.CONF, args.TASK)
elif args.TASK == 'meam' :
cmpt_deepmd_lammps(jdata, args.CONF, args.TASK)
else :
raise RuntimeError("unknow task ", args.TASK)

if __name__ == '__main__' :
_main()


2 changes: 0 additions & 2 deletions dpgen/auto_test/cmpt_03_vacancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def comput_e_shift(poscar, task_name) :
return ener_shift

def cmpt_vasp(jdata, conf_dir, supercell) :
fp_params = jdata['vasp_params']
kspacing = fp_params['kspacing']

if 'relax_incar' in jdata.keys():
vasp_str='vasp-relax_incar'
Expand Down
6 changes: 1 addition & 5 deletions dpgen/auto_test/cmpt_04_interstitial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def cmpt_vasp(jdata, conf_dir, supercell, insert_ele) :
_cmpt_vasp(jdata, conf_dir, supercell, ii)

def _cmpt_vasp(jdata, conf_dir, supercell, insert_ele) :
fp_params = jdata['vasp_params']
kspacing = fp_params['kspacing']

if 'relax_incar' in jdata.keys():
vasp_str='vasp-relax_incar'
Expand Down Expand Up @@ -56,12 +54,10 @@ def cmpt_deepmd_reprod_traj(jdata, conf_dir, supercell, insert_ele, task_name) :
_cmpt_deepmd_reprod_traj(jdata, conf_dir, supercell, ii, task_name)

def _cmpt_deepmd_reprod_traj(jdata, conf_dir, supercell, insert_ele, task_name) :
fp_params = jdata['vasp_params']
kspacing = fp_params['kspacing']

if 'relax_incar' in jdata.keys():
vasp_str='vasp-relax_incar'
else:
kspacing = jdata['vasp_params']['kspacing']
vasp_str='vasp-k%.2f' % kspacing

conf_path = os.path.abspath(conf_dir)
Expand Down
Loading