Skip to content

Commit 4521007

Browse files
committed
test(integrate): add the test of output of out_wfc_pw
1 parent 4b9442b commit 4521007

File tree

7 files changed

+75
-0
lines changed

7 files changed

+75
-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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
107_PW_OB_outputbands
3131
107_PW_OD_outputdos
3232
107_PW_outWfcR
33+
107_PW_outWfcPw
3334
108_PW_RE
3435
108_PW_RE_MB
3536
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
gamma_only=`grep gamma_only INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4142
#echo $running_path
4243
base=`grep -En '(^|[[:space:]])basis_type($|[[:space:]])' INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
@@ -133,6 +134,27 @@ if ! test -z "$has_wfc_r" && [ $has_wfc_r -eq 1 ]; then
133134
done
134135
fi
135136

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

0 commit comments

Comments
 (0)