Merge branch 'master' of git://git.gromacs.org/gromacs
[gromacs/adressmacs.git] / src / contrib / ehdata.h
blobc4c7cf2e060fb7bead5fd76fe8c1338f301d5962
1 /*
2 * $Id: ehdata.h,v 1.8 2003/11/17 21:50:46 spoel Exp $
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.2.0
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2004, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
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.
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.
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.
31 * For more info, check our website at http://www.gromacs.org
33 * And Hey:
34 * Good gRace! Old Maple Actually Chews Slate
37 extern real get_omega(real ekin,int *seed,FILE *fp,char *fn);
39 extern real get_q_inel(real ekin,real omega,int *seed,FILE *fp,char *fn);
41 extern real get_theta_el(real ekin,int *seed,FILE *fp,char *fn);
43 extern real cross_inel(real ekin,real rho,char *fn);
45 extern real cross_el(real ekin,real rho,char *fn);
47 extern real band_ener(int *seed,FILE *fp,char *fn);
49 extern void init_tables(int nfile,t_filenm fnm[], real rho);
50 /* Must be called before any of the table lookup thingies */
52 extern void test_tables(int *seed,char *fn,real rho);
54 /*******************************************************************
56 * Functions to make histograms
58 *******************************************************************/
60 enum { enormNO, enormFAC, enormNP, enormNR };
62 typedef struct {
63 int np;
64 real minx,maxx,dx,dx_1;
65 real *y;
66 int *nh;
67 } t_histo;
69 extern t_histo *init_histo(int np,real minx,real maxx);
71 extern void done_histo(t_histo *h);
73 extern void add_histo(t_histo *h,real x,real y);
75 extern void dump_histo(t_histo *h,char *fn,char *title,char *xaxis,char *yaxis,
76 int enorm,real norm_fac);
79 /*******************************************************************
81 * Functions to analyse and monitor scattering
83 *******************************************************************/
85 typedef struct {
86 int np,maxp;
87 real *time;
88 real *ekin;
89 gmx_bool *bInel;
90 rvec *pos;
91 } t_ana_scat;
93 extern void add_scatter_event(t_ana_scat *scatter,rvec pos,gmx_bool bInel,
94 real t,real ekin);
96 extern void reset_ana_scat(t_ana_scat *scatter);
98 extern void done_scatter(t_ana_scat *scatter);
100 extern void analyse_scatter(t_ana_scat *scatter,t_histo *hmfp);
102 /*******************************************************************
104 * Functions to analyse structural changes
106 *******************************************************************/
108 typedef struct {
109 int nanal,index;
110 real dt;
111 real *t;
112 real *maxdist;
113 rvec *d2_com,*d2_origin;
114 int *nion;
115 int nstruct,nparticle,maxparticle;
116 rvec *q;
117 rvec **x;
118 } t_ana_struct;
120 extern t_ana_struct *init_ana_struct(int nstep,int nsave,real timestep,
121 int maxparticle);
123 extern void done_ana_struct(t_ana_struct *anal);
125 extern void reset_ana_struct(t_ana_struct *anal);
127 extern void add_ana_struct(t_ana_struct *total,t_ana_struct *add);
129 extern void analyse_structure(t_ana_struct *anal,real t,rvec center,
130 rvec x[],int nparticle,real charge[]);
132 extern void dump_ana_struct(char *rmax,char *nion,char *gyr_com,
133 char *gyr_origin,t_ana_struct *anal,int nsim);
135 extern void dump_as_pdb(char *pdb,t_ana_struct *anal);
137 /*******************************************************************
139 * Functions to analyse energies
141 *******************************************************************/
143 enum { eCOUL, eREPULS, ePOT, eHOLE, eELECTRON, eLATTICE, eKIN, eTOT, eNR };
144 extern char *enms[eNR];
146 typedef real evec[eNR];
148 typedef struct {
149 int nx,maxx;
150 evec *e;
151 } t_ana_ener;
153 extern void add_ana_ener(t_ana_ener *ae,int nn,real e[]);
155 extern void dump_ana_ener(t_ana_ener *ae,int nsim,real dt,char *edump,
156 t_ana_struct *total);