# # MoleCuilder - creates and alters molecular systems # Copyright (C) 2013 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 particle charges # the potential has been generated by: # ./molecuilder -i pre/water.pdb --center-in-box "8,0,8,0,0,8" --select-all-atoms --fragment-molecule BondFragment --distance 2 --order 1 --fragment-automation --server-address 127.0.0.1 --server-port 1026 --DoLongrange 1 --grid 4 --DoPrintDebug 1 --DoValenceOnly 0 --analyse-fragment-results --store-grids 1 --save-homologies homology_grid_4_full.dat AT_SETUP([Potential - Fit particle charges to water]) AT_KEYWORDS([potential parse-homologies fit-particle-charges]) AT_SKIP_IF([../../molecuilder --help --actionname fit-particle-charges; if test $? -eq 5; then /bin/true; else /bin/false; fi]) # homology file created with water.pdb and as follows: # molecuilder -i water.pdb --select-all-atoms --fragment-molecule --distance 2 --order 1 --fragment-automation --server-address 127.0.0.1 --server-port 1026 --DoLongrange 1 --grid 5 --store-grids 1 --analyse-fragment-results --save-homologies homology_grid.dat file=homology_grid.dat AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Potential/FitParticleCharges/pre/$file $file], 0) AT_CHECK([chmod u+w $file], 0, [ignore], [ignore]) AT_CHECK([../../molecuilder --parse-homologies $file --fit-particle-charges --potential-file water.particles --fragment-charges 8 1 1 --radius 1.5], 0, [stdout], [ignore]) # check that L_2 error is below 1e-6 AT_CHECK([grep "L2-Norm" stdout | awk '{if ($6 > 1e1) exit 1}'], 0, [ignore], [ignore]) AT_CHECK([grep "L1-Norm" stdout | awk '{if ($6 > 1e0) exit 1}'], 0, [ignore], [ignore]) AT_CHECK([grep "We have fitted the following charges ( -0.73.*; 0.36.*; 0.36.*; )." stdout], 0, [ignore], [ignore]) AT_CLEANUP