3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
9 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11 * Copyright (c) 2001-2009, The GROMACS development team,
12 * check out http://www.gromacs.org for more information.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * If you want to redistribute modifications, please consider that
20 * scientific software is very special. Version control is crucial -
21 * bugs must be traceable. We will be happy to consider code for
22 * inclusion in the official distribution, but derived work must not
23 * be called official GROMACS. Details are found in the README & COPYING
24 * files - if they are missing, get the official version at www.gromacs.org.
26 * To help us fund GROMACS development, we humbly ask that you cite
27 * the papers on the package - you can find them in the top README file.
29 * For more info, check our website at http://www.gromacs.org
32 * \brief API for on-line calculation of displacements.
34 * The API is documented in more detail on a separate page:
37 * The functions within this file can be used and developed independently of
38 * the other parts of the library.
39 * Other parts of the library do not reference these functions.
41 #ifndef DISPLACEMENT_H
42 #define DISPLACEMENT_H
51 /** Data structure for displacement calculation. */
52 typedef struct gmx_ana_displ_t gmx_ana_displ_t
;
56 /** Allocates memory for displacement calculation. */
58 gmx_ana_displ_create(gmx_ana_displ_t
**d
, int nmax
, real tmax
);
59 /** Initializes displacement calculation for a frame. */
61 gmx_ana_displ_start_frame(gmx_ana_displ_t
*d
, real t
);
62 /** Returns the number of steps corresponding to a given time interval. */
64 gmx_ana_displ_time_to_steps(gmx_ana_displ_t
*d
, real time
, int *nsteps
);
65 /** Stores the position of a particle for displacement calculation. */
67 gmx_ana_displ_store(gmx_ana_displ_t
*d
, atom_id id
, rvec x
, bool bPres
);
68 /** Convenience function for storing an array of particle positions for displacement calculation. */
70 gmx_ana_displ_store_array(gmx_ana_displ_t
*d
, int n
, atom_id id
[], rvec x
[]);
71 /** Stores an array of particle positions for displacement calculation, including unselected particles. */
73 gmx_ana_displ_store_all(gmx_ana_displ_t
*d
, atom_id id
[], rvec x
[]);
74 /** Convenience function for storing a set of positions from \c gmx_ana_pos_t. */
76 gmx_ana_displ_store_pos(gmx_ana_displ_t
*d
, struct gmx_ana_pos_t
*p
);
77 /** Calculates the displacement vector for a particle. */
79 gmx_ana_displ_vector(gmx_ana_displ_t
*d
, int step
, t_pbc
*pbc
,
80 atom_id id
, rvec x
, rvec xout
, bool *pout
);
81 /** Calculates the displacement vectors for a list of particles. */
83 gmx_ana_displ_vectors(gmx_ana_displ_t
*d
, int step
, t_pbc
*pbc
,
84 int n
, atom_id id
[], rvec x
[],
85 rvec xout
[], bool *pout
);
86 /** Calculates the displacement vectors for all particles, including unselected. */
88 gmx_ana_displ_vectors_all(gmx_ana_displ_t
*d
, int step
, t_pbc
*pbc
,
89 rvec x
[], rvec xout
[], bool *pout
);
90 /** Frees the memory allocated for displacement calculation. */
92 gmx_ana_displ_free(gmx_ana_displ_t
*d
);