[48d20d] | 1 | #
|
---|
| 2 | # MoleCuilder - creates and alters molecular systems
|
---|
| 3 | # Copyright (C) 2013 University of Bonn
|
---|
[5aaa43] | 4 | # Copyright (C) 2013 Frederik Heber
|
---|
[48d20d] | 5 | #
|
---|
| 6 | # This program is free software: you can redistribute it and/or modify
|
---|
| 7 | # it under the terms of the GNU General Public License as published by
|
---|
| 8 | # the Free Software Foundation, either version 3 of the License, or
|
---|
| 9 | # (at your option) any later version.
|
---|
| 10 | #
|
---|
| 11 | # This program is distributed in the hope that it will be useful,
|
---|
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 14 | # GNU General Public License for more details.
|
---|
| 15 | #
|
---|
| 16 | # You should have received a copy of the GNU General Public License
|
---|
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 18 | #
|
---|
| 19 | ### fit some potentials
|
---|
| 20 |
|
---|
[f5724f] | 21 | AT_SETUP([Potential - Fit morse potential to water])
|
---|
| 22 | AT_KEYWORDS([potential parse-homologies fit-potential morse])
|
---|
[55feff5] | 23 | AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi])
|
---|
[6829d2] | 24 | AT_XFAIL_IF([/bin/true])
|
---|
[48d20d] | 25 |
|
---|
| 26 | file=length_homology.dat
|
---|
[f5724f] | 27 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPotential/pre/$file $file], 0)
|
---|
[48d20d] | 28 | AT_CHECK([chmod u+w $file], 0, [ignore], [ignore])
|
---|
[0ea063] | 29 | AT_CHECK([../../molecuilder \
|
---|
| 30 | --parse-homologies $file \
|
---|
| 31 | --set-random-number-engine "lagged_fibonacci607" \
|
---|
| 32 | --random-number-engine-parameters "seed=1;" \
|
---|
| 33 | --set-random-number-distribution "uniform_real" \
|
---|
| 34 | --random-number-distribution-parameters "min=0;max=1;" \
|
---|
| 35 | --fit-potential \
|
---|
| 36 | --potential-type "morse" \
|
---|
| 37 | --potential-charges 8 1 \
|
---|
| 38 | --fragment-charges 1 8 1 \
|
---|
[b8f2ea] | 39 | --set-threshold 5e-6 \
|
---|
[0ea063] | 40 | --save-potentials length.potentials], 0, [stdout], [ignore])
|
---|
[48d20d] | 41 | # check that L_2 error is below 1e-6
|
---|
[b8f2ea] | 42 | AT_CHECK([grep "Best parameters with L2 error" stdout | awk '{if ($8 > 5e-6) exit 1}'], 0, [ignore], [ignore])
|
---|
[48d20d] | 43 | # check parameters to printed precision
|
---|
[b8f2ea] | 44 | AT_CHECK([grep "morse:.*particle_type1=8,.*particle_type2=1,.*spring_constant=1.2.*,.*equilibrium_distance=1.7.*,.*dissociation_energy=0.19.*;" length.potentials], 0, [ignore], [ignore])
|
---|
[48d20d] | 45 |
|
---|
| 46 | AT_CLEANUP
|
---|
| 47 |
|
---|
[f5724f] | 48 | AT_SETUP([Potential - Fit harmonic potential to water])
|
---|
| 49 | AT_KEYWORDS([potential parse-homologies fit-potential harmonic])
|
---|
[55feff5] | 50 | AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi])
|
---|
[6829d2] | 51 | AT_XFAIL_IF([/bin/true])
|
---|
[6550cf] | 52 |
|
---|
| 53 | file=harmonic_homology.dat
|
---|
[f5724f] | 54 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPotential/pre/$file $file], 0)
|
---|
[6550cf] | 55 | AT_CHECK([chmod u+w $file], 0, [ignore], [ignore])
|
---|
[0ea063] | 56 | AT_CHECK([../../molecuilder \
|
---|
| 57 | --parse-homologies $file \
|
---|
| 58 | --set-random-number-engine "lagged_fibonacci607" \
|
---|
| 59 | --random-number-engine-parameters "seed=1;" \
|
---|
| 60 | --set-random-number-distribution "uniform_real" \
|
---|
| 61 | --random-number-distribution-parameters "min=0;max=1;" \
|
---|
| 62 | --fit-potential \
|
---|
| 63 | --potential-type "harmonic_bond" \
|
---|
| 64 | --potential-charges 8 1 \
|
---|
| 65 | --fragment-charges 1 8 1 \
|
---|
[b8f2ea] | 66 | --set-threshold 5e-6 \
|
---|
[0ea063] | 67 | --save-potentials harmonic.potentials], 0, [stdout], [ignore])
|
---|
[b8f2ea] | 68 | # check that L_2 error is below 5e-6
|
---|
| 69 | AT_CHECK([grep "Best parameters with L2 error" stdout | awk '{if ($8 > 5e-6) exit 1}'], 0, [ignore], [ignore])
|
---|
[6550cf] | 70 | # check parameters to printed precision
|
---|
[0ea063] | 71 | AT_CHECK([grep "harmonic_bond:.*particle_type1=8,.*particle_type2=1,.*spring_constant=0.29.*,.*equilibrium_distance=1.8.*;" harmonic.potentials], 0, [ignore], [ignore])
|
---|
[6550cf] | 72 |
|
---|
| 73 | AT_CLEANUP
|
---|
| 74 |
|
---|
[f5724f] | 75 | AT_SETUP([Potential - Fit harmonic_angle potential to water])
|
---|
| 76 | AT_KEYWORDS([potential parse-homologies fit-potential harmonic_angle])
|
---|
[55feff5] | 77 | AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi])
|
---|
[6829d2] | 78 | AT_XFAIL_IF([/bin/true])
|
---|
[48d20d] | 79 |
|
---|
| 80 | file=angle_homology.dat
|
---|
[f5724f] | 81 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPotential/pre/$file $file], 0)
|
---|
[48d20d] | 82 | AT_CHECK([chmod u+w $file], 0, [ignore], [ignore])
|
---|
[0ea063] | 83 | AT_CHECK([../../molecuilder \
|
---|
| 84 | --parse-homologies $file \
|
---|
| 85 | --set-random-number-engine "lagged_fibonacci607" \
|
---|
| 86 | --random-number-engine-parameters "seed=1;" \
|
---|
| 87 | --set-random-number-distribution "uniform_real" \
|
---|
| 88 | --random-number-distribution-parameters "min=0;max=1;" \
|
---|
| 89 | --fit-potential \
|
---|
| 90 | --potential-type "harmonic_angle" \
|
---|
| 91 | --potential-charges 1 8 1 \
|
---|
| 92 | --fragment-charges 1 8 1 \
|
---|
| 93 | --set-threshold 1e-6 \
|
---|
| 94 | --save-potentials angle.potentials], 0, [stdout], [ignore])
|
---|
[48d20d] | 95 | # check that L_2 error is below 1e-6
|
---|
| 96 | AT_CHECK([grep "||e||_2:" stdout | awk '{if ($7 > 1e-6) exit 1}'], 0, [ignore], [ignore])
|
---|
| 97 | # check parameters to printed precision
|
---|
[0ea063] | 98 | AT_CHECK([grep "harmonic_angle:.*particle_type1=1,.*particle_type2=8,.*particle_type3=1,.*spring_constant=0.10.*,.*equilibrium_distance=-0.27.*;" angle.potentials], 0, [ignore], [ignore])
|
---|
[48d20d] | 99 |
|
---|
| 100 | AT_CLEANUP
|
---|
[1413f4] | 101 |
|
---|
[f5724f] | 102 | AT_SETUP([Potential - Fit torsion potential to butane])
|
---|
| 103 | AT_KEYWORDS([potential parse-homologies fit-potential torsion])
|
---|
[55feff5] | 104 | AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi])
|
---|
[6829d2] | 105 | AT_XFAIL_IF([/bin/true])
|
---|
[e2037e] | 106 |
|
---|
| 107 | file=torsion_homology.dat
|
---|
[f5724f] | 108 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPotential/pre/$file $file], 0)
|
---|
[e2037e] | 109 | AT_CHECK([chmod u+w $file], 0, [ignore], [ignore])
|
---|
[0ea063] | 110 | AT_CHECK([../../molecuilder \
|
---|
| 111 | --parse-homologies $file \
|
---|
| 112 | --set-random-number-engine "lagged_fibonacci607" \
|
---|
| 113 | --random-number-engine-parameters "seed=1;" \
|
---|
| 114 | --set-random-number-distribution "uniform_real" \
|
---|
| 115 | --random-number-distribution-parameters "min=0;max=1;" \
|
---|
| 116 | --fit-potential \
|
---|
| 117 | --potential-type "torsion" \
|
---|
| 118 | --potential-charges 6 6 6 6 \
|
---|
| 119 | --fragment-charges 6 6 6 6 1 1 1 1 1 1 1 1 1 1 \
|
---|
[b8f2ea] | 120 | --set-threshold 1e-9 \
|
---|
[0ea063] | 121 | --save-potentials torsion.potentials], 0, [stdout], [ignore])
|
---|
[1dbbeb] | 122 | # check that L_2 error is below 9e-12 ... just 2e-10 otherwise test takes tooo long
|
---|
[b8f2ea] | 123 | AT_CHECK([grep "Best parameters with L2 error" stdout | awk '{if ($8 > 1e-9) exit 1}'], 0, [ignore], [ignore])
|
---|
[0ea063] | 124 | AT_CHECK([grep "torsion:.*particle_type1=6,.*particle_type2=6,.*particle_type3=6,.*particle_type4=6,.*spring_constant=.*,.*equilibrium_distance=.*;" torsion.potentials], 0, [ignore], [ignore])
|
---|
| 125 | #AT_CHECK([grep "torsion:.*particle_type1=6,.*particle_type2=6,.*particle_type3=6,.*particle_type4=6,.*spring_constant=0.001.*,.*equilibrium_distance=0.99.*;" torsion.potentials], 0, [ignore], [ignore])
|
---|
[e2037e] | 126 |
|
---|
| 127 | AT_CLEANUP
|
---|
| 128 |
|
---|
[f5724f] | 129 | AT_SETUP([Potential - Fit improper potential to ammonia])
|
---|
| 130 | AT_KEYWORDS([potential parse-homologies fit-potential improper])
|
---|
[55feff5] | 131 | AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi])
|
---|
[6829d2] | 132 | AT_XFAIL_IF([/bin/true])
|
---|
[791a12] | 133 |
|
---|
| 134 | file=improper_homology.dat
|
---|
[f5724f] | 135 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPotential/pre/$file $file], 0)
|
---|
[791a12] | 136 | AT_CHECK([chmod u+w $file], 0, [ignore], [ignore])
|
---|
[0ea063] | 137 | AT_CHECK([../../molecuilder \
|
---|
| 138 | --parse-homologies $file \
|
---|
| 139 | --set-random-number-engine "lagged_fibonacci607" \
|
---|
| 140 | --random-number-engine-parameters "seed=1;" \
|
---|
| 141 | --set-random-number-distribution "uniform_real" \
|
---|
| 142 | --random-number-distribution-parameters "min=0;max=1;" \
|
---|
| 143 | --fit-potential \
|
---|
| 144 | --potential-type "improper" \
|
---|
| 145 | --potential-charges 1 7 1 1 \
|
---|
| 146 | --fragment-charges 7 1 1 1 \
|
---|
| 147 | --set-threshold 3e-4 \
|
---|
| 148 | --save-potentials improper.potentials], 0, [stdout], [ignore])
|
---|
[791a12] | 149 | # check that L_2 error is below 3e-4
|
---|
| 150 | AT_CHECK([grep "Best parameters with L2 error" stdout | awk '{if ($8 > 3e-4) exit 1}'], 0, [ignore], [ignore])
|
---|
| 151 | # check parameters to printed precision
|
---|
[0ea063] | 152 | AT_CHECK([grep "improper:.*particle_type1=1,.*particle_type2=7,.*particle_type3=1,.*particle_type4=1,.*spring_constant=.*,.*equilibrium_distance=.*;" improper.potentials], 0, [ignore], [ignore])
|
---|
| 153 | #AT_CHECK([grep "improper:.*particle_type1=1,.*particle_type2=7,.*particle_type3=1,.*particle_type4=1,.*spring_constant=1.02.*,.*equilibrium_distance=0.85.*;" improper.potentials], 0, [ignore], [ignore])
|
---|
[791a12] | 154 |
|
---|
| 155 | AT_CLEANUP
|
---|
| 156 |
|
---|
[f5724f] | 157 | AT_SETUP([Potential - Fit LJ potential to argon])
|
---|
| 158 | AT_KEYWORDS([potential parse-homologies fit-potential lennardjones])
|
---|
[55feff5] | 159 | AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi])
|
---|
[6829d2] | 160 | AT_XFAIL_IF([/bin/true])
|
---|
[1413f4] | 161 |
|
---|
| 162 | file=lj_homology.dat
|
---|
[f5724f] | 163 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitPotential/pre/$file $file], 0)
|
---|
[1413f4] | 164 | AT_CHECK([chmod u+w $file], 0, [ignore], [ignore])
|
---|
[0ea063] | 165 | AT_CHECK([../../molecuilder \
|
---|
| 166 | --parse-homologies $file \
|
---|
| 167 | --set-random-number-engine "lagged_fibonacci607" \
|
---|
| 168 | --random-number-engine-parameters "seed=5;" \
|
---|
| 169 | --set-random-number-distribution "uniform_real" \
|
---|
| 170 | --random-number-distribution-parameters "min=0;max=1;" \
|
---|
| 171 | --fit-potential \
|
---|
| 172 | --potential-type "lennardjones" \
|
---|
| 173 | --potential-charges 18 18 \
|
---|
| 174 | --fragment-charges 18 18 \
|
---|
[b8f2ea] | 175 | --set-threshold 7e-8 \
|
---|
[0ea063] | 176 | --save-potentials lj.potentials], 0, [stdout], [ignore])
|
---|
[b8f2ea] | 177 | # check that L_2 error is below 7e-11 ... just 7e-8 otherwise test takes too long
|
---|
| 178 | AT_CHECK([grep "Best parameters with L2 error" stdout | awk '{if ($8 > 7e-8) exit 1}'], 0, [ignore], [ignore])
|
---|
[1413f4] | 179 | # check parameters to printed precision
|
---|
[0ea063] | 180 | AT_CHECK([grep "lennardjones:.*particle_type1=18,.*particle_type2=18,.*epsilon=.*,.*sigma=.*;" lj.potentials], 0, [ignore], [ignore])
|
---|
| 181 | #AT_CHECK([grep "lennardjones:.*particle_type1=18,.*particle_type2=18,.*epsilon=1.*e-05,.*sigma=8.2.*;" lj.potentials], 0, [ignore], [ignore])
|
---|
[1413f4] | 182 |
|
---|
| 183 | AT_CLEANUP
|
---|