Upped the version to 3.2.0
[gromacs.git] / src / kernel / xmdrun.h
blob25619ba949fc6bcc81fc290410e7ed7673d867a4
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.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 * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
37 #ifndef _xmdrun_h
38 #define _xmdrun_h
40 #ifdef HAVE_CONFIG_H
41 #include <config.h>
42 #endif
44 #include <stdio.h>
45 #include "typedefs.h"
46 #include "network.h"
47 #include "tgroup.h"
48 #include "filenm.h"
49 #include "nsb.h"
50 #include "mshift.h"
51 #include "force.h"
52 #include "time.h"
53 #include "edsam.h"
54 #include "mdebin.h"
55 #include "vcm.h"
56 #include "dummies.h"
58 /* This file contains XMDRUN datatypes and function prototypes, grouped
59 * neatly according to parts of the functionalisty
62 /* SHELL MD STUFF */
63 typedef struct {
64 int nnucl;
65 atom_id shell; /* The shell id */
66 atom_id nucl1,nucl2,nucl3; /* The nuclei connected to the shell */
67 real k; /* force constant */
68 real k_1; /* 1 over force constant */
69 } t_shell;
71 /* Initialization function */
72 extern t_shell *init_shells(FILE *log,int start,int homenr,
73 t_idef *idef,t_mdatoms *md,int *nshell);
75 /* Optimize shell positions */
76 extern int relax_shells(FILE *log,t_commrec *cr,t_commrec *mcr,bool bVerbose,
77 int mdstep,t_parm *parm,bool bDoNS,bool bStopCM,
78 t_topology *top,real ener[],t_fcdata *fcd,
79 t_state *state,rvec vold[],rvec vt[],rvec f[],
80 rvec buf[],t_mdatoms *md,t_nsborder *nsb,t_nrnb *nrnb,
81 t_graph *graph,t_groups *grps,tensor vir_part,
82 tensor pme_vir_part,bool bShell,
83 int nshell,t_shell shells[],t_forcerec *fr,
84 char *traj,real t,rvec mu_tot,
85 int natoms,bool *bConverged,
86 bool bDummies,t_comm_dummies *dummycomm);
88 /* GENERAL COUPLING THEORY (GCT) STUFF */
89 enum { eoPres, eoEpot, eoVir, eoDist, eoMu, eoForce, eoFx, eoFy, eoFz,
90 eoPx, eoPy, eoPz,
91 eoPolarizability, eoDipole, eoObsNR,
92 eoMemory=eoObsNR, eoInter, eoUseVirial, eoNR };
93 extern char *eoNames[eoNR];
95 typedef struct {
96 int at_i,at_j; /* Atom type # for i and j */
97 int eObs; /* Observable to couple to */
98 bool bPrint; /* Does this struct have to be printed */
99 real c6,c12; /* Actual value of params */
100 real xi_6,xi_12; /* Constants for coupling C6 and C12 */
101 } t_coupl_LJ;
103 typedef struct {
104 int at_i,at_j; /* Atom type # for i and j */
105 int eObs; /* Observable to couple to */
106 bool bPrint; /* Does this struct have to be printed */
107 real a,b,c; /* Actual value of params */
108 real xi_a,xi_b,xi_c; /* Constants for coupling A, B and C */
109 } t_coupl_BU;
111 typedef struct {
112 int at_i; /* Atom type */
113 int eObs; /* Observable to couple to */
114 bool bPrint; /* Does this struct have to be printed */
115 real Q; /* Actual value of charge */
116 real xi_Q; /* Constant for coupling Q */
117 } t_coupl_Q;
119 typedef struct {
120 int type; /* Type number in the iparams struct */
121 int eObs; /* Observable to couple to */
122 t_iparams xi; /* Parameters that need to be changed */
123 t_iparams iprint;
124 } t_coupl_iparams;
126 typedef struct {
127 real act_value[eoObsNR];
128 real av_value [eoObsNR];
129 real ref_value[eoObsNR];
130 bool bObsUsed[eoObsNR];
131 int nLJ,nBU,nQ,nIP;
132 t_coupl_LJ *tcLJ;
133 t_coupl_BU *tcBU;
134 t_coupl_Q *tcQ;
135 t_coupl_iparams *tIP;
136 int nmemory;
137 bool bInter;
138 bool bVirial;
139 } t_coupl_rec;
141 extern void write_gct(char *fn,t_coupl_rec *tcr,t_idef *idef);
143 extern void read_gct(char *fn,t_coupl_rec *tcr);
145 extern void comm_tcr(FILE *log,t_commrec *cr,t_coupl_rec **tcr);
147 extern void copy_ff(t_coupl_rec *tcr,t_forcerec *fr,t_mdatoms *md,
148 t_idef *idef);
150 extern t_coupl_rec *init_coupling(FILE *log,int nfile,t_filenm fnm[],
151 t_commrec *cr,t_forcerec *fr,t_mdatoms *md,
152 t_idef *idef);
154 extern void calc_force(int natom,rvec f[],rvec fff[]);
156 extern void calc_f_dev(int natoms,real charge[],rvec x[],rvec f[],
157 t_idef *idef,real *xiH,real *xiS);
159 extern void do_coupling(FILE *log,int nfile,t_filenm fnm[],
160 t_coupl_rec *tcr,real t,int step,real ener[],
161 t_forcerec *fr,t_inputrec *ir,bool bMaster,
162 t_mdatoms *md,t_idef *idef,real mu_aver,int nmols,
163 t_commrec *cr,matrix box,tensor virial,
164 tensor pres,rvec mu_tot,
165 rvec x[],rvec f[],bool bDoIt);
167 /* IONIZATION STUFF. */
168 extern void ionize(FILE *log,t_mdatoms *md,char **atomname[],
169 real t,t_inputrec *ir,rvec x[],rvec v[],
170 int start,int end,matrix box,t_commrec *cr);
172 /* CODE TO ADD SPECIAL 2-DIMENSIONAL LENNARD-JONES CORRECTION TO FORCES AND ENERGY */
173 extern void do_glas(FILE *log,int start,int homenr,rvec x[],rvec f[],
174 t_forcerec *fr,t_mdatoms *md,int atnr,t_inputrec *ir,
175 real ener[]);
177 extern real mol_dipole(int k0,int k1,atom_id ma[],rvec x[],real q[]);
178 /* Calculate total dipole for group of atoms */
180 extern real calc_mu_aver(t_commrec *cr,t_nsborder *nsb,rvec x[],real q[],rvec mu,
181 t_topology *top,t_mdatoms *md,int gnx,atom_id grpindex[]);
182 /* Compute average dipole */
184 /********************************************************************/
185 /* Force field scanning stuff */
186 typedef struct {
187 real tol,fmax,npow,epot,fac_epot,fac_pres,fac_msf,pres;
188 int molsize,nmol;
189 bool bComb,bVerbose,bLogEps;
190 } t_ffscan;
193 extern void update_forcefield(int nfile,t_filenm fnm[],t_forcerec *fr,
194 int natoms,rvec x[],matrix box);
195 /* Modify the parameters */
197 extern void print_forcefield(FILE *fp,real ener[],int natoms,rvec f[],
198 rvec fshake[],rvec x[],t_block *mols,real mass[],
199 tensor pres);
200 /* Print results */
202 extern void set_ffvars(t_ffscan *ff);
203 /* Set variables for force scanning */
205 #endif /* _xmdrun_h */