Skip to content

Commit 801360d

Browse files
authored
Merge pull request #975 from pxlxingliang/develop
test(integrate): add the test of output of out_wfc_pw
2 parents 381e557 + a948ec7 commit 801360d

File tree

7 files changed

+76
-0
lines changed

7 files changed

+76
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
INPUT_PARAMETERS
2+
#Parameters (1.General)
3+
suffix autotest
4+
calculation scf
5+
ntype 1
6+
nbands 6
7+
symmetry 1
8+
pseudo_dir ../tools/PP_ORB/
9+
pseudo_type upf201
10+
11+
#Parameters (2.Iteration)
12+
ecutwfc 20
13+
scf_thr 1e-9
14+
scf_nmax 100
15+
16+
#Parameters (3.Basis)
17+
basis_type pw
18+
19+
out_wfc_pw 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
K_POINTS
2+
0
3+
Gamma
4+
1 1 1 0 0 0
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ATOMIC_SPECIES
2+
Si 14 Si_ONCV_PBE-1.0.upf
3+
4+
LATTICE_CONSTANT
5+
10.2 // add lattice constant
6+
7+
LATTICE_VECTORS
8+
0.5 0.5 0.0
9+
0.5 0.0 0.5
10+
0.0 0.5 0.5
11+
12+
ATOMIC_POSITIONS
13+
Direct
14+
15+
Si // Element type
16+
0.0 // magnetism
17+
2
18+
0.00 0.00 0.00 1 1 1
19+
0.25 0.25 0.25 1 1 1

tests/integrate/107_PW_outWfcPw/jd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test the output of wfc_pw, and verify the maximum absolute coefficient
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
etotref -197.1405644352783
2+
etotperatomref -98.5702822176
3+
Max_wfc_1 0.9587
4+
Max_wfc_2 0.4464
5+
Max_wfc_3 0.3321
6+
Max_wfc_4 0.4181
7+
Max_wfc_5 0.4838
8+
Max_wfc_6 0.4048
9+
totaltimeref 0.17714

tests/integrate/CASES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
106_PW_PU_chargemixing
3030
107_PW_OB_outputbands
3131
107_PW_OD_outputdos
32+
107_PW_outWfcR
33+
107_PW_outWfcPw
3234
108_PW_RE
3335
108_PW_RE_MB
3436
108_PW_RE_MG

tests/integrate/tools/catch_properties.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ deepks_out_labels=`grep deepks_out_labels INPUT | awk '{print $2}' | sed s/[[:sp
3737
deepks_bandgap=`grep deepks_bandgap INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
3838
has_lowf=`grep out_wfc_lcao INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
3939
has_wfc_r=`grep out_wfc_r INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
40+
has_wfc_pw=`grep out_wfc_pw INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4041
out_dm=`grep out_dm INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4142
out_mul=`grep out_mul INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4243
gamma_only=`grep gamma_only INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
@@ -135,6 +136,27 @@ if ! test -z "$has_wfc_r" && [ $has_wfc_r -eq 1 ]; then
135136
done
136137
fi
137138

139+
# echo "$has_wfc_pw" ## test out_wfc_pw > 0
140+
if ! test -z "$has_wfc_pw" && [ $has_wfc_pw -eq 1 ]; then
141+
if [[ ! -f OUT.autotest/WAVEFUNC1.txt ]];then
142+
echo "Can't find file OUT.autotest/WAVEFUNC1.txt"
143+
exit 1
144+
fi
145+
awk 'BEGIN {max=0;read=0;band=1}
146+
{
147+
if(read==0 && $2 == "Band" && $3 == band){read=1}
148+
else if(read==1 && $2 == "Band" && $3 == band)
149+
{printf"Max_wfc_%d %.4f\n",band,max;read =0;band+=1;max=0}
150+
else if(read==1)
151+
{
152+
for(i=1;i<=NF;i++)
153+
{
154+
if(sqrt($i*$i)>max) {max=sqrt($i*$i)}
155+
}
156+
}
157+
}' OUT.autotest/WAVEFUNC1.txt >> $1
158+
fi
159+
138160
# echo "$has_lowf" ## test out_wfc_lcao > 0
139161
if ! test -z "$has_lowf" && [ $has_lowf -eq 1 ]; then
140162
if ! test -z "$gamma_only" && [ $gamma_only -eq 1 ]; then

0 commit comments

Comments
 (0)