# # MoleCuilder - creates and alters molecular systems # Copyright (C) 2021 Frederik Heber # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # ### fit a compound potentials AT_SETUP([Potential - Fit compound potential to water]) AT_KEYWORDS([potential parse-homologies fit-compound-potential]) AT_SKIP_IF([../../molecuilder --help fit-potential; if test $? -eq 5; then /bin/true; else /bin/false; fi]) # homology files probably originate from Labspace/PotentialFitting/WaterAngle # 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 file=water_homology.dat AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitCompoundPotential/pre/$file $file], 0) AT_CHECK([chmod u+w $file], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder --dry-run --parse-homologies $file --set-random-number-engine "lagged_fibonacci607" --random-number-engine-parameters "seed=1;" --set-random-number-distribution "uniform_real" --random-number-distribution-parameters "min=0;max=1;" --parse-potentials ${abs_top_srcdir}/tests/regression/Potential/FitCompoundPotential/pre/water.potentials --fit-compound-potential --error-file error.csv --fragment-charges 1 8 1 --take-best-of 3 --save-potentials water.potentials --no-dry-run --store-session session-potential-fit-compound-potential.py --session-type python], 0, [stdout], [ignore]) AT_CHECK([grep -v "Command.*DryRun" session-potential-fit-compound-potential.py >session-potential-fit-compound-potential_new.py], 0, [ignore], [ignore]) AT_CHECK([../../molecuilderguitest session-potential-fit-compound-potential_new.py], 0, [stdout], [ignore]) # check that error file was written AT_CHECK([test -e error.csv], 0, [ignore], [ignore]) # check that L_2 error # check parameters to printed precision AT_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]) AT_CLEANUP