4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
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
27 * GRowing Old MAkes el Chrono Sweat
29 static char *SRCID_pgutil_c
= "$Id$";
34 atom_id
search_atom(char *type
,int start
,int natoms
,t_atom at
[],char **anm
[])
39 bPrevious
= (strchr(type
,'-') != NULL
);
42 resnr
= at
[start
].resnr
;
43 if (strchr(type
,'+') != NULL
) {
44 /* The next residue */
46 while ((start
<natoms
) && (at
[start
].resnr
== resnr
))
49 resnr
= at
[start
].resnr
;
51 for(i
=start
; (i
<natoms
) && (at
[i
].resnr
== resnr
); i
++)
52 if (strcasecmp(type
,*(anm
[i
]))==0)
56 /* The previous residue */
59 resnr
= at
[start
-1].resnr
;
60 for(i
=start
-1; (i
>=0) && (at
[i
].resnr
== resnr
); i
--)
61 if (strcasecmp(type
,*(anm
[i
]))==0)
67 void set_at(t_atom
*at
,real m
,real q
,int type
,int resnr
)