Basic support for 'z of ...' selections
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 29 Oct 2014 18:44:07 +0000 (20:44 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 29 Nov 2014 18:43:39 +0000 (19:43 +0100)
commit5324b41aa605758d1ab25dc3dbf4213156a6ec17
treef31bf8d66af633f772655e63140b32f2fc796dc2
parent1d8fe71690b08dcc000dcd4088f6edc7f63a937e
Basic support for 'z of ...' selections

Add basic support for selections of type 'z of ...', where "z" can in
principle be any keyword and "..." any expression.  However, currently
the only syntax that is actually supported is '[xyz] of co[gm] of ...',
because
 1) this is the original case that was discussed in gmx-users some time
    ago,
 2) only the x, y, and z keywords satisfy the constraints that the
    simplest possible implementation requires,
 3) there is no context that would accept multiple values as produced by
    an expression like 'z of resnr 1 to 3', and
 4) there is no mechanism to detect that 'z of atomnr 1' actually
    evaluates to a single value.
Some of these limitations can be lifted in the future with reasonable
effort, though.

Change-Id: I6b87ce8d5c93e1ad05722dd59a66375b52b8e363
src/gromacs/selection/keywords.h
src/gromacs/selection/parser.cpp
src/gromacs/selection/parser.y
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/parsetree.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/sm_keywords.cpp
src/gromacs/selection/sm_same.cpp
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositions.xml [new file with mode: 0644]
src/gromacs/selection/tests/selectioncollection.cpp