cf8be0e354d31123484ef0b1364ece22a8c5e2b5
[alexxy/gromacs.git] / include / types / topology.h
1 /*
2  * 
3  *                This source code is part of
4  * 
5  *                 G   R   O   M   A   C   S
6  * 
7  *          GROningen MAchine for Chemical Simulations
8  * 
9  *                        VERSION 3.2.0
10  * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12  * Copyright (c) 2001-2004, The GROMACS development team,
13  * check out http://www.gromacs.org for more information.
14
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  * 
20  * If you want to redistribute modifications, please consider that
21  * scientific software is very special. Version control is crucial -
22  * bugs must be traceable. We will be happy to consider code for
23  * inclusion in the official distribution, but derived work must not
24  * be called official GROMACS. Details are found in the README & COPYING
25  * files - if they are missing, get the official version at www.gromacs.org.
26  * 
27  * To help us fund GROMACS development, we humbly ask that you cite
28  * the papers on the package - you can find them in the top README file.
29  * 
30  * For more info, check our website at http://www.gromacs.org
31  * 
32  * And Hey:
33  * GRoups of Organic Molecules in ACtion for Science
34  */
35
36 #include "atoms.h"
37 #include "idef.h"
38 #include "block.h"
39 #include "simple.h"
40 #include "symtab.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46 enum {
47   egcTC,    egcENER,   egcACC, egcFREEZE, 
48   egcUser1, egcUser2,  egcVCM, egcXTC,
49   egcORFIT, egcQMMM,
50   egcNR 
51 };
52
53 typedef struct {
54   char          **name;         /* Name of the molecule type            */
55   t_atoms       atoms;          /* The atoms                            */
56   t_ilist       ilist[F_NRE];
57   t_block       cgs;            /* The charge groups                    */
58   t_blocka      excls;          /* The exclusions                       */
59 } gmx_moltype_t;
60
61 typedef struct {
62   int           type;           /* The molcule type index in mtop.moltype */
63   int           nmol;           /* The number of molecules in this block  */
64   int           natoms_mol;     /* The number of atoms in one molecule    */
65   int           nposres_xA;     /* The number of posres coords for top A  */
66   rvec          *posres_xA;     /* The posres coords for top A            */
67   int           nposres_xB;     /* The number of posres coords for top B  */
68   rvec          *posres_xB;     /* The posres coords for top B            */
69 } gmx_molblock_t;
70
71 typedef struct {
72   t_grps         grps[egcNR];   /* Groups of things                     */
73   int            ngrpname;      /* Number of groupnames                 */
74   char           ***grpname;    /* Names of the groups                  */
75   int            ngrpnr[egcNR];
76   unsigned char  *grpnr[egcNR]; /* Group numbers or NULL                */
77 } gmx_groups_t;
78
79 /* This macro gives the group number of group type egc for atom i.
80  * This macro is useful, since the grpnr pointers are NULL
81  * for group types that have all entries 0.
82  */
83 #define ggrpnr(groups,egc,i) ((groups)->grpnr[egc] ? (groups)->grpnr[egc][i] : 0)
84
85 /* The global, complete system topology struct, based on molecule types.
86    This structure should contain no data that is O(natoms) in memory. */
87 typedef struct {
88   char           **name;        /* Name of the topology                 */
89   gmx_ffparams_t ffparams;
90   int            nmoltype;
91   gmx_moltype_t  *moltype;
92   int            nmolblock;
93   gmx_molblock_t *molblock;
94   int            natoms;
95   int            maxres_renum;  /* Parameter for residue numbering      */
96   int            maxresnr;      /* The maximum residue number in moltype */
97   t_atomtypes    atomtypes;     /* Atomtype properties                  */
98   t_block        mols;          /* The molecules                        */
99   gmx_groups_t   groups;
100   t_symtab       symtab;        /* The symbol table                     */
101 } gmx_mtop_t;
102
103 /* The mdrun node-local topology struct, completely written out */
104 typedef struct {
105   t_idef        idef;           /* The interaction function definition  */
106   t_atomtypes   atomtypes;      /* Atomtype properties                  */
107   t_block       cgs;            /* The charge groups                    */
108   t_blocka      excls;          /* The exclusions                       */
109 } gmx_localtop_t;
110
111 /* The old topology struct, completely written out, used in analysis tools */
112 typedef struct {
113   char          **name;         /* Name of the topology                 */
114   t_idef        idef;           /* The interaction function definition  */
115   t_atoms       atoms;          /* The atoms                            */
116   t_atomtypes   atomtypes;      /* Atomtype properties                  */
117   t_block       cgs;            /* The charge groups                    */
118   t_block       mols;           /* The molecules                        */
119   t_blocka      excls;          /* The exclusions                       */
120   t_symtab      symtab;         /* The symbol table                     */
121 } t_topology;
122
123 #ifdef __cplusplus
124 }
125 #endif
126