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-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
40 #define FLAG_VOLUME 02
41 #define FLAG_ATOM_AREA 04
48 int nsc_dclm_pbc(const rvec *coords, real *radius, int nat,
50 real *value_of_area, real **at_area,
52 real **lidots, int *nu_dots,
53 atom_id index[], int ePBC, matrix box);
57 The input requirements :
58 The arrays with atom coordinates and radii are thought to start
59 with index 0, i.e., places 0, 1, and 2 are the x-, y-, and z-
60 coordinates of the zero-th atom and place 0 in the other array
63 PLEASE TAKE INTO ACCOUNT THAT THE RADII GIVEN HERE ARE DIRECTLY
64 USED FOR SURFACE CALCULATION. NSC does not increment with a probe
67 The user can define any number of dots. The program selects a
68 dot density that is the lowest possible with at least the required
69 number of dots. The points are distributed in accordance with the
70 icosahedron-based or the dodecahedron-based method as described in
73 The output requirements are :
74 1 and 3 : pointer to an existing real
75 2 and 4 : pointer to an existing pointer to real
76 NSC allocates memory for an array
77 5 : pointer to an existing integer
79 The subroutine NSC makes use of variant 2 described in reference 1.
80 By selecting the necessary output via flags, the requirements for
81 cpu-time and computer memory can be adapted to the actual needs.
83 Example : flag = FLAG_VOLUME | FLAG_ATOM_AREA | FLAG_DOTS
84 The routine calculates the area, volume and the dot surface. The
85 program allocates arrays for the atomwise areas and for the surface
86 dots. The addresses are returned in the pointers to pointers to
88 This variant is not recommended because normally the dot surface
89 is needed for low point density (e.g.42) at which area and volume
90 are inaccurate. The sign "|" is used as binary AND !
92 flag = FLAG_VOLUME | FLAG_ATOM_AREA
93 In this case the large arrays for storing the surface dots
94 are not allocated. A large point number of the fully accessible
95 sphere can be selected. Good accuracy is already achieved with
96 600-700 points per sphere (accuracy of about 1.5 square Angstrem
98 Output pointers 4 and 5 may be NULL.
101 Only the dot surface is produced.
102 Output pointers 2 and 3 may be NULL.
104 The output pointer 1 cannot be set to NULL in any circumstances. The
105 overall area value is returned in every mode.
107 All files calling NSC should include nsc.h !!
110 Example for calling NSC (contents of user file):
115 int routine_calling_NSC(int n_atom, real *coordinates, real *radii) {
116 real area, volume, *atomwise_area, *surface_dots;
117 int i, density = 300, n_dots;
121 for (i=0; i<n_atom; i++) {
122 radii[i] += 1.4 /# add the probe radius if necessary #/
124 if (NSC(coordinates, radii, n_atom, density,
125 FLAG_AREA | FLAG_VOLUME | FLAG_DOTS,
126 &area, &atomwise_area, &volume, &surface_dots, &n_dots))
127 printf("error occured\n");
133 /# do something with areas, volume and surface dots #/