K: 1 3 5 7 9 for the same ecut_wfc 46 ecut_rho 221
===================================================================================
K 1 ecut_wfc 46 ecut_rho 221
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 0.00000000
atom 5 type 3 force = 0.00465788 -0.00683290 0.00295604
atom 6 type 3 force = -0.00465788 0.00683290 -0.00295604
atom 7 type 3 force = -0.00683290 -0.00465788 0.00295604
atom 8 type 3 force = 0.00683290 0.00465788 -0.00295604
atom 9 type 3 force = -0.00465788 0.00683290 0.00295604
atom 10 type 3 force = -0.00683290 -0.00465788 -0.00295604
atom 11 type 3 force = 0.00683290 0.00465788 0.00295604
atom 12 type 3 force = 0.00465788 -0.00683290 -0.00295604
Total force:
0.024839
Stress and pressure (Ry/bohr**3) (kbar)
0.00035788 -0.00000000 0.00000000 52.65 -0.00 0.00
0.00000000 0.00035788 0.00000000 0.00 52.65 0.00
0.00000000 0.00000000 -0.00002046 0.00 0.00 -3.01
===================================================================================
K 3 ecut_wfc 46 ecut_rho 221
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 5 type 3 force = 0.00202733 0.00299689 -0.00278010
atom 6 type 3 force = -0.00202733 -0.00299689 0.00278010
atom 7 type 3 force = 0.00299689 -0.00202733 -0.00278010
atom 8 type 3 force = -0.00299689 0.00202733 0.00278010
atom 9 type 3 force = -0.00202733 -0.00299689 -0.00278010
atom 10 type 3 force = 0.00299689 -0.00202733 0.00278010
atom 11 type 3 force = -0.00299689 0.00202733 -0.00278010
atom 12 type 3 force = 0.00202733 0.00299689 0.00278010
Total force:
0.012906
Stress and pressure (Ry/bohr**3) (kbar)
0.00009040 0.00000000 0.00000000 13.30 0.00 0.00
-0.00000000 0.00009040 0.00000000 -0.00 13.30 0.00
0.00000000 0.00000000 0.00007604 0.00 0.00 11.19
===================================================================================
K 5 ecut_wfc 46 ecut_rho 221
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 0.00000000
atom 5 type 3 force = 0.00220320 0.00293187 -0.00266601
atom 6 type 3 force = -0.00220320 -0.00293187 0.00266601
atom 7 type 3 force = 0.00293187 -0.00220320 -0.00266601
atom 8 type 3 force = -0.00293187 0.00220320 0.00266601
atom 9 type 3 force = -0.00220320 -0.00293187 -0.00266601
atom 10 type 3 force = 0.00293187 -0.00220320 0.00266601
atom 11 type 3 force = -0.00293187 0.00220320 -0.00266601
atom 12 type 3 force = 0.00220320 0.00293187 0.00266601
Total force:
0.012824
Stress and pressure (Ry/bohr**3) (kbar)
0.00008699 0.00000000 0.00000000 12.80 0.00 0.00
-0.00000000 0.00008699 0.00000000 -0.00 12.80 0.00
0.00000000 0.00000000 0.00008446 0.00 0.00 12.42
===================================================================================
K 7 ecut_wfc 46 ecut_rho 221
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 0.00000000
atom 5 type 3 force = 0.00208148 0.00296586 -0.00270244
atom 6 type 3 force = -0.00208148 -0.00296586 0.00270244
atom 7 type 3 force = 0.00296586 -0.00208148 -0.00270244
atom 8 type 3 force = -0.00296586 0.00208148 0.00270244
atom 9 type 3 force = -0.00208148 -0.00296586 -0.00270244
atom 10 type 3 force = 0.00296586 -0.00208148 0.00270244
atom 11 type 3 force = -0.00296586 0.00208148 -0.00270244
atom 12 type 3 force = 0.00208148 0.00296586 0.00270244
Total force:
0.012785
Stress and pressure (Ry/bohr**3) (kbar)
0.00008841 0.00000000 -0.00000000 13.00 0.00 -0.00
-0.00000000 0.00008841 0.00000000 -0.00 13.00 0.00
0.00000000 0.00000000 0.00008162 0.00 0.00 12.01
===================================================================================
K 9 ecut_wfc 46 ecut_rho 221
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 5 type 3 force = 0.00208422 0.00297367 -0.00271435
atom 6 type 3 force = -0.00208422 -0.00297367 0.00271435
atom 7 type 3 force = 0.00297367 -0.00208422 -0.00271435
atom 8 type 3 force = -0.00297367 0.00208422 0.00271435
atom 9 type 3 force = -0.00208422 -0.00297367 -0.00271435
atom 10 type 3 force = 0.00297367 -0.00208422 0.00271435
atom 11 type 3 force = -0.00297367 0.00208422 -0.00271435
atom 12 type 3 force = 0.00208422 0.00297367 0.00271435
Total force:
0.012823
Stress and pressure (Ry/bohr**3) (kbar)
0.00008838 -0.00000000 0.00000000 13.00 -0.00 0.00
0.00000000 0.00008838 0.00000000 0.00 13.00 0.00
0.00000000 -0.00000000 0.00008150 0.00 -0.00 11.99
**For the testing K=5 is converged, we choose K=7 for better precision. **
Fix K = 7, then test Ecutwfc = 40, 60, 80. Ecutrho = Factor*Ecutwfc (Fix Factor=5)
===================================================================================
K 7 ecut_wfc 40 ecut_rho 200
Start run ${testType} ...
The command took 126 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 0.00000000
atom 5 type 3 force = 0.00211754 0.00303026 -0.00276055
atom 6 type 3 force = -0.00211754 -0.00303026 0.00276055
atom 7 type 3 force = 0.00303026 -0.00211754 -0.00276055
atom 8 type 3 force = -0.00303026 0.00211754 0.00276055
atom 9 type 3 force = -0.00211754 -0.00303026 -0.00276055
atom 10 type 3 force = 0.00303026 -0.00211754 0.00276055
atom 11 type 3 force = -0.00303026 0.00211754 -0.00276055
atom 12 type 3 force = 0.00211754 0.00303026 0.00276055
Total force:
0.013050
Stress and pressure (Ry/bohr**3) (kbar)
0.00008116 0.00000000 0.00000000 11.94 0.00 0.00
-0.00000000 0.00008116 0.00000000 -0.00 11.94 0.00
0.00000000 0.00000000 0.00007430 0.00 0.00 10.93
===================================================================================
K 7 ecut_wfc 60 ecut_rho 300
Start run ${testType} ...
The command took 254 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 5 type 3 force = 0.00206287 0.00294774 -0.00268093
atom 6 type 3 force = -0.00206287 -0.00294774 0.00268093
atom 7 type 3 force = 0.00294774 -0.00206287 -0.00268093
atom 8 type 3 force = -0.00294774 0.00206287 0.00268093
atom 9 type 3 force = -0.00206287 -0.00294774 -0.00268093
atom 10 type 3 force = 0.00294774 -0.00206287 0.00268093
atom 11 type 3 force = -0.00294774 0.00206287 -0.00268093
atom 12 type 3 force = 0.00206287 0.00294774 0.00268093
Total force:
0.012691
Stress and pressure (Ry/bohr**3) (kbar)
0.00009592 -0.00000000 0.00000000 14.11 -0.00 0.00
0.00000000 0.00009592 0.00000000 0.00 14.11 0.00
0.00000000 0.00000000 0.00008913 0.00 0.00 13.11
===================================================================================
K 7 ecut_wfc 80 ecut_rho 400
Start run ${testType} ...
The command took 419 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 0.00000000
atom 5 type 3 force = 0.00206234 0.00294808 -0.00267958
atom 6 type 3 force = -0.00206234 -0.00294808 0.00267958
atom 7 type 3 force = 0.00294808 -0.00206234 -0.00267958
atom 8 type 3 force = -0.00294808 0.00206234 0.00267958
atom 9 type 3 force = -0.00206234 -0.00294808 -0.00267958
atom 10 type 3 force = 0.00294808 -0.00206234 0.00267958
atom 11 type 3 force = -0.00294808 0.00206234 -0.00267958
atom 12 type 3 force = 0.00206234 0.00294808 0.00267958
Total force:
0.012688
Stress and pressure (Ry/bohr**3) (kbar)
0.00009601 0.00000000 0.00000000 14.12 0.00 0.00
-0.00000000 0.00009601 0.00000000 -0.00 14.12 0.00
0.00000000 0.00000000 0.00008924 0.00 0.00 13.13
**Ecutwfc > 40 and Ecutwfc <=60 is a good range. ** We choose 50
Fix Ecutwfc = 50, tesing Factor in Ecutrho = Factor*Ecutwfc. Factor = 1 2 3 4 5 6
===================================================================================
K 7 ecut_wfc 50 ecut_rho 50
Start run ${testType} ...
Abort(1) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
The command took 1 seconds to run.
Forces on each atoms (Ry/au)
Total force:
Stress and pressure (Ry/bohr**3) (kbar)
===================================================================================
K 7 ecut_wfc 50 ecut_rho 100
Start run ${testType} ...
The command took 130 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 5 type 3 force = 0.00190117 0.00285859 -0.00243711
atom 6 type 3 force = -0.00190117 -0.00285859 0.00243711
atom 7 type 3 force = 0.00285859 -0.00190117 -0.00243711
atom 8 type 3 force = -0.00285859 0.00190117 0.00243711
atom 9 type 3 force = -0.00190117 -0.00285859 -0.00243711
atom 10 type 3 force = 0.00285859 -0.00190117 0.00243711
atom 11 type 3 force = -0.00285859 0.00190117 -0.00243711
atom 12 type 3 force = 0.00190117 0.00285859 0.00243711
Total force:
0.011908
Stress and pressure (Ry/bohr**3) (kbar)
0.00011647 -0.00000000 0.00000000 17.13 -0.00 0.00
0.00000000 0.00011647 0.00000000 0.00 17.13 0.00
0.00000000 0.00000000 0.00010870 0.00 0.00 15.99
===================================================================================
K 7 ecut_wfc 50 ecut_rho 150
Start run ${testType} ...
The command took 186 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 0.00000000
atom 5 type 3 force = 0.00206815 0.00293557 -0.00267582
atom 6 type 3 force = -0.00206815 -0.00293557 0.00267582
atom 7 type 3 force = 0.00293557 -0.00206815 -0.00267582
atom 8 type 3 force = -0.00293557 0.00206815 0.00267582
atom 9 type 3 force = -0.00206815 -0.00293557 -0.00267582
atom 10 type 3 force = 0.00293557 -0.00206815 0.00267582
atom 11 type 3 force = -0.00293557 0.00206815 -0.00267582
atom 12 type 3 force = 0.00206815 0.00293557 0.00267582
Total force:
0.012666
Stress and pressure (Ry/bohr**3) (kbar)
0.00009525 -0.00000000 0.00000000 14.01 -0.00 0.00
0.00000000 0.00009525 0.00000000 0.00 14.01 0.00
0.00000000 0.00000000 0.00008829 0.00 0.00 12.99
===================================================================================
K 7 ecut_wfc 50 ecut_rho 200
Start run ${testType} ...
The command took 222 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 5 type 3 force = 0.00207208 0.00295440 -0.00269240
atom 6 type 3 force = -0.00207208 -0.00295440 0.00269240
atom 7 type 3 force = 0.00295440 -0.00207208 -0.00269240
atom 8 type 3 force = -0.00295440 0.00207208 0.00269240
atom 9 type 3 force = -0.00207208 -0.00295440 -0.00269240
atom 10 type 3 force = 0.00295440 -0.00207208 0.00269240
atom 11 type 3 force = -0.00295440 0.00207208 -0.00269240
atom 12 type 3 force = 0.00207208 0.00295440 0.00269240
Total force:
0.012735
Stress and pressure (Ry/bohr**3) (kbar)
0.00009250 0.00000000 0.00000000 13.61 0.00 0.00
-0.00000000 0.00009250 0.00000000 -0.00 13.61 0.00
0.00000000 0.00000000 0.00008571 0.00 0.00 12.61
===================================================================================
K 7 ecut_wfc 50 ecut_rho 250
Start run ${testType} ...
The command took 262 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 0.00000000
atom 5 type 3 force = 0.00207130 0.00295292 -0.00269076
atom 6 type 3 force = -0.00207130 -0.00295292 0.00269076
atom 7 type 3 force = 0.00295292 -0.00207130 -0.00269076
atom 8 type 3 force = -0.00295292 0.00207130 0.00269076
atom 9 type 3 force = -0.00207130 -0.00295292 -0.00269076
atom 10 type 3 force = 0.00295292 -0.00207130 0.00269076
atom 11 type 3 force = -0.00295292 0.00207130 -0.00269076
atom 12 type 3 force = 0.00207130 0.00295292 0.00269076
Total force:
0.012728
Stress and pressure (Ry/bohr**3) (kbar)
0.00009235 0.00000000 0.00000000 13.59 0.00 0.00
-0.00000000 0.00009235 0.00000000 -0.00 13.59 0.00
0.00000000 0.00000000 0.00008555 0.00 0.00 12.58
===================================================================================
K 7 ecut_wfc 50 ecut_rho 300
Start run ${testType} ...
The command took 252 seconds to run.
Forces on each atoms (Ry/au)
atom 1 type 2 force = 0.00000000 0.00000000 -0.00000000
atom 2 type 2 force = 0.00000000 0.00000000 0.00000000
atom 3 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 4 type 1 force = 0.00000000 0.00000000 -0.00000000
atom 5 type 3 force = 0.00207105 0.00295436 -0.00269165
atom 6 type 3 force = -0.00207105 -0.00295436 0.00269165
atom 7 type 3 force = 0.00295436 -0.00207105 -0.00269165
atom 8 type 3 force = -0.00295436 0.00207105 0.00269165
atom 9 type 3 force = -0.00207105 -0.00295436 -0.00269165
atom 10 type 3 force = 0.00295436 -0.00207105 0.00269165
atom 11 type 3 force = -0.00295436 0.00207105 -0.00269165
atom 12 type 3 force = 0.00207105 0.00295436 0.00269165
Total force:
0.012732
Stress and pressure (Ry/bohr**3) (kbar)
0.00009231 -0.00000000 0.00000000 13.58 -0.00 0.00
0.00000000 0.00009231 0.00000000 0.00 13.58 0.00
0.00000000 0.00000000 0.00008550 0.00 0.00 12.58
**Factor = 1 not work. Factor >=4 is okey. ** We choose 5.
#for K in 1 3 5 7 9
#for K in 1 3 5 7 9
for K in 7
do
#for wfc in 40 60 80 100 120
for wfc in 50
# for wfc in 46
do
#for rho in 220 240 260 280 300 320
#for rho in 221
for factor in 1 2 3 4 5 6 7 8
do
rho=$((factor * wfc))
testType=NaAlH4.K${K}_wfc${wfc}_rho${rho}
testType=NaAlH4.K${K}_wfc${wfc}_rho${rho}
echo "==================================================================================="
# echo ${testType}.in
echo "K ${K} ecut_wfc ${wfc} ecut_rho ${rho}"
# In macOS the grammar is different
sed "s/KVALUE/${K}/g" NaAlH4.temp | sed "s/ECUTWFC/${wfc}/g" | sed "s/ECUTRHO/${rho}/g" > ${testType}.in
start_time=$(date +%s)
echo 'Start run ${testType} ...'
pw.x -input ${testType}.in > ${testType}.out
end_time=$(date +%s)
runtime=$((end_time-start_time))
echo "The command took $runtime seconds to run."
# Extract forces for each atoms
forces=$(awk '/Forces acting on atoms/ {getline; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print; getline; print}' ${testType}.out)
# Extract Total force
total_force=$(awk '/Total force/ {print $4}' ${testType}.out)
# Extract stress tensor values
stress_values=$(awk '/total stress/ {getline; print; getline; print; getline; print}' ${testType}.out)
echo "Forces on each atoms (Ry/au)"
echo "$forces"
echo "Total force:"
echo "$total_force"
echo "Stress and pressure (Ry/bohr**3) (kbar)"
echo "$stress_values"
done
done
done
NaAlH4.temp
&CONTROL
calculation='scf',
outdir='.',
prefix='NaAlH4',
pseudo_dir='.',
verbosity='low',
tprnfor=.true.,
tstress=.true.,
/
&SYSTEM
ibrav = 0
A = 4.94110
nat = 12
ntyp = 3
ecutwfc = ECUTWFC,
ecutrho = ECUTRHO,
input_dft='pbe',
occupations='smearing',
smearing='mv',
degauss=0.005d0,
/
&ELECTRONS
conv_thr=1d-08,
mixing_beta=0.7d0,
/
CELL_PARAMETERS {alat}
1.000000000000000 0.000000000000000 0.000000000000000
0.000000000000000 1.000000000000000 0.000000000000000
0.500000000000000 0.500000000000000 1.112056363080577
ATOMIC_SPECIES
Na 22.98900 na_pbe_v1.5.uspp.F.UPF
Al 26.98100 Al.pbe-n-kjpaw_psl.1.0.0.UPF
H 1.00750 H.pbe-rrkjus_psl.1.0.0.UPF
ATOMIC_POSITIONS {crystal}
Al 0.500000000000000 0.500000000000000 0.000000000000000
Al 0.250000000000000 0.750000000000000 0.500000000000000
Na 0.000000000000000 0.000000000000000 0.000000000000000
Na 0.750000000000000 0.250000000000000 0.500000000000000
H 0.723208340000000 0.817509120000000 0.837955420000000
H 0.026791660000000 0.432490880000000 0.662044580000000
H 0.567509120000000 0.688836240000000 0.337955420000000
H 0.182490880000000 0.561163760000000 0.162044580000000
H 0.438836240000000 0.344535460000000 0.837955420000000
H 0.655464540000000 0.276791660000000 0.162044580000000
H 0.094535460000000 0.973208340000000 0.337955420000000
H 0.311163760000000 0.905464540000000 0.662044580000000
K_POINTS {automatic}
KVALUE KVALUE KVALUE 0 0 0
~/Dropbox/Aalto/DoctoralCourses/Compmatphys/Project/Step4/Step2 ❯ ./workflow.sh 14:08:20
K = 5 is enough
60 is good
Multi-factor test
240 is enough