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,2013, 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 _nbnxn_search_h
41 #include "visibility.h"
48 /* Returns the j-cluster size for kernel of type nb_kernel_type */
49 int nbnxn_kernel_to_cj_size(int nb_kernel_type);
51 /* Tells if the pair-list corresponding to nb_kernel_type is simple.
52 * Returns FALSE for super-sub type pair-list.
54 gmx_bool nbnxn_kernel_pairlist_simple(int nb_kernel_type);
56 /* Due to the cluster size the effective pair-list is longer than
57 * that of a simple atom pair-list. This function gives the extra distance.
60 real nbnxn_get_rlist_effective_inc(int cluster_size, real atom_density);
62 /* Allocates and initializes a pair search data structure */
63 void nbnxn_init_search(nbnxn_search_t * nbs_ptr,
65 gmx_domdec_zones_t *zones,
68 /* Put the atoms on the pair search grid.
69 * Only atoms a0 to a1 in x are put on the grid.
70 * The atom_density is used to determine the grid size.
71 * When atom_density=-1, the density is determined from a1-a0 and the corners.
72 * With domain decomposition part of the n particles might have migrated,
73 * but have not been removed yet. This count is given by nmoved.
74 * When move[i] < 0 particle i has migrated and will not be put on the grid.
75 * Without domain decomposition move will be NULL.
77 void nbnxn_put_on_grid(nbnxn_search_t nbs,
80 rvec corner0, rvec corner1,
85 int nmoved, int *move,
87 nbnxn_atomdata_t *nbat);
89 /* As nbnxn_put_on_grid, but for the non-local atoms
90 * with domain decomposition. Should be called after calling
91 * nbnxn_search_put_on_grid for the local atoms / home zone.
93 void nbnxn_put_on_grid_nonlocal(nbnxn_search_t nbs,
94 const gmx_domdec_zones_t *zones,
98 nbnxn_atomdata_t *nbat);
100 /* Add simple grid type information to the local super/sub grid */
101 void nbnxn_grid_add_simple(nbnxn_search_t nbs,
102 nbnxn_atomdata_t *nbat);
104 /* Return the number of x and y cells in the local grid */
105 void nbnxn_get_ncells(nbnxn_search_t nbs, int *ncx, int *ncy);
107 /* Return the order indices *a of the atoms on the ns grid, size n */
108 void nbnxn_get_atomorder(nbnxn_search_t nbs, int **a, int *n);
110 /* Renumber the atom indices on the grid to consecutive order */
111 void nbnxn_set_atomorder(nbnxn_search_t nbs);
113 /* Initializes a set of pair lists stored in nbnxn_pairlist_set_t */
114 void nbnxn_init_pairlist_set(nbnxn_pairlist_set_t *nbl_list,
115 gmx_bool simple, gmx_bool combined,
116 nbnxn_alloc_t *alloc,
119 /* Make a apir-list with radius rlist, store it in nbl.
120 * The parameter min_ci_balanced sets the minimum required
121 * number or roughly equally sized ci blocks in nbl.
122 * When set >0 ci lists will be chopped up when the estimate
123 * for the number of equally sized lists is below min_ci_balanced.
125 void nbnxn_make_pairlist(const nbnxn_search_t nbs,
126 nbnxn_atomdata_t *nbat,
127 const t_blocka *excl,
130 nbnxn_pairlist_set_t *nbl_list,