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_atomdata_h
40 #define _nsnxn_atomdata_h
49 /* Default nbnxn allocation routine, allocates 32 byte aligned,
50 * which works for plain C and aligned SSE and AVX loads/stores.
52 void nbnxn_alloc_aligned(void **ptr,size_t nbytes);
54 /* Free function for memory allocated with nbnxn_alloc_aligned */
55 void nbnxn_free_aligned(void *ptr);
57 /* Reallocation wrapper function for nbnxn data structures */
58 void nbnxn_realloc_void(void **ptr,
59 int nbytes_copy,int nbytes_new,
63 /* Reallocate the nbnxn_atomdata_t for a size of n atoms */
64 void nbnxn_atomdata_realloc(nbnxn_atomdata_t *nbat,int n);
66 /* Copy na rvec elements from x to xnb using nbatFormat, start dest a0,
67 * and fills up to na_round using cx,cy,cz.
69 void copy_rvec_to_nbat_real(const int *a,int na,int na_round,
70 rvec *x,int nbatFormat,real *xnb,int a0,
71 int cx,int cy,int cz);
73 /* Initialize the non-bonded atom data structure.
74 * The enum for nbatXFormat is in the file defining nbnxn_atomdata_t.
75 * Copy the ntypes*ntypes*2 sized nbfp non-bonded parameter list
76 * to the atom data structure.
78 void nbnxn_atomdata_init(FILE *fp,
79 nbnxn_atomdata_t *nbat,
81 int ntype,const real *nbfp,
87 /* Copy the atom data to the non-bonded atom data structure */
88 void nbnxn_atomdata_set(nbnxn_atomdata_t *nbat,
90 const nbnxn_search_t nbs,
91 const t_mdatoms *mdatoms,
94 /* Copy the shift vectors to nbat */
95 void nbnxn_atomdata_copy_shiftvec(gmx_bool dynamic_box,
97 nbnxn_atomdata_t *nbat);
100 * FillLocal tells if the local filler particle coordinates should be zeroed.
102 void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search_t nbs,
106 nbnxn_atomdata_t *nbat);
108 /* Add the forces stored in nbat to f, zeros the forces in nbat */
109 void nbnxn_atomdata_add_nbat_f_to_f(const nbnxn_search_t nbs,
111 const nbnxn_atomdata_t *nbat,
114 /* Add the fshift force stored in nbat to fshift */
115 void nbnxn_atomdata_add_nbat_fshift_to_fshift(const nbnxn_atomdata_t *nbat,