source: tests/regression/Potential/FitCompoundPotential/testsuite-potential-fit-compound-potential.at@ 91c409

Candidate_v1.7.0 stable
Last change on this file since 91c409 was 82e5fb, checked in by Frederik Heber <frederik.heber@…>, 4 years ago

Added option error-file to fit potential actions.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1#
2# MoleCuilder - creates and alters molecular systems
3# Copyright (C) 2021 Frederik Heber
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17#
18### fit a compound potentials
19
20AT_SETUP([Potential - Fit compound potential to water])
21AT_KEYWORDS([potential parse-homologies fit-compound-potential])
22AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi])
23# homology files probably originate from Labspace/PotentialFitting/WaterAngle
24# recreate homology file: PYTHONPATH=... /usr/bin/python .../tests/regression/Potential/FitPotential/pre/measurement_function.py length_common.pdb 2 0 0 5 4 127.0.0.1 2050 6-311G* 1 2. 10 .../share/molecuilder/data/bondtables/bondtable.dat
25
26file=water_homology.dat
27AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitCompoundPotential/pre/$file $file], 0)
28AT_CHECK([chmod u+w $file], 0, [ignore], [ignore])
29AT_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 --parse-potentials ${abs_top_srcdir}/tests/regression/Potential/FitCompoundPotential/pre/water.potentials \
36 --fit-compound-potential \
37 --error-file error.csv \
38 --fragment-charges 1 8 1 \
39 --take-best-of 3 \
40 --save-potentials water.potentials], 0, [stdout], [ignore])
41# check that error file was written
42AT_CHECK([test -e error.csv], 0, [ignore], [ignore])
43# check that L_2 error
44AT_CHECK([grep "Best parameters with L2 error" stdout | awk '{if ($8 > 0.34) exit 1}'], 0, [ignore], [ignore])
45# check parameters to printed precision
46AT_CHECK([grep "harmonic_angle:.*particle_type1=1,.*particle_type2=8,.*particle_type3=1,.*spring_constant=0.7.*,.*equilibrium_distance=-0.3.*" water.potentials], 0, [ignore], [ignore])
47
48AT_CLEANUP
Note: See TracBrowser for help on using the repository browser.