File: test_lr_pol.sh

package info (click to toggle)
ergo 3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 17,044 kB
  • ctags: 6,813
  • sloc: cpp: 91,488; ansic: 15,728; sh: 6,416; makefile: 1,287; yacc: 123; lex: 108
file content (191 lines) | stat: -rwxr-xr-x 4,812 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/bin/sh

currtestdirname=tmpdir_test_lr_pol

if test "$top_builddir" = ""; then
    top_builddir=..
fi
if test "$top_srcdir" = ""; then
    top_srcdir=..
fi

. "$top_srcdir"/test/functions

# Run each test in a separate directory, to allow "make check -j" to work properly.
currdir=`pwd` ; cd $top_builddir ; top_builddir_pwd=`pwd` ; cd $currdir
rm -rf $currtestdirname ; mkdir $currtestdirname ; cd $currtestdirname
ln -s "$top_builddir_pwd"/source/ergo ./ergo

if test `./ergo -e precision` = 'single'; then
    echo SKIPPED
    exit 0
fi

errorfilename=ergoscf.out.error.lr_pol

echo
echo Testing NH3 SVWN5/4-31G polarizability
rm -f ergoscf.out
./ergo <<EOINPUT 
basis = "4-31G"
molecule_inline
N      0.00    -0.0   0.0
H      0.00    -1.9   0.1
H      1.64     0.9   0.0
H     -1.64     0.9   0.0
EOF
scf.convergence_threshold = 1e-6
J_K.use_fmm = 0
lr.convergence_threshold = 1e-5
XC.type="LMG"
XC.radint=1e-9
get_polarisability "SVWN5" all 0.0
initial_density="density.bin"
get_polarisability "SVWN5" all 0.2
EOINPUT
echo  # this is to get an extra newline
if 
check_final_energy -55.985633009 1e-5 ;
then
echo Energy OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi

check_pol () {
if 
check_polarisability $1 $2 $3 $4 $5;
then
echo Polarisability $1 $2 at frequency $3 OK
else
echo ERROR Polarisability $1 $2 at frequency $3
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi
}

check_pol X X   0.0   -7.877230629 1e-5
check_pol Y X   0.0    0.0 1e-5
check_pol Z X   0.0    0.0 1e-5
check_pol X Y   0.0    0.0 1e-5
check_pol Y Y   0.0   -7.936291744 1e-5
check_pol Z Y   0.0   0.2016103778 1e-5
check_pol X Z   0.0   0.0 1e-5
check_pol Y Z   0.0   0.2016104728 1e-5
check_pol Z Z   0.0    -2.45887058 1e-5
check_pol X X   0.2   -8.774076869 1e-5
check_pol Y X   0.2    0.0 1e-5
check_pol Z X   0.2    0.0 1e-5
check_pol X Y   0.2    0.0 1e-5
check_pol Y Y   0.2   -8.880466698  1e-5
check_pol Z Y   0.2    0.2234719254 1e-5
check_pol X Z   0.2    0.0 1e-5
check_pol Y Z   0.2    0.2234719254 1e-5
check_pol Z Z   0.2   -2.849382309 1e-5

rm density.bin potential.bin

echo
echo Testing HF CAM-B3LYP/aug-cc-pVDZ polarizability
rm -f ergoscf.out
./ergo <<EOINPUT 
basis = "aug-cc-pVDZ"
molecule_inline Angstrom
F   0.0 0.0 0.0
H   0   0   0.924719
EOF
scf.convergence_threshold = 1e-6
J_K.use_fmm = 1
lr.convergence_threshold = 1e-5
XC.type="GC2"
XC.radint=1e-9
# FIXME: XC.sparse_mode= not implemented in response calculations.
XC.sparse_mode = 0
get_polarisability "camb3lyp" all 0.0
initial_density="density.bin"
get_polarisability "camb3lyp" all 0.1
EOINPUT
echo  # this is to get an extra newline


if 
check_final_energy -100.43540064008 1e-5 ;
then
echo Energy OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi
check_pol X X   0.000000000    -4.458509918 1e-5
check_pol Y X   0.000000000  0.0  1e-5
check_pol Z X   0.000000000  0.0  1e-5
check_pol X Y   0.000000000  0.0  1e-5
check_pol Y Y   0.000000000    -4.458509918 1e-5
check_pol Z Y   0.000000000  0.0  1e-5
check_pol X Z   0.000000000  0.0  1e-5
check_pol Y Z   0.000000000  0.0  1e-5
check_pol Z Z   0.000000000    -6.444241063 4e-5
check_pol X X   0.100000000    -4.583001179 3e-5
check_pol Y X   0.100000000  0.0  1e-5
check_pol Z X   0.100000000  0.0  1e-5
check_pol X Y   0.100000000  0.0  1e-5
check_pol Y Y   0.100000000    -4.583001187 3e-5
check_pol Z Y   0.100000000  0.0  1e-5
check_pol X Z   0.100000000  0.0  1e-5
check_pol Y Z   0.100000000  0.0  1e-5
check_pol Z Z   0.100000000    -6.584672755 1e-5

rm density.bin potential.bin


# Now compute h2o HF/cc-pVDZ polarizability giving values
# corresponding to the isotropic polarizability value -5.011253
# in [PHYSICAL REVIEW E 92, 063301 (2015)].

echo
echo Testing h2o HF/cc-pVDZ polarizability
rm -f ergoscf.out
./ergo <<EOINPUT 
molecule_inline
O     0.0       0.0       0.0
H    -1.809     0.0       0.0
H     0.453549  1.751221  0.0
EOF
basis = "cc-pVDZ"
get_polarisability "HF" all 0.0
EOINPUT
echo  # this is to get an extra newline
if 
check_final_energy -76.0267949 1e-5 ;
then
echo Energy OK
else
echo ERROR
mv ergoscf.out $errorfilename
echo output file saved as $errorfilename
exit 1
fi
check_pol X X   0.000000000  -6.225251  1e-5
check_pol Y X   0.000000000  -0.882707  1e-5
check_pol Z X   0.000000000   0.0       1e-5
check_pol X Y   0.000000000  -0.882748  1e-5
check_pol Y Y   0.000000000  -5.768206  1e-5
check_pol Z Y   0.000000000   0.0       1e-5
check_pol X Z   0.000000000   0.0       1e-5
check_pol Y Z   0.000000000   0.0       1e-5
check_pol Z Z   0.000000000  -3.040301  1e-5

rm density.bin potential.bin ergoscf.out

cd ..
rm -r $currtestdirname

echo
echo LR polarizability tests completed successfully!
echo