Skip to content

Commit 7dfa978

Browse files
committed
Add test for compensating charge energy and force.
1 parent 52b7e75 commit 7dfa978

File tree

8 files changed

+81
-0
lines changed

8 files changed

+81
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
INPUT_PARAMETERS
2+
#Parameters (1.General)
3+
suffix autotest
4+
calculation scf
5+
pseudo_dir ../tools/PP_ORB/
6+
ntype 2
7+
nbands 20
8+
ecutwfc 100
9+
scf_nmax 50
10+
symmetry 1
11+
cal_force 1
12+
13+
#Parameters (Compensating charge)
14+
15+
comp_chg 1
16+
comp_q 1
17+
comp_l 1
18+
comp_center 5
19+
comp_dim 2
20+
21+
nelec 9
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This test for: compensating charge energy and force correction
2+
*H2O
3+
*PW
4+
*kpoints 1*1*1
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
ATOMIC_SPECIES
2+
H 1.008 H_ONCV_PBE-1.0.upf
3+
O 15.9994 O_ONCV_PBE-1.0.upf
4+
5+
NUMERICAL_ORBITAL
6+
H_gga_6au_60Ry_2s1p.orb
7+
O_gga_6au_60Ry_2s2p1d.orb
8+
9+
LATTICE_CONSTANT
10+
1
11+
12+
LATTICE_VECTORS
13+
10 0 0
14+
0 10 0
15+
0 0 10
16+
17+
ATOMIC_POSITIONS
18+
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
19+
20+
H
21+
0.0
22+
2
23+
0.000 0.000 1.815 0 0 0
24+
0.057 1.710 -0.605 0 0 0
25+
O
26+
0.0
27+
1
28+
0.000 0.000 0.000 0 0 0
29+

tests/integrate/117_PW_comp_H2O/jd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test compensating charge correction for H2O
2+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
etotref -468.6754437192308274
2+
etotperatomref -156.2251479064
3+
totalforceref 4.151456
4+
ecompselfref +1.15402457399
5+
ecompelectronref -10.4346177053
6+
ecompnuclearref +10.5545672604
7+
ecomptotref +1.27397412918
8+
totaltimeref 17.27178

tests/integrate/CASES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
115_PW_sol_H2
6060
115_PW_sol_H2O
6161
116_PW_scan_Si2
62+
117_PW_comp_H2O
6263
120_PW_KP_MD_ADS
6364
120_PW_KP_MD_FIRE
6465
120_PW_KP_MD_LGV

tests/integrate/tools/catch_properties.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ out_dm=`grep out_dm INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4444
out_mul=`grep out_mul INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4545
gamma_only=`grep gamma_only INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4646
imp_sol=`grep imp_sol INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
47+
comp_chg=`grep comp_chg INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4748
#echo $running_path
4849
base=`grep -En '(^|[[:space:]])basis_type($|[[:space:]])' INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4950
word="driver_line"
@@ -290,6 +291,17 @@ if ! test -z "$imp_sol" && [ $imp_sol == 1 ]; then
290291
echo "esolcavref $esol_cav" >>$1
291292
fi
292293

294+
if ! test -z "$comp_chg" && [ $comp_chg == 1 ]; then
295+
ecomp_self=`grep E_comp_self $running_path | awk '{print $3}'`
296+
ecomp_electron=`grep E_comp_electron $running_path | awk '{print $3}'`
297+
ecomp_nuclear=`grep E_comp_nuclear $running_path | awk '{print $3}'`
298+
ecomp_tot=`grep E_comp_tot $running_path | awk '{print $3}'`
299+
echo "ecompselfref $ecomp_self" >>$1
300+
echo "ecompelectronref $ecomp_electron" >>$1
301+
echo "ecompnuclearref $ecomp_nuclear" >>$1
302+
echo "ecomptotref $ecomp_tot" >>$1
303+
fi
304+
293305
#echo $total_band
294306
ttot=`grep $word $running_path | awk '{print $3}'`
295307
echo "totaltimeref $ttot" >>$1

0 commit comments

Comments
 (0)