source: tests/Examples/ManyWaysTranslateAtom/testsuite-examples-many-ways-translate-atom.at@ 8efcf4

ForceAnnealing_oldresults IndependentFragmentGrids_IntegrationTest
Last change on this file since 8efcf4 was d21668, checked in by Frederik Heber <frederik.heber@…>, 8 years ago

Added Examples testcase for the many ways to translate an atom blog entry.

  • Property mode set to 100644
File size: 5.7 KB
Line 
1#
2# MoleCuilder - creates and alters molecular systems
3# Copyright (C) 2017 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### Blog entry about many ways to translate an atom
19
20AT_SETUP([Examples - ways to translate an atom])
21AT_KEYWORDS([blog translate-atom])
22
23# prepare config
24file=water.xyz
25AT_CHECK([/bin/cp ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/pre/water.xyz $file], 0, [ignore], [ignore])
26AT_CHECK([chmod u+w $file], 0)
27
28# 1. use translate-atom
29AT_CHECK([../../molecuilder --input water_translateatom.xyz -o xyz --load $file --select-atom-by-element O --translate-atoms --position "1,0,0"], 0, [ignore], [ignore])
30AT_CHECK([diff -I".*olecuilder.*" water_translateatom.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
31
32# 2. use translate-molecule variant a
33AT_CHECK([../../molecuilder --input water_translatemolecule1_stage1.xyz -o xyz --load water.xyz --select-all-molecules --translate-molecules --position "1,0,0"], 0, [ignore], [ignore])
34AT_CHECK([../../molecuilder --input water_translatemolecule1.xyz -o xyz --load water_translatemolecule1_stage1.xyz --select-atom-by-element H --translate-atoms --position "-1,0,0"], 0, [ignore], [ignore])
35AT_CHECK([diff -I".*olecuilder.*" water_translatemolecule1.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
36
37# 3. use translate-molecule variant b
38AT_CHECK([../../molecuilder --input water_translatemolecule2.xyz -o xyz --load water.xyz --update-molecules --select-molecules-by-formula O --translate-molecules --position "1,0,0"
39], 0, [ignore], [ignore])
40AT_CHECK([diff -I".*olecuilder.*" water_translatemolecule2.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
41
42# 4. use random-perturbation
43AT_CHECK([../../molecuilder --input water_randomperturbation.xyz -o xyz --load water.xyz --set-random-number-distribution "uniform_int" --random-number-distribution-parameters "min=0;max=2;" --set-random-number-engine "mt19937" --random-number-engine-parameters "seed=120;" --select-atom-by-element O --random-perturbation 1.], 0, [ignore], [ignore])
44AT_CHECK([diff -I".*olecuilder.*" water_randomperturbation.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
45
46## 5. use stretch-bond and change-bond-angle (twice, old 0.910914 A, old angle 104.449 def)
47#AT_CHECK([../../molecuilder --input water_stretchbond_stage1.pdb -o pdb --load water.xyz -I --select-atom-by-id 2 1 --stretch-bond 1.80825], 0, [ignore], [ignore])
48#AT_CHECK([../../molecuilder --input water_stretchbond.xyz -o xyz --load water_stretchbond_stage1.pdb --select-atom-by-id 2 0 --stretch-bond 0.624311 --select-all-atoms --change-bond-angle 45.3788], 0, [ignore], [ignore])
49#AT_CHECK([diff -I".*olecuilder.*" water_stretchbond.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
50
51# 6. use fill-volume
52AT_CHECK([../../molecuilder --input water_fillvolume.xyz -o xyz --load water.xyz --create-shape --shape-name cyl --shape-type cylinder --stretch "1,1,1" --translation "5.28,6,5.628" --select-shape-by-name cyl --select-all-molecules -v 3 --fill-volume --count 12 --clear-molecule-selection --select-molecule-by-order 1 2 3 --remove-molecule --select-atom-by-element H --translate-atoms --position "-1,0,0"], 0, [ignore], [ignore])
53AT_CHECK([diff -I".*olecuilder.*" water_fillvolume.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
54
55# 7. use fill-surface
56AT_CHECK([../../molecuilder --input water_fillsurface.xyz -o xyz --load water.xyz --create-shape --shape-name ball --shape-type sphere --stretch "1,1,1" --translation "6,6,5" --select-shape-by-name ball --select-all-molecules --fill-surface --Alignment-Axis "0,1,0" --count 1 --select-atom-by-element H --translate-atoms --position "-1,0,0"], 0, [ignore], [ignore])
57AT_CHECK([diff -I".*olecuilder.*" water_fillsurface.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
58
59# 8. use remove-atom and add-atom
60AT_CHECK([../../molecuilder --input water_removeaddatom.xyz -o xyz --load water.xyz --select-atom-by-element O --remove-atom --add-atom O --domain-position "6,5,4.628"], 0, [ignore], [ignore])
61AT_CHECK([diff -I".*olecuilder.*" water_removeaddatom.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
62
63# 9. use mirror-atoms
64AT_CHECK([../../molecuilder --input water_mirroratoms.xyz -o xyz --load water.xyz --select-atom-by-element O --mirror-atoms "1,0,0" --plane-offset 5.5], 0, [ignore], [ignore])
65AT_CHECK([diff -I".*olecuilder.*" water_mirroratoms.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
66
67# 10. use scale-box
68AT_CHECK([../../molecuilder --input water_scalebox.xyz -o xyz --load water.xyz --change-box "10,0,10,0,0,10" --scale-box "1.2,1,1" --select-atom-by-id 0 --translate-atoms --position "-1.144,0,0" --invert-atoms --unselect-atom-by-element O --mirror-atoms "1,0,0" --plane-offset 4.708], 0, [ignore], [ignore])
69AT_CHECK([diff -I".*olecuilder.*" water_scalebox.xyz ${abs_top_srcdir}/tests/Examples/ManyWaysTranslateAtom/post/water_translated.xyz], 0)
70
71AT_CLEANUP
Note: See TracBrowser for help on using the repository browser.