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 * Green Red Orange Magenta Azure Cyan Skyblue
29 static char *SRCID_rmpbc_c
= "$Id$";
40 void rm_pbc(t_idef
*idef
,int natoms
,matrix box
,rvec x
[],rvec x_s
[])
48 static multi_graph
*mgraph
=NULL
;
49 static bool bFirst
=TRUE
;
50 rvec sv
[SHIFTS
],box_size
;
54 bNeedToCopy
= (x
!= x_s
);
57 if (idef
->ntypes
!=-1) {
59 for(i
=0; i
<ngraph
; i
++)
60 if (mgraph
[i
].natoms
==natoms
)
63 /* make a new graph if there isn't one with this number of atoms */
66 srenew(mgraph
,ngraph
);
67 mgraph
[n
].natoms
=natoms
;
68 mgraph
[n
].gr
=mk_graph(idef
,natoms
,FALSE
);
70 mk_mshift(stdout
,mgraph
[n
].gr
,box
,x
);
71 calc_shifts(box
,box_size
,sv
,FALSE
);
72 shift_x(mgraph
[n
].gr
,sv
,x
,x_s
);
76 "\nWarning: can not make broken molecules whole without a run input file\n");
81 for (i
=0; i
<natoms
; i
++)
82 copy_rvec(x
[i
],x_s
[i
]);