Fixed more doxygen warnings in gmxlib
authorChristoph Junghans <junghans@votca.org>
Mon, 26 Mar 2012 17:14:50 +0000 (11:14 -0600)
committerChristoph Junghans <junghans@votca.org>
Mon, 26 Mar 2012 17:14:50 +0000 (11:14 -0600)
Change-Id: I99a3de2211d971f6297b12a80e85fc930cf35665

src/gromacs/gmxlib/index.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_c.h
src/gromacs/gmxlib/nonbonded/nb_kerneltype.h

index acdf06b8d2646b95de51bd832c901d8329784a56..4d899379123c5d7f16f7ce58012cda555c9c76ca 100644 (file)
@@ -311,23 +311,23 @@ static void analyse_other(const char ** restype,t_atoms *atoms,
  *         analyse_prot(). */
 typedef struct gmx_help_make_index_group
 {
-  /* The set of atom names that will be used to form this index group */
+  /** The set of atom names that will be used to form this index group */
   const char **defining_atomnames;
-  /* Size of the defining_atomnames array */
+  /** Size of the defining_atomnames array */
   const int num_defining_atomnames;
-  /* Name of this index group */
+  /** Name of this index group */
   const char *group_name;
-  /* Whether the above atom names name the atoms in the group, or
-   * those not in the group */
+  /** Whether the above atom names name the atoms in the group, or
+      those not in the group */
   gmx_bool bTakeComplement;
-  /* The index in wholename gives the first item in the arrays of
-   * atomnames that should be tested with 'gmx_strncasecmp' in stead of
-   * gmx_strcasecmp, or -1 if all items should be tested with strcasecmp
-   * This is comparable to using a '*' wildcard at the end of specific
-   * atom names, but that is more involved to implement...
+  /** The index in wholename gives the first item in the arrays of
+     atomnames that should be tested with 'gmx_strncasecmp' in stead of
+     gmx_strcasecmp, or -1 if all items should be tested with strcasecmp
+     This is comparable to using a '*' wildcard at the end of specific
+     atom names, but that is more involved to implement...
    */
   int wholename;
-  /* Only create this index group if it differs from the one specified in compareto,
+  /** Only create this index group if it differs from the one specified in compareto,
      where -1 means to always create this group. */
   int compareto;
 } t_gmx_help_make_index_group;
index c24b95263bb19074540ed5d251b5cce075315c50..6897154b1024ed59dea2ed96ec1897e7c7f4a601 100644 (file)
 #include "nb_kernel_allvsall.h"
 #include "nb_kernel_allvsallgb.h"
 
+/** \brief setup list with vanilla nonbonded kernels written in C
+ * \param[in] fplog General output file, normally md.log
+ * \param[in,out] list list to write the kernels in
+ */
 void
 nb_kernel_setup(FILE *fplog,nb_kernel_t **list);
 
index 6c8e443567d9bd53115e38be9935b34dfb07f0c7..79f5c425282795c6a8717938a94dc62845b1717b 100644 (file)
@@ -337,6 +337,241 @@ nb_kernel_t(int *             nri,
 
 
 
+/** Interface to level1 nonbonded AdResS kernels.
+ * 
+ * The parameters are the same as for \ref nb_kernel_t except for the last, so
+ * please consult its documentation as well.
+ * 
+ *  \param nri        Number of neighborlists/i-particles/outer-particles.
+ *                    The outer loop of the nonbonded kernel will iterate
+ *                    over these indices. This number must always
+ *                    be provided,
+ *  \param iinr       Atom number (starting on 0) for each index 0..(nri-1)
+ *                    in the outer loop. These are the 'owner'/'parent' 
+ *                    particles of each neighborlist. It is quite common
+ *                    that a particle occurs several times with different
+ *                    shift indices. This is the field 'ilist' in 
+ *                    the neighborlist. This array must always be provided.
+ *  \param jindex     This array specifies the index  of the first j neighbor
+ *                    in the array jjnr[] which belongs to the corresponding
+ *                    i atom. The j neighbors for all lists are merged into
+ *                    one continous array, so we also get the first index for
+ *                    the next list in the next element. The size of this list
+ *                    is nri+1, and the last position contains the number of
+ *                    entries in the j list. Confused? It is actually pretty
+ *                    straightforward; for index <tt>i</tt> the i atom is 
+ *                    <tt>iinr[i]</tt>, and the atom indices of the neighbors 
+ *                    to interact with are in positions <tt>jindex[i]</tt> 
+ *                    through <tt>(jindex[i+1]-1)</tt> in <tt>jjnr[]</tt>.
+ *                    This corresponds to ilist_jindex in the neighborlist.
+ *                    This array must always be provided.
+ *  \param jjnr       Array with the j particle neighbors of list i in positions
+ *                    <tt>jindex[i]</tt> through <tt>(jindex[i+1]-1)</tt>. This
+ *                    field is called jlist in the neighborlist structure.
+ *                    This array must always be provided.
+ *  \param shift      Array with shift vector index corresponding to each 
+ *                    iinr neighborlist. In most codes, periodic boundary 
+ *                    conditions are applied by checking pairwise distances 
+ *                    of particles, and correcting differences of more than 
+ *                    half a box. This is costly (latencies) and unnecessary 
+ *                    since we already decided which periodic copy to use during
+ *                    neighborsearching. We solve this by introducing 
+ *                    \a shiftvectors and a \a shiftindex. The shiftvectors is 
+ *                    normally an array of 3*3*3 vectors, corresponding to 
+ *                    displacements +- one box unit in one or more directions.
+ *                    The central box (no displacement) is always in the middle,
+ *                    index 13 in the case of 3*3*3 shift vectors.
+ *                    Imagine a particle interacting with two particles in the
+ *                    current box, and three particles in the box to the left. 
+ *                    We represent this with two ilist entries, one with shift 
+ *                    index=13 (central box) and one with shift index=12. 
+ *                    all neighbors in each sublist will have the same shift,  
+ *                    so in the nonbonded interaction, we only have to add the 
+ *                    shift vector to the outer (i) particle coordinates before
+ *                    starting the loop over neighbors. This extracts periodic 
+ *                    boundary condition calculations from the inner loops, 
+ *                    increasing performance significantly. This array must
+ *                    always be provided, but if you do not use any periodic
+ *                    boundary conditions you could set all elements to zero
+ *                    and provide a shiftvec array of length three, with all
+ *                    elements there too being zero.
+ *  \param shiftvec   The shift vectors for each index. Since the code needs to
+ *                    interface with Fortran or assembly, we have to use 
+ *                    pointers to float/double instead of the gmx_rvec_t type.
+ *                    The x/y/z shift distances for shift index idx are in
+ *                    <tt>shiftvec[3*idx]</tt>, <tt>shiftvec[3*idx+1]</tt>, 
+ *                    and <tt>shiftvec[3*idx+2]</tt>. This is fully binary 
+ *                    compatible with an array of gmx_rvec_t, so you can simply
+ *                    use a typecast when calling. The length of the array is
+ *                    three times the number of shift indices. This array
+ *                    must be provided, but see the comment for shift.
+ *  \param fshift     Forces from 'other periodic boxes' for each shift index.
+ *                    The shift concept does not affect the forces on individual
+ *                    atoms, but it will have an effect on the virial. To 
+ *                    account for this, we add the total force on the i particle 
+ *                    in each outer loop to the current shift index in this 
+ *                    array, which has exactly the same dimensions as the 
+ *                    shiftvec array above. The Gromacs manual describes how 
+ *                    this is used to calculate the effect in the virial.
+ *                    Dimension is identical to shiftvec.
+ *                    For kernels that do not calculate forces this can be NULL.
+ *  \param gid        Energy group index for each i neighborlist index; this
+ *                    corresponds to ilist_groupindex in the neighborlist and is
+ *                    used to decompose energies into groupwise contributions.
+ *                    If an i particle belongs to group A, and has interactions 
+ *                    both with groups A,B, and C, you will get three different 
+ *                    i list entries with energy group indices corresponding to 
+ *                    A-A, A-B, and A-C neighbors, in addition to possible
+ *                    copies due to different shift indices. The energies will 
+ *                    be added to this index (i.e. index=gid[i]) in the vc and 
+ *                    vnb arrays. This array must always be provided.
+ *                    If you don't want to decompose energies all groups should 
+ *                    be set to index 0 (length or the array nri).
+ *  \param pos        Coordinates of atoms, starting on 0 as all arrays. To
+ *                    interface with fortran and assembly this is a simple list
+ *                    of floats, with x/y/z of atom n in positions
+ *                    <tt>pos[3*n]</tt>, <tt>pos[3*n+1]</tt>, and
+ *                    <tt>pos[3*n+2]</tt>. This is binary compatible with,
+ *                    and can be typecast from, an array of gmx_rvec_t.
+ *                    This array must always be provided.
+ *  \param faction    Forces of atoms. To interface with fortran and assembly 
+ *                    this is a simple list of floats, with x/y/z of atom n in 
+ *                    positions <tt>pos[3*n]</tt>, <tt>pos[3*n+1]</tt>, and
+ *                    <tt>pos[3*n+2]</tt>. This is binary compatible with,
+ *                    and can be typecast from, an array of gmx_rvec_t.
+ *                    For kernels that do not calculate forces this can be NULL.
+ *  \param charge     Array with the charge of atom n in position n.
+ *                    If you are calling a kernel without coulomb interaction
+ *                    this parameter can safely be set to NULL.
+ *  \param facel      Factor to multiply all electrostatic interactions with;
+ *                    this is essentially 1/(4*pi*epsilon). For kernels without
+ *                    coulomb interaction the value will not be used. In the
+ *                    fortran version (pass-by-reference) it can be NULL in
+ *                    that case.
+ *  \param krf        The 'k' constant for reaction-field electrostatic
+ *                    interactions. Can be zero/NULL for non-RF interactions.
+ *  \param crf        The 'c' constant for reaction-field electrostatic
+ *                    interactions. Can be zero/NULL for non-RF interactions.
+ *  \param vc         List of Coulomb energies, the length is equal to the
+ *                    number of energy group combinations. As described for
+ *                    gid above, the coulomb energy of each outer/i-particle
+ *                    list will be added to vc[gid[i]]. Can be NULL for
+ *                    kernels without electrostatic interaction.
+ *  \param type       Array with the index of the Van der Waals type for each
+ *                    atom, starting on 0 . This is used to look up the VdW 
+ *                    parameters. When no VdW interactions are calculated 
+ *                    (i.e. only Coulomb), this can be set to NULL. 
+ *  \param ntype      Number of VdW types, used to look up the VdW parameters. 
+ *                    This parameter can be zero (NULL for pass-by-reference)
+ *                    if the kernel does not include VdW interactions.
+ *  \param vdwparam   Array with Van der Waals parameters. The contents and 
+ *                    size depends on the number of parameters required for
+ *                    the selected VdW interaction (3 for B-ham, 2 for LJ, etc).
+ *                    There are a total of ntype*ntype pair combinations, and 
+ *                    the size of this array is the number of such pairs times
+ *                    the number of parameters.
+ *                    With 'nparam' parameters, and 'ntype' types in total,
+ *                    the first parameter for interactions between atoms of VdW 
+ *                    type 'ti' and VdW type 'tj' is located in
+ *                    <tt>vdwparam[nparam*(ntype*ti+tj)]</tt>, and the 
+ *                    additional parameters follow directly in the next 
+ *                    position(s). Note that the array corresponds to a 
+ *                    symmetric matrix - you should get the same parameters if
+ *                    you swap ti and tj. This parameter can be NULL 
+ *                    if the kernel does not include VdW interactions.
+ *  \param vvdw       List of Van der Waals energies, the length is equal to 
+ *                    the number of energy group combinations. As described 
+ *                    for gid above, the coulomb energy of each outer list
+ *                    will be added to vc[gid[i]]. Can be NULL for
+ *                    kernels without electrostatic interaction.
+ *  \param tabscale   Distance between table points in the vftab table.
+ *                    This is always the same for Coulomb and VdW when both
+ *                    are tabulated. If the kernel does not include any
+ *                    tabulated interactions it can be zero, or NULL when
+ *                    passed-by-reference.
+ *  \param vftab      Table data for Coulomb and/or VdW interactions. 
+ *                    Each 'point' in the table consists of the four 
+ *                    floating-point numbers Y,F,G,H as described in the
+ *                    Gromacs manual. If the kernel only tabulates the 
+ *                    Coulomb interaction this is followed by the next
+ *                    point. If both Coulomb and Van der Waals interactions 
+ *                    are tabulated it is instead followed by another
+ *                    four numbers for the dispersion table at the same
+ *                    point, and then finally the repulsion table, i.e.
+ *                    a total of 12 numbers per table point. If only 
+ *                    Van der Waals interactions are tabulated the 
+ *                    Dispersion and Repulsion table (in that order) use
+ *                    a total of 8 floating-point numbers per point.
+ *                    This array only needs to be provided for kernels with
+ *                    tabulated interactions - otherwise it can be NULL.
+ *  \param invsqrta   Array with the inverse square root of the born radius
+ *                    of each atom. This can safely be NULL when the kernel
+ *                    does not calculate Generalized Born interactions.
+ *  \param dvda       Array where the derivative of the potential with respect
+ *                    to the born radius for each atom will be written. This
+ *                    is necessary to calculate the effect of born radius
+ *                    derivatives on forces. However, just as for the force
+ *                    arrays it must be provided even when not calculating
+ *                    forces, since an implementation might not provide a
+ *                    non-force version of the routine. When the kernel does
+ *                    not calculate Generalized Born interactions it can 
+ *                    safely be set to NULL, though.
+ *  \param gbtabscale Distance between (scaled) table points for tabulated 
+ *                    Generalized Born interactions. If the kernel does not 
+ *                    calculate Generalized Born interactions it can be zero, 
+ *                    or NULL when passed-by-reference. Note that this is 
+ *                    usually different from the standard (non-GB) table scale.
+ *  \param gbtab      Table data for Generalized Born Coulomb interactions.
+ *                    Since these interactions contain parameters that 
+ *                    enter in a non-trivial way I have introduced a trick
+ *                    where the tabulated interaction is a function of
+ *                    the distance scaled with the square roots of the two
+ *                    born radii. Apart from this it contains similar 
+ *                    data (Y,F,G,H) as the normal Coulomb/VdW tables.
+ *                    See comments in the table code for details. This
+ *                    can safely be set to NULL if you are not using
+ *                    Generalized Born interactions.
+ *  \param nthreads   Number of threads calling the kernel concurrently.
+ *                    This value is only used to optimize the chunk size
+ *                    of the neighborlists processed by each thread, so
+ *                    it won't cause incorrect results if you get it wrong.
+ *  \param count      Pointer to a common counter to synchronize 
+ *                    multithreaded execution. This is normally the counter
+ *                    in the neighborlist. It must be set to zero before
+ *                    calling the kernel to get correct results. Note that
+ *                    this is necessary even for a single thread if Gromacs
+ *                    is compiled with thread support (meaning it is
+ *                    a mandatory parameter).
+ *  \param mtx        Pointer to a mutex protecting the counter, masked as 
+ *                    a pointer-to-void since thread support is optional. 
+ *                    However, if Gromacs is compiled with threads you \a must 
+ *                    provide a mutex - it would hurt performance to check
+ *                    it for each iteration in the nonbonded kernel. The
+ *                    mutex is normally created automatically by the 
+ *                    neighborlist initialization routine gmx_nlist_init().
+ *                    (Yet another reason not to call kernels directly).
+ *  \param outeriter  The number of iterations performed in the outer loop
+ *                    of the kernel will be written to this integer. If
+ *                    multiple threads are calling the loop this will be
+ *                    the part of nri handled by this thread. 
+ *                    This value is only used to get accurate flop accounting.
+ *                    Since we cannot check for NULL pointers in Fortran it must
+ *                    always be provided, but you can discard
+ *                    the result if you don't need it.
+ *  \param inneriter  The number of iterations performed in the inner loop
+ *                    of the kernel will be written to this integer; compare
+ *                    with nouter. Since we cannot check for NULL pointers in
+ *                    Fortran it must always be provided, but you can discard
+ *                    the result if you don't need it.
+ *  \param work       Double precision work array - to be used for optimization.
+ *  \param[in] wf     Array with the AdResS weight function of the atom n in
+ *                    position n.
+ *
+ *  \warning          There is \a very little error control inside
+ *                    the nonbonded kernels in order to maximize performance.
+ *                    It cannot be overemphasized that you should never call
+ *                    them directly, but rely on the higher-level routines.
+ */
 typedef void
 nb_adress_kernel_t(int *             nri,
             int *             iinr,