2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2012, The GROMACS development team,
6 * check out http://www.gromacs.org for more information.
7 * Copyright (c) 2012, by the GROMACS development team, led by
8 * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9 * others, as listed in the AUTHORS file in the top-level source
10 * directory and at http://www.gromacs.org.
12 * GROMACS is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * as published by the Free Software Foundation; either version 2.1
15 * of the License, or (at your option) any later version.
17 * GROMACS is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with GROMACS; if not, see
24 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * If you want to redistribute modifications to GROMACS, please
28 * consider that scientific software is very special. Version
29 * control is crucial - bugs must be traceable. We will be happy to
30 * consider code for inclusion in the official distribution, but
31 * derived work must not be called official GROMACS. Details are found
32 * in the README & COPYING files - if they are missing, get the
33 * official version at http://www.gromacs.org.
35 * To help us fund GROMACS development, we humbly ask that you cite
36 * the research papers on the package. Check out http://www.gromacs.org.
39 #ifndef _nbnxn_search_h
40 #define _nsnxn_search_h
41 #include "visibility.h"
49 /* Returns the j-cluster size for kernel of type nb_kernel_type */
50 int nbnxn_kernel_to_cj_size(int nb_kernel_type);
52 /* Tells if the pair-list corresponding to nb_kernel_type is simple.
53 * Returns FALSE for super-sub type pair-list.
55 gmx_bool nbnxn_kernel_pairlist_simple(int nb_kernel_type);
57 /* Due to the cluster size the effective pair-list is longer than
58 * that of a simple atom pair-list. This function gives the extra distance.
61 real nbnxn_get_rlist_effective_inc(int cluster_size,real atom_density);
63 /* Allocates and initializes a pair search data structure */
64 void nbnxn_init_search(nbnxn_search_t * nbs_ptr,
66 gmx_domdec_zones_t *zones,
69 /* Put the atoms on the pair search grid.
70 * Only atoms a0 to a1 in x are put on the grid.
71 * The atom_density is used to determine the grid size.
72 * When atom_density=-1, the density is determined from a1-a0 and the corners.
73 * With domain decomposition part of the n particles might have migrated,
74 * but have not been removed yet. This count is given by nmoved.
75 * When move[i] < 0 particle i has migrated and will not be put on the grid.
76 * Without domain decomposition move will be NULL.
78 void nbnxn_put_on_grid(nbnxn_search_t nbs,
81 rvec corner0,rvec corner1,
88 nbnxn_atomdata_t *nbat);
90 /* As nbnxn_put_on_grid, but for the non-local atoms
91 * with domain decomposition. Should be called after calling
92 * nbnxn_search_put_on_grid for the local atoms / home zone.
94 void nbnxn_put_on_grid_nonlocal(nbnxn_search_t nbs,
95 const gmx_domdec_zones_t *zones,
99 nbnxn_atomdata_t *nbat);
101 /* Add simple grid type information to the local super/sub grid */
102 void nbnxn_grid_add_simple(nbnxn_search_t nbs,
103 nbnxn_atomdata_t *nbat);
105 /* Return the number of x and y cells in the local grid */
106 void nbnxn_get_ncells(nbnxn_search_t nbs,int *ncx,int *ncy);
108 /* Return the order indices *a of the atoms on the ns grid, size n */
109 void nbnxn_get_atomorder(nbnxn_search_t nbs,int **a,int *n);
111 /* Renumber the atom indices on the grid to consecutive order */
112 void nbnxn_set_atomorder(nbnxn_search_t nbs);
114 /* Initializes a set of pair lists stored in nbnxn_pairlist_set_t */
115 void nbnxn_init_pairlist_set(nbnxn_pairlist_set_t *nbl_list,
116 gmx_bool simple, gmx_bool combined,
117 nbnxn_alloc_t *alloc,
120 /* Make a apir-list with radius rlist, store it in nbl.
121 * The parameter min_ci_balanced sets the minimum required
122 * number or roughly equally sized ci blocks in nbl.
123 * When set >0 ci lists will be chopped up when the estimate
124 * for the number of equally sized lists is below min_ci_balanced.
126 void nbnxn_make_pairlist(const nbnxn_search_t nbs,
127 const nbnxn_atomdata_t *nbat,
128 const t_blocka *excl,
131 nbnxn_pairlist_set_t *nbl_list,