Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / legacyheaders / types / fcdata.h
1 /*
2  * 
3  *                This source code is part of
4  * 
5  *                 G   R   O   M   A   C   S
6  * 
7  *          GROningen MAchine for Chemical Simulations
8  * 
9  *                        VERSION 3.2.0
10  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12  * Copyright (c) 2001-2004, The GROMACS development team,
13  * check out http://www.gromacs.org for more information.
14
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  * 
20  * If you want to redistribute modifications, please consider that
21  * scientific software is very special. Version control is crucial -
22  * bugs must be traceable. We will be happy to consider code for
23  * inclusion in the official distribution, but derived work must not
24  * be called official GROMACS. Details are found in the README & COPYING
25  * files - if they are missing, get the official version at www.gromacs.org.
26  * 
27  * To help us fund GROMACS development, we humbly ask that you cite
28  * the papers on the package - you can find them in the top README file.
29  * 
30  * For more info, check our website at http://www.gromacs.org
31  * 
32  * And Hey:
33  * GRoups of Organic Molecules in ACtion for Science
34  */
35 #ifndef _fcdata_h
36 #define _fcdata_h
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 typedef real rvec5[5];
43
44 /* Distance restraining stuff */
45 typedef struct {
46   int  dr_weighting;  /* Weighting of pairs in one restraint              */
47   gmx_bool dr_bMixed;     /* Use sqrt of the instantaneous times              *
48                        * the time averaged violation                      */
49   real dr_fc;         /* Force constant for disres,                       *
50                        * which is multiplied by a (possibly)              *
51                        * different factor for each restraint              */
52   real dr_tau;        /* Time constant for disres                         */
53   real ETerm;         /* multiplication factor for time averaging         */
54   real ETerm1;        /* 1 - ETerm1                                       */
55   real exp_min_t_tau; /* Factor for slowly switching on the force         */
56   int  nres;          /* The number of distance restraints                */
57   int  npair;         /* The number of distance restraint pairs           */
58   real sumviol;       /* The sum of violations                            */
59   real *rt;           /* The calculated instantaneous distance (npr)      */
60   real *rm3tav;       /* The calculated time averaged distance (npr)      */
61   real *Rtl_6;        /* The calculated instantaneous r^-6 (nr)           */
62   real *Rt_6;         /* The calculated inst. ens. averaged r^-6 (nr)     */
63   real *Rtav_6;       /* The calculated time and ens. averaged r^-6 (nr)  */
64   int  nsystems;      /* The number of systems for ensemble averaging     */
65 } t_disresdata;
66
67
68 /* Orientation restraining stuff */
69 typedef struct {
70   real   fc;          /* Force constant for the restraints                  */
71   real   edt;         /* Multiplication factor for time averaging           */
72   real   edt_1;        /* 1 - edt                                            */
73   real   exp_min_t_tau; /* Factor for slowly switching on the force         */
74   int    nr;          /* The number of orientation restraints               */
75   int    nex;         /* The number of experiments                          */
76   int  nref;          /* The number of atoms for the fit                    */
77   real *mref;         /* The masses of the reference atoms                  */
78   rvec *xref;         /* The reference coordinates for the fit (nref)       */
79   rvec *xtmp;         /* Temporary array for fitting (nref)                 */
80   matrix R;           /* Rotation matrix to rotate to the reference coor.   */
81   tensor *S;          /* Array of order tensors for each experiment (nexp)  */
82   rvec5  *Dinsl;      /* The order matrix D for all restraints (nr x 5)     */
83   rvec5  *Dins;       /* The ensemble averaged D (nr x 5)                   */
84   rvec5  *Dtav;       /* The time and ensemble averaged D (nr x 5)          */
85   real   *oinsl;      /* The calculated instantaneous orientations          */
86   real   *oins;       /* The calculated emsemble averaged orientations      */
87   real   *otav;       /* The calculated time and ensemble averaged orient.  */
88   real   rmsdev;      /* The weighted (using kfac) RMS deviation            */
89   rvec5  *tmp;        /* An array of temporary 5-vectors (nex);             */ 
90   real   ***TMP;      /* An array of temporary 5x5 matrices (nex);          */
91   real   *eig;        /* Eigenvalues/vectors, for output only (nex x 12)    */
92
93   /* variables for diagonalization with diagonalize_orires_tensors()*/
94   double **M;
95   double *eig_diag;
96   double **v;
97 } t_oriresdata;
98
99 /* 
100  * Data struct used in the force calculation routines
101  * for storing the tables for bonded interactions and
102  * for storing information which is needed in following steps
103  * (for instance for time averaging in distance retraints)
104  * or for storing output, since force routines only return the potential.
105  */
106 typedef struct {
107   bondedtable_t *bondtab;
108   bondedtable_t *angletab;
109   bondedtable_t *dihtab;
110
111   t_disresdata disres;
112   t_oriresdata orires;
113 } t_fcdata;
114
115 #ifdef __cplusplus
116 }
117 #endif
118
119 #endif /* _fcdata_h */