Skip to content

Commit 82cfac7

Browse files
committed
test:verify wfc_lcao by comparing file and modulo value for k
1 parent 5f510c9 commit 82cfac7

File tree

6 files changed

+77
-36
lines changed

6 files changed

+77
-36
lines changed

tests/integrate/212_NO_wfc_out/KPT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
K_POINTS
22
0
33
Gamma
4-
2 1 1 0 0 0
4+
2 2 2 0 0 0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2 (index of k points)
2+
0.5 0 0
3+
4 (number of bands)
4+
10 (number of orbitals)
5+
1 (band)
6+
-7.5019410222871296678448516e-01 (Ry)
7+
2.5000000000000000000000000e-01 (Occupations)
8+
5.3765723167e-01 3.8218176862e-02 1.5221731132e-02 4.0071877227e-16 9.1653589143e-17
9+
5.3765723167e-01 3.8218176862e-02 1.5221731132e-02 6.2032947727e-16 4.0233285419e-17
10+
2 (band)
11+
3.1880245594710293621787400e-01 (Ry)
12+
0.0000000000000000000000000e+00 (Occupations)
13+
1.8548293704e+00 5.9387380766e-01 5.0998991364e-02 1.7187830481e-15 5.1902010686e-16
14+
1.8548293704e+00 5.9387380766e-01 5.0998991364e-02 3.7651833899e-15 8.1413767428e-16
15+
3 (band)
16+
7.4890773197456428356133529e-01 (Ry)
17+
0.0000000000000000000000000e+00 (Occupations)
18+
3.4729531330e-02 5.6388252723e-01 2.3515138908e-02 5.4509816534e-16 7.9696558059e-17
19+
3.4729531330e-02 5.6388252723e-01 2.3515138908e-02 2.4597855919e-16 1.1567658709e-16
20+
4 (band)
21+
1.7025309672711679276346786e+00 (Ry)
22+
0.0000000000000000000000000e+00 (Occupations)
23+
1.1656174186e+00 8.3132172115e-01 6.6899599890e-01 7.3043375611e-17 4.4735139001e-16
24+
1.1656174186e+00 8.3132172115e-01 6.6899599890e-01 7.7616858939e-15 1.3160271902e-15
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
etotref -31.71589792622972
2-
etotperatomref -15.8579489631
3-
LOWF_K_1.dat 42.073783
4-
LOWF_K_2.dat 43.775080
5-
totaltimeref 0.46365
1+
etotref -31.68509356388398
2+
etotperatomref -15.8425467819
3+
Compare_wfc_lcao_pass 0
4+
totaltimeref 1.0112
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
4 (number of bands)
2+
10 (number of orbitals)
3+
1 (band)
4+
-7.55263470e-01 (Ry)
5+
2.00000000e+00 (Occupations)
6+
-5.37425417e-01 -3.74795101e-02 -1.54538203e-02 -2.37688521e-16 3.54115684e-17
7+
-5.37425417e-01 -3.74795101e-02 1.54538203e-02 1.54279406e-16 1.44917747e-16
8+
2 (band)
9+
3.09899194e-01 (Ry)
10+
0.00000000e+00 (Occupations)
11+
1.86256765e+00 -5.97302346e-01 5.96725551e-02 -6.23564801e-16 -5.34419146e-16
12+
-1.86256765e+00 5.97302346e-01 5.96725551e-02 -2.37046630e-15 4.71793482e-16
13+
3 (band)
14+
7.10737313e-01 (Ry)
15+
0.00000000e+00 (Occupations)
16+
-3.70863868e-02 -5.60684875e-01 -2.11552829e-02 -6.35425051e-16 7.85812296e-17
17+
-3.70863868e-02 -5.60684875e-01 2.11552829e-02 -1.57505004e-16 2.12723506e-17
18+
4 (band)
19+
1.64212616e+00 (Ry)
20+
0.00000000e+00 (Occupations)
21+
1.12646038e+00 -7.97443862e-01 6.74466345e-01 -4.65132017e-15 -3.58731090e-16
22+
-1.12646038e+00 7.97443862e-01 6.74466345e-01 -4.81336266e-15 5.65467342e-16
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
etotref -31.72917767963950
1+
etotref -31.72917767963902
22
etotperatomref -15.8645888398
3-
LOWF_GAMMA_S1.dat 42.072421
4-
totaltimeref 0.47445
3+
Compare_wfc_lcao_pass 0
4+
totaltimeref 2.8421

tests/integrate/tools/catch_properties.sh

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,17 @@ if ! test -z "$has_hs" && [ $has_hs -eq 1 ]; then
124124
fi
125125

126126
python3 ../tools/CompareFile.py $href $hcal 8
127-
echo "CompareH_Failed $?" >>$1
127+
echo "CompareH_pass $?" >>$1
128128
python3 ../tools/CompareFile.py $sref $scal 8
129-
echo "CompareS_Failed $?" >>$1
129+
echo "CompareS_pass $?" >>$1
130130
fi
131131

132132
#echo $has_hs2
133133
if ! test -z "$has_hs2" && [ $has_hs2 -eq 1 ]; then
134134
python3 ../tools/CompareFile.py data-HR-sparse_SPIN0.csr.ref OUT.autotest/data-HR-sparse_SPIN0.csr 8
135-
echo "CompareHR_Failed $?" >>$1
135+
echo "CompareHR_pass $?" >>$1
136136
python3 ../tools/CompareFile.py data-SR-sparse_SPIN0.csr.ref OUT.autotest/data-SR-sparse_SPIN0.csr 8
137-
echo "CompareSR_Failed $?" >>$1
137+
echo "CompareSR_pass $?" >>$1
138138
fi
139139

140140
# echo "$has_wfc_r" ## test out_wfc_r > 0
@@ -182,31 +182,27 @@ fi
182182
# echo "$has_lowf" ## test out_wfc_lcao > 0
183183
if ! test -z "$has_lowf" && [ $has_lowf -eq 1 ]; then
184184
if ! test -z "$gamma_only" && [ $gamma_only -eq 1 ]; then
185-
lowfiles=`ls OUT.autotest/ | grep LOWF_GAMMA`
185+
wfc_cal=OUT.autotest/LOWF_GAMMA_S1.dat
186+
wfc_ref=LOWF_GAMMA_S1.dat.ref
186187
else
187-
lowfiles=`ls OUT.autotest/ | grep LOWF_K`
188-
fi
189-
if test -z "$lowfiles"; then
190-
echo "Can't find LOWF files"
191-
exit 1
192-
else
193-
for lowf in $lowfiles;
194-
do
195-
if ! test -f OUT.autotest/$lowf; then
196-
echo "Irregular LOWF file found"
197-
exit 1
198-
else
199-
sed -i "1,$ s/[a-d]//g" OUT.autotest/$lowf
200-
sed -i "1,$ s/[f-z]//g" OUT.autotest/$lowf
201-
sed -i "1,$ s/[A-D]//g" OUT.autotest/$lowf
202-
sed -i "1,$ s/[F-Z]//g" OUT.autotest/$lowf
203-
sed -i "1,$ s/)//g" OUT.autotest/$lowf
204-
sed -i "1,$ s/(//g" OUT.autotest/$lowf
205-
total_lowf=`sum_file OUT.autotest/$lowf`
206-
echo "$lowf $total_lowf" >>$1
207-
fi
208-
done
188+
awk 'BEGIN {flag=999}
189+
{
190+
if($2 == "(band)") {flag=2;print $0}
191+
else if(flag>0) {flag-=1;print $0}
192+
else if(flag==0)
193+
{
194+
for(i=1;i<=NF/2;i++)
195+
{printf "%.10e ",sqrt( $(2*i)*$(2*i)+$(2*i-1)*$(2*i-1) )};
196+
printf "\n"
197+
}
198+
else {print $0}
199+
}' OUT.autotest/LOWF_K_2.dat > OUT.autotest/LOWF_K_2_mod.dat
200+
wfc_cal=OUT.autotest/LOWF_K_2_mod.dat
201+
wfc_ref=LOWF_K_2_mod.dat.ref
209202
fi
203+
204+
python3 ../tools/CompareFile.py $wfc_cal $wfc_ref 8
205+
echo "Compare_wfc_lcao_pass $?" >>$1
210206
fi
211207

212208
if ! test -z "$out_dm" && [ $out_dm -eq 1 ]; then

0 commit comments

Comments
 (0)