Skip to content

Commit 68011fa

Browse files
authored
Merge pull request #125 from Chentao168/energy_qe
energy_qe
2 parents 69475d7 + bcda868 commit 68011fa

File tree

7 files changed

+663
-7
lines changed

7 files changed

+663
-7
lines changed

.github/workflows/docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# docs.yaml
2+
name: Auto update docs for master branch
3+
on:
4+
push:
5+
branches:
6+
- master
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@master
13+
14+
- name: Build and Deploy
15+
uses: JamesIves/github-pages-deploy-action@master
16+
env:
17+
ACCESS_TOKEN: ${{ secrets.BUILD_DOCS_ACCESS_TOKEN }}
18+
BRANCH: gh-pages
19+
FOLDER: html-site
20+
BUILD_SCRIPT: |
21+
apt-get install python3-pip -y &&
22+
pip3 install sphinx==1.7.5 &&
23+
pip3 install sphinxcontrib-napoleon &&
24+
pip3 install numpy &&
25+
pip3 install monty &&
26+
pip3 install m2r &&
27+
python3 setup.py install &&
28+
cd docs && make html && mv _build/html/ ../html-site && cd ..

dpdata/qe/scf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ def get_coords (lines) :
6464
return list(atom_names), atom_numbs, atom_types, coord
6565

6666
def get_energy (lines) :
67+
energy = None
6768
for ii in lines :
6869
if '! total energy' in ii :
69-
return ry2ev * float(ii.split('=')[1].split()[0])
70-
return None
70+
energy = ry2ev * float(ii.split('=')[1].split()[0])
71+
return energy
7172

7273
def get_force (lines) :
7374
blk = get_block(lines, 'Forces acting on atoms', skip = 1)

dpdata/system.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def __init__ (self,
7676
type_map = None,
7777
begin = 0,
7878
step = 1,
79-
data = None) :
79+
data = None,
80+
**kwargs) :
8081
"""
8182
Constructor
8283
@@ -120,7 +121,7 @@ def __init__ (self,
120121
return
121122
if file_name is None :
122123
return
123-
self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step)
124+
self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step, **kwargs)
124125

125126
if type_map is not None:
126127
self.apply_type_map(type_map)
@@ -1002,7 +1003,8 @@ def __init__ (self,
10021003
type_map = None,
10031004
begin = 0,
10041005
step = 1,
1005-
data=None) :
1006+
data=None,
1007+
**kwargs) :
10061008
"""
10071009
Constructor
10081010
@@ -1045,7 +1047,7 @@ def __init__ (self,
10451047
return
10461048
if file_name is None :
10471049
return
1048-
self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step)
1050+
self.from_fmt(file_name, fmt, type_map=type_map, begin= begin, step=step, **kwargs)
10491051
if type_map is not None:
10501052
self.apply_type_map(type_map)
10511053

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
'dpdata/pwmat',
3838
'dpdata/amber',
3939
'dpdata/fhi_aims',
40-
'dpdata/gromacs'],
40+
'dpdata/gromacs'
41+
],
4142
package_data={'dpdata':['*.json']},
4243
classifiers=[
4344
"Programming Language :: Python :: 3.6",

tests/qe.scf/Al.in

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
&CONTROL
2+
calculation = "scf",
3+
pseudo_dir = "../",
4+
prefix = "Aluminium",
5+
wf_collect = .True.,
6+
tstress = .True.,
7+
tprnfor = .True.,
8+
outdir = "./",
9+
iprint = 1,
10+
/
11+
&SYSTEM
12+
ibrav = 0,
13+
nat = 4,
14+
ntyp = 1,
15+
occupations ='smearing',
16+
smearing ='fermi-dirac',
17+
degauss = 0.001d0,
18+
nosym = .true.,
19+
ecutwfc = 50,
20+
nbnd = 12,
21+
/
22+
&ELECTRONS
23+
electron_maxstep = 200,
24+
mixing_mode = 'plain',
25+
conv_thr = 1.0D-8,
26+
mixing_beta = 0.7D0,
27+
/
28+
CELL_PARAMETERS (angstrom)
29+
4.04 0 0
30+
0 4.04 0
31+
0 0 4.04
32+
33+
ATOMIC_SPECIES
34+
Al 26.98 Al.pbe-n-nc.UPF
35+
36+
ATOMIC_POSITIONS (crystal)
37+
Al 0 0 0
38+
Al 0 0.5 0.5
39+
Al 0.5 0 0.5
40+
Al 0.5 0.5 0
41+
42+
K_POINTS (automatic)
43+
2 2 2 0 0 0

0 commit comments

Comments
 (0)