| 1 | # | 
|---|
| 2 | #    MoleCuilder - creates and alters molecular systems | 
|---|
| 3 | #    Copyright (C) 2013 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 particle charges | 
|---|
| 19 |  | 
|---|
| 20 | # the potential has been generated by: | 
|---|
| 21 | # ./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 | 
|---|
| 22 |  | 
|---|
| 23 | AT_SETUP([Fragmentation - Fit particle charges to water]) | 
|---|
| 24 | AT_KEYWORDS([fragmentation parse-homologies fit-particle-charges]) | 
|---|
| 25 | AT_SKIP_IF([../../molecuilder --help --actionname fit-particle-charges; if test $? -eq 5; then /bin/true; else /bin/false; fi]) | 
|---|
| 26 |  | 
|---|
| 27 | # homology file created with water.pdb and as follows: | 
|---|
| 28 | # 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 | 
|---|
| 29 | file=homology_grid.dat | 
|---|
| 30 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Fragmentation/FitParticleCharges/pre/$file $file], 0) | 
|---|
| 31 | AT_CHECK([chmod u+w $file], 0, [ignore], [ignore]) | 
|---|
| 32 | AT_CHECK([../../molecuilder --parse-homologies $file --fit-particle-charges --potential-file water.particles --fragment-charges 8 1 1 --radius 1.5], 0, [stdout], [ignore]) | 
|---|
| 33 | # check that L_2 error is below 1e-6 | 
|---|
| 34 | AT_CHECK([grep "L2-Norm" stdout | awk '{if ($6 > 1e1) exit 1}'], 0, [ignore], [ignore]) | 
|---|
| 35 | AT_CHECK([grep "L1-Norm" stdout | awk '{if ($6 > 1e0) exit 1}'], 0, [ignore], [ignore]) | 
|---|
| 36 | AT_CHECK([grep "We have fitted the following charges ( -0.73.*; 0.36.*; 0.36.*; )." stdout], 0, [ignore], [ignore]) | 
|---|
| 37 |  | 
|---|
| 38 | AT_CLEANUP | 
|---|