Tagged files with gromacs 3.0 header and added some license info
[alexxy/gromacs.git] / include / init.h
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.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
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.
20  * 
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.
27  * 
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.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Good ROcking Metal Altar for Chronical Sinners
35  */
36
37 #ifndef _init_h
38 #define _init_h
39
40 static char *SRCID_init_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) init.h 1.13 11/23/92"
47 #endif /* HAVE_IDENT */
48
49 #include <stdio.h>
50 #include "typedefs.h"
51 #include "mvdata.h"
52 #include "nsb.h"
53 #include "dummies.h"
54
55 typedef enum
56 {
57   LIST_SCALARS  =0001,
58   LIST_PARM     =0002,
59   LIST_TOP      =0004,
60   LIST_X        =0010,
61   LIST_V        =0020,
62   LIST_F        =0040,
63   LIST_LOAD     =0100
64 } t_listitem;
65
66 extern void check_nnodes_top(char *fn,t_topology *top,int nnodes);
67 /* Verify whether this tpr file is for nnodes nodes, and quit if not */
68
69 extern void init_single(FILE *log,
70                         t_parm *parm, char *tpbfile, t_topology *top,
71                         rvec **x,rvec **v,t_mdatoms **mdatoms,
72                         t_nsborder *nsb);
73      /*
74       * Allocates space for the topology (top), the coordinates x, the
75       * velocities v, masses mass. Reads the parameters, topology,
76       * coordinates and velocities from the file specified in tpbfile
77       */
78
79 extern void distribute_parts(int left,int right,int pid,int nprocs,
80                              t_parm *parm,char *tpbfile,int nstDlb);
81      /*
82       * Reads the parameters, topology, coordinates and velocities for the
83       * multi processor version of the program from the file specified in
84       * parm->files[STATUS_NM]. This file should also contain a so called
85       * split descriptor which describes how to distribute particles over
86       * the system. It then selects for all subsystems the appropriate data
87       * and sends this to the processor using the left and right channels.
88       * At last it sends its own subsystem down the ring where it is buffered.
89       * Its own buffers for reading the data from the file are freed, and it
90       * is now possible to reload this processor from the ring by using the
91       * init_parts() routine.
92       * The routine also creates a renum array which can be used for writing
93       * out the x,v and f for analysis purpose.
94       */
95
96 extern void init_parts(FILE *log,t_commrec *cr,
97                        t_parm *parm,t_topology *top,
98                        rvec **x,rvec **v,t_mdatoms **mdatoms,
99                        t_nsborder *nsb,int list,
100                        bool *bParallelDummies,
101                        t_comm_dummies *dummycomm);
102      /*
103       * Loads the data for a simulation from the ring. Parameters, topology
104       * coordinates, velocities, and masses are initialised equal to using
105       * init_single() in the single processor version. The extra argument
106       * f_add is allocated to use for the update of the forces, the load
107       * array specifies in which part of the x and f array the subsystems
108       * of the other processors are located. Homenr0, homenr1, nparts0 and
109       * nparts1 are necessary to calculate the non bonded interaction using
110       * the symmetry and thus calculating every force only once. List is a facility
111       * for logging (and debugging). One can decide to print none or a set of
112       * selected parameters to the file specified by log. Parameters are
113       * printed by or-ing the corresponding items from t_listitem. A 0 (zero)
114       * specifies that nothing is to be printed on the file. The function
115       * returns the number of shifts over the ring to perform to calculate
116       * all interactions.
117       */
118
119 extern void write_parm(FILE *log,char *title,int pid,t_parm *parm);
120 /* Write parm for debugging */
121
122 #endif  /* _init_h */