Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / src / contrib / do_gct.h
1 /*
2  * $Id$
3  * 
4  *                This source code is part of
5  * 
6  *                 G   R   O   M   A   C   S
7  * 
8  *          GROningen MAchine for Chemical Simulations
9  * 
10  *                        VERSION 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  * 
21  * If you want to redistribute modifications, please consider that
22  * scientific software is very special. Version control is crucial -
23  * bugs must be traceable. We will be happy to consider code for
24  * inclusion in the official distribution, but derived work must not
25  * be called official GROMACS. Details are found in the README & COPYING
26  * files - if they are missing, get the official version at www.gromacs.org.
27  * 
28  * To help us fund GROMACS development, we humbly ask that you cite
29  * the papers on the package - you can find them in the top README file.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Gromacs Runs On Most of All Computer Systems
35  */
36
37 #ifndef _do_gct_h
38 #define _do_gct_h
39
40 static char *SRCID_do_gct_h = "$Id$";
41 #include <stdio.h>
42 #include "typedefs.h"
43 #include "filenm.h"
44 #include "network.h"
45
46 enum { eoPres, eoEpot, eoVir, eoDist, eoMu, eoForce, eoFx, eoFy, eoFz,
47        eoPx, eoPy, eoPz, 
48        eoPolarizability, eoDipole, eoObsNR, 
49        eoMemory=eoObsNR, eoInter, eoUseVirial,  eoNR };
50 extern char *eoNames[eoNR];
51
52 typedef struct {
53   int  at_i,at_j;       /* Atom type # for i and j                      */
54   int  eObs;            /* Observable to couple to                      */
55   bool bPrint;          /* Does this struct have to be printed          */
56   real c6,c12;          /* Actual value of params                       */
57   real xi_6,xi_12;      /* Constants for coupling C6 and C12            */
58 } t_coupl_LJ;
59
60 typedef struct {
61   int  at_i,at_j;       /* Atom type # for i and j                      */
62   int  eObs;            /* Observable to couple to                      */
63   bool bPrint;          /* Does this struct have to be printed          */
64   real a,b,c;           /* Actual value of params                       */
65   real xi_a,xi_b,xi_c;  /* Constants for coupling A, B and C            */
66 } t_coupl_BU;
67
68 typedef struct {
69   int  at_i;            /* Atom type                                    */
70   int  eObs;            /* Observable to couple to                      */
71   bool bPrint;          /* Does this struct have to be printed          */
72   real Q;               /* Actual value of charge                       */
73   real xi_Q;            /* Constant for coupling Q                      */
74 } t_coupl_Q;
75
76 typedef struct {
77   int       type;       /* Type number in the iparams struct    */
78   int       eObs;       /* Observable to couple to              */
79   t_iparams xi;         /* Parameters that need to be changed   */
80   t_iparams iprint;
81 } t_coupl_iparams;
82
83 typedef struct {
84   real       act_value[eoObsNR];
85   real       av_value [eoObsNR];
86   real       ref_value[eoObsNR];
87   bool       bObsUsed[eoObsNR];
88   int        nLJ,nBU,nQ,nIP;
89   t_coupl_LJ *tcLJ;
90   t_coupl_BU *tcBU;
91   t_coupl_Q  *tcQ;
92   t_coupl_iparams *tIP;
93   int        nmemory;
94   bool       bInter;
95   bool       bVirial;
96 } t_coupl_rec;
97
98 extern void write_gct(char *fn,t_coupl_rec *tcr,t_idef *idef);
99
100 extern void read_gct(char *fn,t_coupl_rec *tcr);
101
102 extern void comm_tcr(FILE *log,t_commrec *cr,t_coupl_rec **tcr);
103
104 extern void copy_ff(t_coupl_rec *tcr,t_forcerec *fr,t_mdatoms *md,
105                     t_idef *idef);
106
107 extern t_coupl_rec *init_coupling(FILE *log,int nfile,t_filenm fnm[],
108                                   t_commrec *cr,t_forcerec *fr,t_mdatoms *md,
109                                   t_idef *idef);
110                                   
111 extern void calc_force(int natom,rvec f[],rvec fff[]);
112
113 extern void calc_f_dev(int natoms,real charge[],rvec x[],rvec f[],
114                        t_idef *idef,real *xiH,real *xiS);
115
116 extern void do_coupling(FILE *log,int nfile,t_filenm fnm[],
117                         t_coupl_rec *tcr,real t,int step,real ener[],
118                         t_forcerec *fr,t_inputrec *ir,bool bMaster,
119                         t_mdatoms *md,t_idef *idef,real mu_aver,int nmols,
120                         t_commrec *cr,matrix box,tensor virial,
121                         tensor pres,rvec mu_tot,
122                         rvec x[],rvec f[],bool bDoIt);
123                      
124 #endif