changed reading hint
[gromacs/adressmacs.git] / include / hackblock.h
blobe6056bf67ef821745478b568b32568409cb3c116
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 2.0
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
16 * Please refer to:
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
23 * or e-mail to:
24 * gromacs@chem.rug.nl
26 * And Hey:
27 * Good ROcking Metal Altar for Chronical Sinners
30 #ifndef _hackblock_h
31 #define _hackblock_h
33 static char *SRCID_hackblock_h = "$Id$";
35 #include "typedefs.h"
36 #include "pdbio.h"
38 /* Used for reading .rtp/.tdb */
39 /* ebtsBONDS must be the first, new types can be added to the end */
40 /* these *MUST* correspond to the arrays in hackblock.c */
41 enum { ebtsBONDS, ebtsANGLES, ebtsPDIHS, ebtsIDIHS, ebtsNR };
42 extern char *btsNames[ebtsNR];
43 extern int btsNiatoms[ebtsNR];
45 /* if changing any of these structs, make sure that all of the
46 free/clear/copy/merge_t_* functions stay updated */
48 /* BONDEDS */
49 typedef struct {
50 char *a[MAXATOMLIST]; /* atom names */
51 char *s; /* optional define string which gets copied from
52 .rtp/.tdb to .top and will be parsed by cpp
53 during grompp */
54 } t_rbonded;
56 typedef struct {
57 int nb; /* number of bondeds */
58 t_rbonded *b; /* bondeds */
59 } t_rbondeds;
61 /* RESIDUES (rtp) */
62 typedef struct {
63 char *resname;
64 /* atom data */
65 int natom;
66 t_atom *atom;
67 char ***atomname;
68 int *cgnr;
69 /* list of bonded interactions to add */
70 t_rbondeds rb[ebtsNR];
71 } t_restp;
73 /* Block to hack residues */
74 typedef struct {
75 int nr; /* Number of atoms to hack */
76 char *oname; /* Old name */
77 char *nname; /* New name */
78 /* the type of hack depends on the setting of oname and nname:
79 * if oname==NULL we're adding, must have tp>0 also!
80 * if oname!=NULL && nname==NULL we're deleting
81 * if oname!=NULL && nname!=NULL we're replacing
83 t_atom *atom; /* New atom data */
84 int cgnr; /* chargegroup number. if not read will be NOTSET */
85 int tp; /* Type of attachment (1..10) */
86 char *a[4]; /* Control atoms i,j,k,l */
87 rvec newx; /* calculated new position */
88 } t_hack;
90 typedef struct {
91 char *name; /* Name of hack block (residue or terminus) */
92 int nhack; /* Number of atoms to hack */
93 int maxhack;/* used for efficient srenew-ing */
94 t_hack *hack; /* Hack list */
95 /* list of bonded interactions to add */
96 t_rbondeds rb[ebtsNR];
97 } t_hackblock;
99 extern void free_t_restp(int nrtp, t_restp **rtp);
100 extern void free_t_hack(int nh, t_hack **h);
101 extern void free_t_hackblock(int nhb, t_hackblock **hb);
102 /* free the whole datastructure */
104 extern void clear_t_hackblock(t_hackblock *hb);
105 extern void clear_t_hack(t_hack *hack);
106 /* reset struct */
108 extern void merge_t_bondeds(t_rbondeds s[], t_rbondeds d[]);
109 /* add s[].b[] to d[].b[] */
111 extern void copy_t_restp(t_restp *s, t_restp *d);
112 extern void copy_t_hack(t_hack *s, t_hack *d);
113 extern void copy_t_hackblock(t_hackblock *s, t_hackblock *d);
114 /* make copy of whole datastructure */
116 extern void merge_hacks_lo(int ns, t_hack *s, int *nd, t_hack **d);
117 /* add s[] to *d[] */
119 extern void merge_hacks(t_hackblock *s, t_hackblock *d);
120 /* add s->hacks[] to d->hacks[] */
122 extern void merge_t_hackblock(t_hackblock *s, t_hackblock *d);
123 /* add s->hacks[] and s->rb[] to d*/
125 extern void dump_hb(FILE *out, int nres, t_hackblock hb[]);
126 /* print out whole datastructure */
128 #endif /* _hackblock_h */