e158f982bd95bcaa65837a94ff981bdcd3a28fb4
[alexxy/gromacs.git] / src / gromacs / legacyheaders / types / fcdata.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2012,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.
10  *
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.
15  *
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.
20  *
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.
25  *
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.
33  *
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.
36  */
37 #ifndef _fcdata_h
38 #define _fcdata_h
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 typedef real rvec5[5];
45
46 /* Distance restraining stuff */
47 typedef struct {
48     int      dr_weighting; /* Weighting of pairs in one restraint              */
49     gmx_bool dr_bMixed;    /* Use sqrt of the instantaneous times              *
50                             * the time averaged violation                      */
51     real     dr_fc;        /* Force constant for disres,                       *
52                             * which is multiplied by a (possibly)              *
53                             * different factor for each restraint              */
54     real  dr_tau;          /* Time constant for disres                    */
55     real  ETerm;           /* multiplication factor for time averaging         */
56     real  ETerm1;          /* 1 - ETerm1                                       */
57     real  exp_min_t_tau;   /* Factor for slowly switching on the force         */
58     int   nres;            /* The number of distance restraints                */
59     int   npair;           /* The number of distance restraint pairs           */
60     real  sumviol;         /* The sum of violations                            */
61     real *rt;              /* The calculated instantaneous distance (npr)      */
62     real *rm3tav;          /* The calculated time averaged distance (npr)      */
63     real *Rtl_6;           /* The calculated instantaneous r^-6 (nr)           */
64     real *Rt_6;            /* The calculated inst. ens. averaged r^-6 (nr)     */
65     real *Rtav_6;          /* The calculated time and ens. averaged r^-6 (nr)  */
66     int   nsystems;        /* The number of systems for ensemble averaging     */
67 } t_disresdata;
68
69
70 /* Orientation restraining stuff */
71 typedef struct {
72     real      fc;            /* Force constant for the restraints                  */
73     real      edt;           /* Multiplication factor for time averaging           */
74     real      edt_1;         /* 1 - edt                                            */
75     real      exp_min_t_tau; /* Factor for slowly switching on the force         */
76     int       nr;            /* The number of orientation restraints               */
77     int       nex;           /* The number of experiments                          */
78     int       nref;          /* The number of atoms for the fit                    */
79     real     *mref;          /* The masses of the reference atoms                  */
80     rvec     *xref;          /* The reference coordinates for the fit (nref)       */
81     rvec     *xtmp;          /* Temporary array for fitting (nref)                 */
82     matrix    R;             /* Rotation matrix to rotate to the reference coor.   */
83     tensor   *S;             /* Array of order tensors for each experiment (nexp)  */
84     rvec5    *Dinsl;         /* The order matrix D for all restraints (nr x 5)     */
85     rvec5    *Dins;          /* The ensemble averaged D (nr x 5)                   */
86     rvec5    *Dtav;          /* The time and ensemble averaged D (nr x 5)          */
87     real     *oinsl;         /* The calculated instantaneous orientations          */
88     real     *oins;          /* The calculated emsemble averaged orientations      */
89     real     *otav;          /* The calculated time and ensemble averaged orient.  */
90     real      rmsdev;        /* The weighted (using kfac) RMS deviation            */
91     rvec5    *tmp;           /* An array of temporary 5-vectors (nex);             */
92     real   ***TMP;           /* An array of temporary 5x5 matrices (nex);          */
93     real     *eig;           /* Eigenvalues/vectors, for output only (nex x 12)    */
94
95     /* variables for diagonalization with diagonalize_orires_tensors()*/
96     double **M;
97     double  *eig_diag;
98     double **v;
99 } t_oriresdata;
100
101 typedef struct {
102     int   n;      /* n+1 is the number of points */
103     real  scale;  /* distance between two points */
104     real *data;   /* the actual table data, per point there are 4 numbers */
105 } bondedtable_t;
106
107 /*
108  * Data struct used in the force calculation routines
109  * for storing the tables for bonded interactions and
110  * for storing information which is needed in following steps
111  * (for instance for time averaging in distance retraints)
112  * or for storing output, since force routines only return the potential.
113  */
114 typedef struct {
115     bondedtable_t *bondtab;
116     bondedtable_t *angletab;
117     bondedtable_t *dihtab;
118
119     t_disresdata   disres;
120     t_oriresdata   orires;
121 } t_fcdata;
122
123 #ifdef __cplusplus
124 }
125 #endif
126
127 #endif /* _fcdata_h */