Fixing copyright issues and code contributors
[alexxy/gromacs.git] / src / contrib / ehdata.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  * check out http://www.gromacs.org for more information.
7  * Copyright (c) 2012,2013, by the GROMACS development team, led by
8  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9  * others, as listed in the AUTHORS file in the top-level source
10  * directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38         
39 extern real get_omega(real ekin,int *seed,FILE *fp,char *fn);
40
41 extern real get_q_inel(real ekin,real omega,int *seed,FILE *fp,char *fn);
42
43 extern real get_theta_el(real ekin,int *seed,FILE *fp,char *fn);
44
45 extern real cross_inel(real ekin,real rho,char *fn);
46
47 extern real cross_el(real ekin,real rho,char *fn);
48
49 extern real band_ener(int *seed,FILE *fp,char *fn);
50
51 extern void init_tables(int nfile,t_filenm fnm[], real rho);
52 /* Must be called before any of the table lookup thingies */
53
54 extern void test_tables(int *seed,char *fn,real rho);
55
56 /*******************************************************************
57  *
58  * Functions to make histograms
59  *
60  *******************************************************************/   
61         
62 enum { enormNO, enormFAC, enormNP, enormNR };
63
64 typedef struct {
65   int np;
66   real minx,maxx,dx,dx_1;
67   real *y;
68   int  *nh;
69 } t_histo;
70
71 extern t_histo *init_histo(int np,real minx,real maxx);
72
73 extern void done_histo(t_histo *h);
74
75 extern void add_histo(t_histo *h,real x,real y);
76
77 extern void dump_histo(t_histo *h,char *fn,char *title,char *xaxis,char *yaxis,
78                        int enorm,real norm_fac);
79
80
81 /*******************************************************************
82  *
83  * Functions to analyse and monitor scattering
84  *
85  *******************************************************************/   
86         
87 typedef struct {
88   int  np,maxp;
89   real *time;
90   real *ekin;
91   gmx_bool *bInel;
92   rvec *pos;
93 } t_ana_scat;
94
95 extern void add_scatter_event(t_ana_scat *scatter,rvec pos,gmx_bool bInel,
96                               real t,real ekin);
97                               
98 extern void reset_ana_scat(t_ana_scat *scatter);
99
100 extern void done_scatter(t_ana_scat *scatter);
101
102 extern void analyse_scatter(t_ana_scat *scatter,t_histo *hmfp);
103
104 /*******************************************************************
105  *
106  * Functions to analyse structural changes
107  *
108  *******************************************************************/   
109
110 typedef struct {
111   int  nanal,index;
112   real dt;
113   real *t;
114   real *maxdist;
115   rvec *d2_com,*d2_origin;
116   int  *nion;
117   int  nstruct,nparticle,maxparticle;
118   rvec *q;
119   rvec **x;
120 } t_ana_struct;
121
122 extern t_ana_struct *init_ana_struct(int nstep,int nsave,real timestep,
123                                      int maxparticle);
124
125 extern void done_ana_struct(t_ana_struct *anal);
126
127 extern void reset_ana_struct(t_ana_struct *anal);
128
129 extern void add_ana_struct(t_ana_struct *total,t_ana_struct *add);
130
131 extern void analyse_structure(t_ana_struct *anal,real t,rvec center,
132                               rvec x[],int nparticle,real charge[]);
133
134 extern void dump_ana_struct(char *rmax,char *nion,char *gyr_com,
135                             char *gyr_origin,t_ana_struct *anal,int nsim);
136
137 extern void dump_as_pdb(char *pdb,t_ana_struct *anal);
138
139 /*******************************************************************
140  *
141  * Functions to analyse energies
142  *
143  *******************************************************************/   
144                             
145 enum { eCOUL, eREPULS, ePOT, eHOLE, eELECTRON, eLATTICE, eKIN, eTOT, eNR };
146 extern char *enms[eNR];
147
148 typedef real evec[eNR];
149
150 typedef struct {
151   int  nx,maxx;
152   evec *e;
153 } t_ana_ener;
154
155 extern void add_ana_ener(t_ana_ener *ae,int nn,real e[]);
156
157 extern void dump_ana_ener(t_ana_ener *ae,int nsim,real dt,char *edump,
158                           t_ana_struct *total);
159