add_subdirectory(errorreporting)
add_subdirectory(fatalerror)
add_subdirectory(options)
+add_subdirectory(selection)
+list(APPEND LIBGROMACS_SOURCES trajana/trajana.cpp)
file(GLOB LIBGROMACS_HEADERS *.h)
install(FILES ${LIBGROMACS_HEADERS} DESTINATION ${INCL_INSTALL_DIR}/gromacs
# The nonbonded directory contains subdirectories that are only
# conditionally built, so we cannot use a GLOB_RECURSE here.
file(GLOB GMXLIB_SOURCES *.c
- selection/*.c trajana/*.c
statistics/*.c nonbonded/*.c nonbonded/nb_kernel_c/*.c)
if(GMX_DOUBLE)
# so they should not be included in the library
file(GLOB_RECURSE NOT_GMXLIB_SOURCES *_test.c *\#*)
list(REMOVE_ITEM GMXLIB_SOURCES ${NOT_GMXLIB_SOURCES})
-# Selection has test_ instead of _test. Removing here for special case, perhaps make general?
-if(GMX_FAHCORE)
- file(GLOB SELECTION_TEST selection/test*)
- list(REMOVE_ITEM GMXLIB_SOURCES ${SELECTION_TEST})
-endif(GMX_FAHCORE)
# An ugly hack to get absolute paths...
file(GLOB THREAD_MPI_SOURCES ${THREAD_MPI_SRC})
--- /dev/null
+file(GLOB SELECTION_SOURCES *.cpp)
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SELECTION_SOURCES} PARENT_SCOPE)
+
+set(SELECTION_PUBLIC_HEADERS
+ centerofmass.h
+ indexutil.h
+ nbsearch.h
+ poscalc.h
+ position.h
+ selection.h
+ selparam.h
+ selmethod.h
+ selvalue.h)
+install(FILES ${SELECTION_PUBLIC_HEADERS}
+ DESTINATION ${INCL_INSTALL_DIR}/gromacs/selection
+ COMPONENT development)
#include <pbc.h>
#include <vec.h>
-#include <centerofmass.h>
+#include "gromacs/selection/centerofmass.h"
/*!
* \param[in] top Topology structure (unused, can be NULL).
* Finally, there is a function gmx_calc_comg_blocka() that takes both the
* index group and the partitioning as a single \c t_blocka structure.
*/
-#ifndef CENTEROFMASS_H
-#define CENTEROFMASS_H
+#ifndef GMX_SELECTION_CENTEROFMASS_H
+#define GMX_SELECTION_CENTEROFMASS_H
-#include "typedefs.h"
+#include "../legacyheaders/typedefs.h"
#ifdef __cplusplus
extern "C"
#include <string2.h>
#include <vec.h>
-#include <indexutil.h>
-#include <poscalc.h>
-#include <selection.h>
-#include <selmethod.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selmethod.h"
#include "evaluate.h"
#include "keywords.h"
#include <smalloc.h>
#include <vec.h>
-#include <indexutil.h>
-#include <poscalc.h>
-#include <selection.h>
-#include <selmethod.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selmethod.h"
#include "evaluate.h"
#include "mempool.h"
#include <typedefs.h>
-#include <indexutil.h>
+#include "gromacs/selection/indexutil.h"
#include "selelem.h"
#include <typedefs.h>
#include <gmx_fatal.h>
-#include <indexutil.h>
+#include "gromacs/selection/indexutil.h"
/********************************************************************
* gmx_ana_indexgrps_t functions
* Also, the mapping functions are useful when dealing with dynamic index
* groups.
*/
-#ifndef INDEXUTIL_H
-#define INDEXUTIL_H
+#ifndef GMX_SELECTION_INDEXUTIL_H
+#define GMX_SELECTION_INDEXUTIL_H
-#include "typedefs.h"
+#include "../legacyheaders/typedefs.h"
#ifdef __cplusplus
extern "C"
#include <gmx_fatal.h>
#include <smalloc.h>
-#include <indexutil.h>
+#include "gromacs/selection/indexutil.h"
#include "mempool.h"
#include <pbc.h>
#include <vec.h>
-#include <nbsearch.h>
-#include <position.h>
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/selection/position.h"
/*! \internal \brief
* Data structure for neighborhood searches.
* of the library.
* The library also uses the functions internally.
*/
-#ifndef NBSEARCH_H
-#define NBSEARCH_H
+#ifndef GMX_SELECTION_NBSEARCH_H
+#define GMX_SELECTION_NBSEARCH_H
-#include "typedefs.h"
+#include "../legacyheaders/typedefs.h"
#include "indexutil.h"
#include <string2.h>
#include <vec.h>
-#include <position.h>
-#include <selmethod.h>
-#include <selparam.h>
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selmethod.h"
+#include "gromacs/selection/selparam.h"
#include "parsetree.h"
#include "position.h"
#include <string2.h>
#include <gmx_fatal.h>
-#include <poscalc.h>
-#include <selection.h>
-#include <selmethod.h>
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selmethod.h"
#include "keywords.h"
#include "parsetree.h"
#ifndef SELECTION_PARSETREE_H
#define SELECTION_PARSETREE_H
-/*#include <typedefs.h>*/
#include <types/simple.h>
-
-#include <selvalue.h>
+#include "gromacs/selection/selvalue.h"
struct t_selelem;
struct gmx_ana_indexgrps_t;
#include <pbc.h>
#include <vec.h>
-#include <centerofmass.h>
-#include <indexutil.h>
-#include <poscalc.h>
-#include <position.h>
+#include "gromacs/selection/centerofmass.h"
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/position.h"
/*! \internal \brief
* Collection of \c gmx_ana_poscalc_t structures for the same topology.
* The API is documented in more detail on a separate page:
* \ref poscalcengine.
*/
-#ifndef POSCALC_H
-#define POSCALC_H
+#ifndef GMX_SELECTION_POSCALC_H
+#define GMX_SELECTION_POSCALC_H
-#include "typedefs.h"
+#include "../legacyheaders/typedefs.h"
#ifdef __cplusplus
extern "C" {
#include <typedefs.h>
#include <vec.h>
-#include <indexutil.h>
-#include <position.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/position.h"
/*!
* \param[out] pos Output structure.
/*! \file
* \brief API for handling positions.
*/
-#ifndef POSITION_H
-#define POSITION_H
+#ifndef GMX_SELECTION_POSITION_H
+#define GMX_SELECTION_POSITION_H
-#include "typedefs.h"
+#include "../legacyheaders/types/simple.h"
#include "indexutil.h"
# For convenience, change to the directory where the files are located
# if the script is run from the root of the source tree.
-dirname=src/gromacs/gmxlib/selection
+dirname=src/gromacs/selection
if [[ -f $dirname/parser.y && -f $dirname/scanner.l ]] ; then
cd $dirname
fi
#include "string2.h"
#include "gmx_fatal.h"
-#include <selmethod.h>
+#include "gromacs/selection/selmethod.h"
#include "parsetree.h"
#include "selcollection.h"
#include <typedefs.h>
-#include <indexutil.h>
+#include "gromacs/selection/indexutil.h"
/*! \internal
* \brief
#include <xvgr.h>
#include <gmx_fatal.h>
-#include <poscalc.h>
-#include <selection.h>
-#include <selmethod.h>
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selmethod.h"
#include "mempool.h"
#include "selcollection.h"
* functions in this file directly unless using the selection routines outside
* the main trajectory analysis API.
*/
-#ifndef SELECTION_H
-#define SELECTION_H
+#ifndef GMX_SELECTION_SELECTION_H
+#define GMX_SELECTION_SELECTION_H
#include "position.h"
#include "indexutil.h"
#include <smalloc.h>
#include <gmx_fatal.h>
-#include <indexutil.h>
-#include <poscalc.h>
-#include <position.h>
-#include <selmethod.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selmethod.h"
#include "keywords.h"
#include "mempool.h"
#include <types/simple.h>
-#include <indexutil.h>
-#include <selvalue.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/selvalue.h"
struct gmx_ana_poscalc_t;
struct gmx_ana_selparam_t;
#include <string2.h>
#include <wman.h>
+#include "gromacs/selection/selmethod.h"
+
#include "selcollection.h"
-#include "selmethod.h"
#include "selhelp.h"
#include "symrec.h"
#include <macros.h>
#include <string2.h>
-#include <selmethod.h>
+#include "gromacs/selection/selmethod.h"
#include "selcollection.h"
#include "symrec.h"
* Instructions for implementing custom selection methods can be found
* on a separate page: \ref selmethods
*/
-#ifndef SELMETHOD_H
-#define SELMETHOD_H
+#ifndef GMX_SELECTION_SELMETHOD_H
+#define GMX_SELECTION_SELMETHOD_H
-#include "typedefs.h"
+#include "../legacyheaders/typedefs.h"
#include "indexutil.h"
#include "selparam.h"
* More details can be found on the page discussing
* \ref selmethods "custom selection methods".
*/
-#ifndef SELPARAM_H
-#define SELPARAM_H
-
-#include "typedefs.h"
+#ifndef GMX_SELECTION_SELPARAM_H
+#define GMX_SELECTION_SELPARAM_H
#include "indexutil.h"
#include "selvalue.h"
#include <smalloc.h>
-#include <indexutil.h>
-#include <position.h>
-#include <selvalue.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selvalue.h"
/*!
* \param[out] val Output structure
* There should be no need to use the data structures in this file directly
* unless implementing a custom selection routine.
*/
-#ifndef SELVALUE_H
-#define SELVALUE_H
+#ifndef GMX_SELECTION_SELVALUE_H
+#define GMX_SELECTION_SELVALUE_H
-#include "types/simple.h"
+#include "../legacyheaders/types/simple.h"
#ifdef __cplusplus
extern "C"
#include <smalloc.h>
#include <gmx_fatal.h>
-#include <selmethod.h>
+#include "gromacs/selection/selmethod.h"
/** Defines the comparison operator for comparison expressions. */
typedef enum
#include <smalloc.h>
#include <vec.h>
-#include <nbsearch.h>
-#include <position.h>
-#include <selmethod.h>
+#include "gromacs/selection/nbsearch.h"
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selmethod.h"
/*! \internal \brief
* Data structure for distance-based selection method.
#include <smalloc.h>
#include <vec.h>
-#include <indexutil.h>
-#include <position.h>
-#include <selection.h>
-#include <selmethod.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selmethod.h"
#include "selelem.h"
#include <smalloc.h>
#include <string2.h>
-#include <selmethod.h>
+#include "gromacs/selection/selmethod.h"
#include "keywords.h"
#include "parsetree.h"
#include <smalloc.h>
#include <vec.h>
-#include <position.h>
-#include <selmethod.h>
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selmethod.h"
/*! \internal \brief
* Data structure for the merging selection modifiers.
#include <smalloc.h>
#include <vec.h>
-#include <position.h>
-#include <selmethod.h>
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selmethod.h"
/*! \internal \brief
* Data structure for the \p permute selection modifier.
#include <smalloc.h>
#include <string2.h>
-#include <indexutil.h>
-#include <poscalc.h>
-#include <position.h>
-#include <selmethod.h>
+#include "gromacs/selection/indexutil.h"
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selmethod.h"
#include "keywords.h"
#include "selelem.h"
#include <smalloc.h>
#include <string2.h>
-#include <selmethod.h>
+#include "gromacs/selection/selmethod.h"
#include "keywords.h"
#include "parsetree.h"
#include <config.h>
#endif
-#include <position.h>
-#include <selmethod.h>
+#include "gromacs/selection/position.h"
+#include "gromacs/selection/selmethod.h"
/** Evaluates the \p all selection keyword. */
static int
#include <typedefs.h>
#include <gmx_fatal.h>
-#include <poscalc.h>
+#include "gromacs/selection/poscalc.h"
#include "selelem.h"
#include "symrec.h"
#include <tpxio.h>
#include <vec.h>
-#include <poscalc.h>
-#include <selection.h>
-#include <selmethod.h>
-#include <trajana.h>
+#include "gromacs/selection/poscalc.h"
+#include "gromacs/selection/selection.h"
+#include "gromacs/selection/selmethod.h"
+#include "gromacs/trajana/trajana.h"
/*! \internal \brief
* Data structure for trajectory analysis tools.
#ifndef TRAJANA_H
#define TRAJANA_H
-#include "typedefs.h"
-#include "filenm.h"
-#include "readinp.h"
+#include "../legacyheaders/typedefs.h"
+#include "../legacyheaders/filenm.h"
+#include "../legacyheaders/readinp.h"
-#include "indexutil.h"
-#include "selection.h"
+#include "../selection/indexutil.h"
+#include "../selection/selection.h"
#ifdef __cplusplus
extern "C" {
#include <statutil.h>
#include <xvgr.h>
#include <string2.h>
-#include <trajana.h>
#include "gmx_ana.h"
#include "gmx_fatal.h"
+#include "gromacs/trajana/trajana.h"
typedef struct
{