Enable grompp to read virtual_site1
[alexxy/gromacs.git] / docs / reference-manual / topologies / topology-file-formats.rst
1 File formats
2 ------------
3
4 .. _topfile:
5
6 Topology file
7 ~~~~~~~~~~~~~
8
9 The topology file is built following the |Gromacs| specification for a
10 molecular topology. A :ref:`top` file can be generated by
11 :ref:`pdb2gmx <gmx pdb2gmx>`. All possible entries in the topology file are
12 listed in :numref:`Tables %s <tab-topfile1>` and
13 :numref:`%s <tab-topfile2>`. Also tabulated are: all the units of
14 the parameters, which interactions can be perturbed for free energy
15 calculations, which bonded interactions are used by
16 :ref:`grompp <gmx grompp>` for generating exclusions, and which bonded
17 interactions can be converted to constraints by :ref:`grompp <gmx grompp>`.
18
19 .. |VCR| replace:: V\ :math:`^{(cr)}`
20 .. |WCR| replace:: W\ :math:`^{(cr)}`
21 .. |CRO| replace:: :math:`^{(cr)}`
22 .. |TREF| replace:: :numref:`Table %s <tab-topfile2>`
23 .. |AKJM| replace:: :math:`a~\mathrm{kJ~mol}^{-1}`
24 .. |KJN6| replace:: :math:`\mathrm{kJ~mol}^{-1}~\mathrm{nm}^{-6}`
25 .. |BNM| replace:: :math:`b~\mathrm{nm}^{-1}`
26 .. |C6LJ| replace:: :math:`c_6`
27 .. |STAR| replace:: :math:`^{(*)}`
28 .. |NREX| replace:: :math:`n_{ex}^{(nrexcl)}`
29 .. |QEMU| replace:: :math:`q` (e); :math:`m` (u) 
30 .. |MQM| replace:: :math:`q,m`
31
32 .. _tab-topfile1:
33
34 .. table:: The :ref:`topology <top>` file.
35
36         +------------------------------------------------------------------------------------------------------------+
37         | Parameters                                                                                                 |
38         +===================+===========================+=====+====+=========================================+=======+
39         | interaction type  | directive                 | #   | f. | parameters                              | F. E. |
40         |                   |                           | at. | tp |                                         |       |
41         +-------------------+---------------------------+-----+----+-----------------------------------------+-------+
42         | *mandatory*       | ``defaults``              |            non-bonded function type;                       |
43         |                   |                           |            combination rule\ |CRO|;                        |
44         |                   |                           |            generate pairs (no/yes);                        |
45         |                   |                           |            fudge LJ (); fudge QQ ()                        |
46         +-------------------+---------------------------+------------------------------------------------------------+
47         | *mandatory*       | ``atomtypes``             |            atom type; m (u); q (e); particle type;         | 
48         |                   |                           |            |VCR| ; |WCR|                                   |
49         +-------------------+---------------------------+------------------------------------------------------------+
50         |                   | ``bondtypes``             |  (see |TREF|, directive ``bonds``)                         |
51         +                   +                           +                                                            +
52         |                   | ``pairtypes``             |  (see |TREF|, directive ``pairs``)                         |
53         +                   +                           +                                                            +
54         |                   | ``angletypes``            |  (see |TREF|, directive ``angles``)                        |
55         +                   +                           +                                                            +
56         |                   | ``dihedraltypes``\ |STAR| |  (see |TREF|, directive ``dihedrals``)                     |
57         +                   +                           +                                                            +
58         |                   | ``constrainttypes``       |  (see |TREF|, directive ``constraints``)                   |
59         +-------------------+---------------------------+-----+----+-------------------------------------------------+
60         | LJ                | ``nonbond_params``        |  2  | 1  |  |VCR|  ; |WCR|                                 |
61         +                   +                           +     +    +                                                 +
62         | Buckingham        | ``nonbond_params``        |  2  | 2  |  |AKJM| ; |BNM|;                                |
63         |                   |                           |     |    |  |C6LJ| (|KJN6|)                                |
64         +-------------------+---------------------------+-----+----+-------------------------------------------------+
65
66 .. table:: 
67
68         +------------------------------------------------------------------------------------------------------------+
69         | Molecule definition(s)                                                                                     |
70         +===================+===========================+============================================================+
71         | *mandatory*       | ``moleculetype``          | molecule name; |NREX|                                      |
72         +-------------------+---------------------------+-----+----------------------------------------------+-------+
73         | *mandatory*       | ``atoms``                 | 1   | atom type; residue number;                   | type  |
74         |                   |                           |     | residue name; atom name;                     |       |
75         |                   |                           |     | charge group number; |QEMU|                  | |MQM| |
76         +-------------------+---------------------------+-----+----------------------------------------------+-------+
77         | intra-molecular interaction and geometry definitions as described in |TREF|                                |
78         +------------------------------------------------------------------------------------------------------------+
79
80 .. table::
81
82         +-------------+---------------+------------------------------------+
83         | System      |               |                                    |
84         +=============+===============+====================================+
85         | *mandatory* | ``system``    | system name                        |
86         +-------------+---------------+------------------------------------+
87         | *mandatory* | ``molecules`` | molecule name; number of molecules |
88         +-------------+---------------+------------------------------------+
89
90 .. table::
91
92         +------------------------------+----------------------------------------------------+
93         | Inter-molecular interactions |                                                    |
94         +==============================+====================================================+
95         | *optional*                   | ``intermolecular_interactions``                    |
96         +------------------------------+----------------------------------------------------+
97         | one or more bonded interactions as described in |TREF|, with two or more atoms,   |
98         | no interactions that generate exclusions, no constraints, use global atom numbers |
99         +-----------------------------------------------------------------------------------+
100
101 .. parsed-literal::
102
103     '\# at' is the required number of atom type indices for this directive
104     'f. tp' is the value used to select this function type
105     'F. E.' indicates which of the parameters can be interpolated in free energy calculations
106     |CRO| the combination rule determines the type of LJ parameters, see 
107     |STAR| for ``dihedraltypes`` one can specify 4 atoms or the inner (outer for improper) 2 atoms
108     |NREX| exclude neighbors :math:`n_{ex}` bonds away for non-bonded interactions
109     For free energy calculations, type, :math:`q` and :math:`m`  or no parameters should be added
110     for topology 'B' (:math:`\lambda = 1`) on the same line, after the normal parameters.
111
112 .. |BZERO| replace:: :math:`b_0`
113 .. |KB| replace:: :math:`k_b`
114 .. |KDR| replace:: :math:`k_{dr}`
115 .. |NM2| replace:: (kJ mol\ :math:`^{-1}`\ nm\ :math:`^{-2}`
116 .. |NM4| replace:: (kJ mol\ :math:`^{-1}`\ nm\ :math:`^{-4}`
117 .. |DKJ| replace:: :math:`D` (kJ mol\ :math:`^{-1}`
118 .. |BETA| replace:: :math:`\beta` (nm\ :math:`^{-1}`
119 .. |C23| replace:: :math:`C_{i=2,3}` (kJ mol\ :math:`^{-1}\ nm\ :math:`^{-i}`
120 .. |BMM| replace:: :math:`b_m`
121 .. |GE0| replace:: :math:`\geq 0`
122 .. |KO| replace:: :math:`k` 
123 .. |KJM| replace:: kJ mol\ :math:`^{-1}`
124 .. |LUU| replace:: low, up\ :math:`_1`,\ :math:`_2`
125 .. |MV| replace:: :math:`V`
126 .. |MW| replace:: :math:`W`
127 .. |QIJ| replace:: :math:`q_i`; :math:`q_j`
128 .. |THE0| replace:: :math:`\theta_0`
129 .. |KTHE| replace:: :math:`k_\theta`
130 .. |KJR2| replace:: kJ mol\ :math:`^{-1}`\ rad\ :math:`^{-2}`
131 .. |RN13| replace:: :math:`r_{13}`
132 .. |KUB| replace:: :math:`k_{UB}`
133 .. |C024| replace:: :math:`C_{i=0,1,2,3,4}`
134 .. |KJRI| replace:: kJ mol\ :math:`^{-1}`\ rad\ :math:`^{-i}`
135 .. |PHIS| replace:: :math:`\phi_s`
136 .. |PHI0| replace:: :math:`\phi_0`
137 .. |KPHI| replace:: :math:`k_\phi`
138 .. |PHIK| replace:: :math:`\phi,k`
139 .. |XI0| replace:: :math:`\xi_0`
140 .. |KXI| replace:: :math:`k_\xi`
141 .. |C0| replace:: :math:`C_0`
142 .. |C1| replace:: :math:`C_1`
143 .. |C2| replace:: :math:`C_2`
144 .. |C3| replace:: :math:`C_3`
145 .. |C4| replace:: :math:`C_4`
146 .. |C5| replace:: :math:`C_5`
147 .. |A0| replace:: :math:`a_0`
148 .. |A1| replace:: :math:`a_1`
149 .. |A2| replace:: :math:`a_2`
150 .. |A3| replace:: :math:`a_3`
151 .. |A4| replace:: :math:`a_4`
152 .. |DOH| replace:: :math:d_{\mbox{\sc oh}}`
153 .. |DHH| replace:: :math:d_{\mbox{\sc hh}}`
154 .. |AO| replace:: :math:`a`
155 .. |BO| replace:: :math:`b`
156 .. |CO| replace:: :math:`c`
157 .. |DO| replace:: :math:`d`
158 .. |KX| replace:: :math:`k_{x}`
159 .. |KY| replace:: :math:`k_{y}`
160 .. |KZ| replace:: :math:`k_{z}`
161 .. |GO| replace:: :math:`g`
162 .. |RO| replace:: :math:`r`
163 .. |DPHI| replace:: :math:`\Delta\phi`
164 .. |DIHR| replace:: :math:`k_{\mathrm{dihr}}`
165 .. |THET| replace:: :math:`\theta`
166 .. |NM| replace:: nm\ :math:`^{-1}`
167 .. |KC| replace:: :math:`k_c`
168 .. |THEK| replace:: :math:`\theta,k`
169 .. |R1E| replace:: :math:`r_{1e}`
170 .. |R2E| replace:: :math:`r_{2e}`
171 .. |R3E| replace:: :math:`r_{3e}`
172 .. |KRR| replace:: :math:`k_{rr'}`
173 .. |KRTH| replace:: :math:`k_{r\theta}`
174 .. |ALPH| replace:: :math:`\alpha`; |CO| (U nm\ :math:`^{\alpha}`
175 .. |UM1| replace:: U\ :math:`^{-1}`
176
177 .. _tab-topfile2:
178
179 .. table:: Details of ``[ moleculetype ]`` directives
180
181             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
182             | Name of interaction                | Topology file directive    | num.       | func.     | Order of parameters and their units                                     | use in     | 
183             |                                    |                            | atoms [1]_ | type [2]_ |                                                                         | F.E.? [3]_ |
184             +====================================+============================+============+===========+=========================================================================+============+
185             | bond                               | ``bonds`` [4]_, [5]_       | 2          | 1         | |BZERO| (nm); |KB| |NM2|                                                | all        | 
186             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
187             | G96 bond                           | ``bonds`` [4]_, [5]_       | 2          | 2         | |BZERO| (nm); |KB| |NM4|                                                | all        |
188             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
189             | Morse                              | ``bonds`` [4]_, [5]_       | 2          | 3         | |BZERO| (nm); |DKJ|; |BETA|                                             | all        | 
190             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
191             | cubic bond                         | ``bonds`` [4]_, [5]_       | 2          | 4         | |BZERO| (nm); |C23|                                                     |            | 
192             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
193             | connection                         | ``bonds`` [4]_             | 2          | 5         |                                                                         |            | 
194             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
195             | harmonic potential                 | ``bonds``                  | 2          | 6         | |BZERO| (nm); |KB| |NM2|                                                | all        | 
196             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
197             | FENE bond                          | ``bonds`` [4]_             | 2          | 7         | |BMM|   (nm); |KB| |NM2|                                                |            | 
198             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
199             | tabulated bond                     | ``bonds`` [4]_             | 2          | 8         | table number (|GE0|); |KO| |KJM|                                        | |KO|       |
200             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
201             | tabulated bond [6]_                | ``bonds``                  | 2          | 9         | table number (|GE0|); |KO| |KJM|                                        | |KO|       |
202             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
203             | restraint potential                | ``bonds``                  | 2          | 10        | |LUU| (nm); |KDR| (|NM2|)                                               | all        | 
204             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
205             | extra LJ or Coulomb                | ``pairs``                  | 2          | 1         | |MV| [7]_; |MW| [7]_                                                    | all        | 
206             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
207             | extra LJ or Coulomb                | ``pairs``                  | 2          | 2         | fudge QQ (); |QIJ| (e), |MV| [7]_; |MW| [7]_                            |            | 
208             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
209             | extra LJ or Coulomb                | ``pairs_nb``               | 2          | 1         | |QIJ| (e); |MV| [7]_; |MW| [7]_                                         |            | 
210             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
211             | angle                              | ``angles`` [5]_            | 3          | 1         | |THE0| (deg); |KTHE| (|KJR2|)                                           | all        | 
212             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
213             | G96 angle                          | ``angles`` [5]_            | 3          | 2         | |THE0| (deg); |KTHE| (|KJM|)                                            | all        | 
214             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
215             | cross bond-bond                    | ``angles``                 | 3          | 3         | |R1E|, |R2E| (nm); |KRR| (|NM2|)                                        |            | 
216             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
217             | cross bond-angle                   | ``angles``                 | 3          | 4         | |R1E|, |R2E|, |R3E| (nm); |KRTH| (|NM2|)                                |            | 
218             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
219             | Urey-Bradley                       | ``angles`` [5]_            | 3          | 5         | |THE0| (deg); |KTHE| (|KJR2|); |RN13| (nm); |KUB| (|NM2|)               | all        |
220             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
221             | quartic angle                      | ``angles`` [5]_            | 3          | 6         | |THE0| (deg); |C024| (|KJRI|)                                           |            | 
222             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
223             | tabulated angle                    | ``angles``                 | 3          | 8         | table number (|GE0|); |KO| (|KJM|)                                      | |KO|       | 
224             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
225             |  |  restricted                     |                            |            |           |                                                                         |            |
226             |  |  bending potential              | ``angles``                 | 3          | 10        | |THE0| (deg); |KTHE| (|KJM|)                                            |            | 
227             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
228             | proper dihedral                    | ``dihedrals``              | 4          | 1         | |PHIS| (deg); |KPHI| (|KJM|); multiplicity                              | |PHIK|     | 
229             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
230             | improper dihedral                  | ``dihedrals``              | 4          | 2         | |XI0| (deg); |KXI| (|KJR2|)                                             | all        | 
231             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
232             | Ryckaert-Bellemans dihedral        | ``dihedrals``              | 4          | 3         | |C0|, |C1|, |C2|, |C3|, |C4|, |C5| (|KJM|)                              | all        | 
233             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
234             | periodic improper dihedral         | ``dihedrals``              | 4          | 4         | |PHIS| (deg); |KPHI| (|KJM|); multiplicity                              | |PHIK|     | 
235             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
236             | Fourier dihedral                   | ``dihedrals``              | 4          | 5         | |C1|, |C2|, |C3|, |C4|, |C5| (|KJM|)                                    | all        | 
237             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
238             | tabulated dihedral                 | ``dihedrals``              | 4          | 8         | table number (|GE0|); |KO| (|KJM|)                                      | |KO|       |
239             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
240             | proper dihedral (multiple)         | ``dihedrals``              | 4          | 9         | |PHIS| (deg); |KPHI| (|KJM|); multiplicity                              | |PHIK|     | 
241             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
242             | restricted dihedral                | ``dihedrals``              | 4          | 10        | |PHI0| (deg); |KPHI| (|KJM|)                                            |            | 
243             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
244             | combined bending-torsion potential | ``dihedrals``              | 4          | 11        | |A0|, |A1|, |A2|, |A3|, |A4| (|KJM|)                                    |            | 
245             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
246             | exclusions                         | ``exclusions``             | 1          |           | one or more atom indices                                                |            | 
247             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
248             | constraint                         | ``constraints`` [4]_       | 2          | 1         | |BZERO| (nm)                                                            | all        | 
249             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
250             | constraint [6]_                    | ``constraints``            | 2          | 2         | |BZERO| (nm)                                                            | all        | 
251             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
252             | SETTLE                             | ``settles``                | 1          | 1         | |DOH|, |DHH| (nm)                                                       |            | 
253             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
254             | 1-body virtual site                | ``virtual_sites1``         | 2          | 0         |                                                                         |            |
255             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
256             | 2-body virtual site                | ``virtual_sites2``         | 3          | 1         | |AO| ()                                                                 |            | 
257             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
258             | 2-body virtual site (fd)           | ``virtual_sites2``         | 3          | 2         | |DO| (nm)                                                               |            | 
259             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
260             | 3-body virtual site                | ``virtual_sites3``         | 4          | 1         | |AO|, |BO| ()                                                           |            | 
261             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
262             | 3-body virtual site (fd)           | ``virtual_sites3``         | 4          | 2         | |AO| (); |DO| (nm)                                                      |            | 
263             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
264             | 3-body virtual site (fad)          | ``virtual_sites3``         | 4          | 3         | |THET| (deg); |DO| (nm)                                                 |            | 
265             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
266             | 3-body virtual site (out)          | ``virtual_sites3``         | 4          | 4         | |AO|, |BO| (); |CO| (|NM|)                                              |            | 
267             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
268             | 4-body virtual site (fdn)          | ``virtual_sites4``         | 5          | 2         | |AO|, |BO| (); |CO| (nm)                                                |            | 
269             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
270             | N-body virtual site (COG)          | ``virtual_sitesn``         | 1          | 1         | one or more constructing atom indices                                   |            | 
271             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
272             | N-body virtual site (COM)          | ``virtual_sitesn``         | 1          | 2         | one or more constructing atom indices                                   |            | 
273             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
274             | N-body virtual site (COW)          | ``virtual_sitesn``         | 1          | 3         |  |  one or more pairs consisting of                                     |            |
275             |                                    |                            |            |           |  |  constructing atom index and weight                                  |            | 
276             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
277             | position restraint                 | ``position_restraints``    | 1          | 1         | |KX|, |KY|, |KZ| (|NM2|)                                                | all        |
278             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
279             | flat-bottomed position restraint   | ``position_restraints``    | 1          | 2         | |GO|, |RO| (nm), |KO| (|NM2|)                                           |            | 
280             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
281             | distance restraint                 | ``distance_restraints``    | 2          | 1         | type; label; |LUU| (nm); weight ()                                      |            | 
282             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
283             | dihedral restraint                 | ``dihedral_restraints``    | 4          | 1         | |PHI0| (deg); |DPHI| (deg); |DIHR| (|KJR2|)                             | all        | 
284             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
285             | orientation restraint              | ``orientation_restraints`` | 2          | 1         | exp.; label; |ALPH|; obs. (U); weight (|UM1|)                           |            |
286             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
287             | angle restraint                    | ``angle_restraints``       | 4          | 1         | |THE0| (deg); |KC| (|KJM|); multiplicity                                | |THEK|     | 
288             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
289             | angle restraint (z)                | ``angle_restraints_z``     | 2          | 1         | |THE0| (deg); |KC| (|KJM|); multiplicity                                | |THEK|     | 
290             +------------------------------------+----------------------------+------------+-----------+-------------------------------------------------------------------------+------------+
291
292 .. [1]
293    The required number of atom indices for this directive
294    
295 .. [2]
296    The index to use to select this function type
297    
298 .. [3]
299    Indicates which of the parameters can be interpolated in free energy calculations
300    
301 .. [4]
302    This interaction type will be used by :ref:`grompp <gmx grompp>` for generating exclusions
303    
304 .. [5]
305    This interaction type can be converted to constraints by :ref:`grompp <gmx grompp>`
306    
307 .. [7]
308    The combination rule determines the type of LJ parameters, see
309    
310 .. [6]
311    No connection, and so no exclusions, are generated for this interaction
312
313 Description of the file layout:
314
315 -  Semicolon (;) and newline characters surround comments
316
317 -  On a line ending with :math:`\backslash` the newline character is
318    ignored.
319
320 -  Directives are surrounded by ``[`` and ``]``
321
322 -  The topology hierarchy (which must be followed) consists of three
323    levels:
324
325    -  the parameter level, which defines certain force-field
326       specifications (see :numref:`Table %s <tab-topfile1>`)
327
328    -  the molecule level, which should contain one or more molecule
329       definitions (see :numref:`Table %s <tab-topfile2>`)
330
331    -  the system level, containing only system-specific information
332       (``[ system ]`` and ``[ molecules ]``)
333
334 -  Items should be separated by spaces or tabs, not commas
335
336 -  Atoms in molecules should be numbered consecutively starting at 1
337
338 -  Atoms in the same charge group must be listed consecutively
339
340 -  The file is parsed only once, which implies that no forward
341    references can be treated: items must be defined before they can be
342    used
343
344 -  Exclusions can be generated from the bonds or overridden manually
345
346 -  The bonded force types can be generated from the atom types or
347    overridden per bond
348
349 -  It is possible to apply multiple bonded interactions of the same type
350    on the same atoms
351
352 -  Descriptive comment lines and empty lines are highly recommended
353
354 -  Starting with |Gromacs| version 3.1.3, all directives at the parameter
355    level can be used multiple times and there are no restrictions on the
356    order, except that an atom type needs to be defined before it can be
357    used in other parameter definitions
358
359 -  If parameters for a certain interaction are defined multiple times
360    for the same combination of atom types the last definition is used;
361    starting with |Gromacs| version 3.1.3 :ref:`grompp <gmx grompp>` generates
362    a warning for parameter redefinitions with different values
363
364 -  Using one of the ``[ atoms ]``,
365    ``[ bonds ]``, ``[ pairs ]``,
366    ``[ angles ]``, etc. without having used
367    ``[ moleculetype ]`` before is meaningless and generates
368    a warning
369
370 -  Using ``[ molecules ]`` without having used
371    ``[ system ]`` before is meaningless and generates a
372    warning.
373
374 -  After ``[ system ]`` the only allowed directive is
375    ``[ molecules ]``
376
377 -  Using an unknown string in ``[ ]`` causes all the data
378    until the next directive to be ignored and generates a warning
379
380 Here is an example of a topology file, ``urea.top``:
381
382 ::
383
384     ;
385     ;       Example topology file
386     ;
387     ; The force-field files to be included
388     #include "amber99.ff/forcefield.itp"
389
390     [ moleculetype ]
391     ; name  nrexcl
392     Urea         3
393
394     [ atoms ]
395        1  C  1  URE      C      1     0.880229  12.01000   ; amber C  type
396        2  O  1  URE      O      2    -0.613359  16.00000   ; amber O  type
397        3  N  1  URE     N1      3    -0.923545  14.01000   ; amber N  type
398        4  H  1  URE    H11      4     0.395055   1.00800   ; amber H  type
399        5  H  1  URE    H12      5     0.395055   1.00800   ; amber H  type
400        6  N  1  URE     N2      6    -0.923545  14.01000   ; amber N  type
401        7  H  1  URE    H21      7     0.395055   1.00800   ; amber H  type
402        8  H  1  URE    H22      8     0.395055   1.00800   ; amber H  type
403
404     [ bonds ]
405         1       2
406         1       3       
407         1   6
408         3       4
409         3       5
410         6       7
411         6       8
412
413     [ dihedrals ] 
414     ;   ai    aj    ak    al funct  definition
415          2     1     3     4   9     
416          2     1     3     5   9     
417          2     1     6     7   9     
418          2     1     6     8   9     
419          3     1     6     7   9     
420          3     1     6     8   9     
421          6     1     3     4   9     
422          6     1     3     5   9     
423
424     [ dihedrals ] 
425          3     6     1     2   4     
426          1     4     3     5   4         
427          1     7     6     8   4
428
429     [ position_restraints ]
430     ; you wouldn't normally use this for a molecule like Urea,
431     ; but we include it here for didactic purposes
432     ; ai   funct    fc
433        1     1     1000    1000    1000 ; Restrain to a point
434        2     1     1000       0    1000 ; Restrain to a line (Y-axis)
435        3     1     1000       0       0 ; Restrain to a plane (Y-Z-plane)
436
437     [ dihedral_restraints ]
438     ; ai   aj    ak    al  type  phi  dphi  fc
439         3    6     1    2     1  180     0  10
440         1    4     3    5     1  180     0  10
441
442     ; Include TIP3P water topology
443     #include "amber99/tip3p.itp"
444
445     [ system ]
446     Urea in Water
447
448     [ molecules ]
449     ;molecule name   nr.
450     Urea             1
451     SOL              1000
452
453 Here follows the explanatory text.
454
455 **#include “amber99.ff/forcefield.itp” :** this includes
456 the information for the force field you are using, including bonded and
457 non-bonded parameters. This example uses the AMBER99 force field, but
458 your simulation may use a different force field. :ref:`grompp <gmx grompp>`
459 will automatically go and find this file and copy-and-paste its content.
460 That content can be seen in
461 ``share/top/amber99.ff/forcefield.itp}``, and it
462 is
463
464 ::
465
466     #define _FF_AMBER
467     #define _FF_AMBER99
468
469     [ defaults ]
470     ; nbfunc        comb-rule       gen-pairs       fudgeLJ fudgeQQ
471     1               2               yes             0.5     0.8333
472
473     #include "ffnonbonded.itp"
474     #include "ffbonded.itp"
475
476 The two ``#define`` statements set up the conditions so that
477 future parts of the topology can know that the AMBER 99 force field is
478 in use.
479
480 **[ defaults ] :**
481
482 -  ``nbfunc`` is the non-bonded function type. Use 1 (Lennard-Jones) or 2
483    (Buckingham)
484
485 -  ``comb-rule`` is the number of the combination rule (see :ref:`nbpar`).
486
487 -  ``gen-pairs`` is for pair generation. The default is
488    ‘no’, *i.e.* get 1-4 parameters from the pairtypes list. When
489    parameters are not present in the list, stop with a fatal error.
490    Setting ‘yes’ generates 1-4 parameters that are not present in the
491    pair list from normal Lennard-Jones parameters using
492    ``fudgeLJ``
493
494 -  ``fudgeLJ`` is the factor by which to multiply
495    Lennard-Jones 1-4 interactions, default 1
496
497 -  ``fudgeQQ`` is the factor by which to multiply
498    electrostatic 1-4 interactions, default 1
499
500 -  :math:`N` is the power for the repulsion term in a 6-\ :math:`N`
501    potential (with nonbonded-type Lennard-Jones only), starting with
502    |Gromacs| version 4.5, :ref:`grompp <gmx mdrun>` also reads and applies
503    :math:`N`, for values not equal to 12 tabulated interaction functions
504    are used (in older version you would have to use user tabulated
505    interactions).
506
507 **Note** that ``gen-pairs``, ``fudgeLJ``,
508 ``fudgeQQ``, and :math:`N` are optional.
509 ``fudgeLJ`` is only used when generate pairs is set to
510 ‘yes’, and ``fudgeQQ`` is always used. However, if you want
511 to specify :math:`N` you need to give a value for the other parameters
512 as well.
513
514 Then some other ``#include`` statements add in the large
515 amount of data needed to describe the rest of the force field. We will
516 skip these and return to ``urea.top``. There we will see
517
518 **[ moleculetype ] :** defines the name of your molecule
519 in this :ref:`top` and nrexcl = 3 stands for excluding
520 non-bonded interactions between atoms that are no further than 3 bonds
521 away.
522
523 **[ atoms ] :** defines the molecule, where
524 ``nr`` and ``type`` are fixed, the rest is user
525 defined. So ``atom`` can be named as you like,
526 ``cgnr`` made larger or smaller (if possible, the total
527 charge of a charge group should be zero), and charges can be changed
528 here too.
529
530 **[ bonds ] :** no comment.
531
532 **[ pairs ] :** LJ and Coulomb 1-4 interactions
533
534 **[ angles ] :** no comment
535
536 **[ dihedrals ] :** in this case there are 9 proper
537 dihedrals (funct = 1), 3 improper (funct = 4) and no Ryckaert-Bellemans
538 type dihedrals. If you want to include Ryckaert-Bellemans type dihedrals
539 in a topology, do the following (in case of *e.g.* decane):
540
541 ::
542
543     [ dihedrals ]
544     ;  ai    aj    ak    al funct       c0       c1       c2
545         1    2     3     4     3 
546         2    3     4     5     3
547
548 In the original implementation of the potential for
549 alkanes \ :ref:`131 <refRyckaert78>` no 1-4 interactions were used, which means that in
550 order to implement that particular force field you need to remove the
551 1-4 interactions from the ``[ pairs ]`` section of your
552 topology. In most modern force fields, like OPLS/AA or Amber the rules
553 are different, and the Ryckaert-Bellemans potential is used as a cosine
554 series in combination with 1-4 interactions.
555
556 **[ position_restraints ] :** harmonically restrain the selected particles to reference
557 positions (:ref:`positionrestraint`). The reference positions are read
558 from a separate coordinate file by :ref:`grompp <gmx grompp>`.
559
560 **[ dihedral_restraints ] :** restrain selected dihedrals to a reference value. The
561 implementation of dihedral restraints is described in section
562 :ref:`dihedralrestraint` of the manual. The parameters specified in
563 the ``[dihedral_restraints]`` directive are as follows:
564
565 -  ``type`` has only one possible value which is 1
566
567 -  ``phi`` is the value of :math:`\phi_0` in :eq:`eqn. %s <eqndphi>` and
568    :eq:`eqn. %s <eqndihre>` of the manual.
569
570 -  ``dphi`` is the value of :math:`\Delta\phi` in :eq:`eqn. %s <eqndihre>` of the
571    manual.
572
573 -  ``fc`` is the force constant :math:`k_{dihr}` in :eq:`eqn. %s <eqndihre>` of the
574    manual.
575
576 **#include “tip3p.itp” :** includes a topology file that was already
577 constructed (see section :ref:`molitp`).
578
579 **[ system ] :** title of your system, user-defined
580
581 **[ molecules ] :** this defines the total number of (sub)molecules in your system
582 that are defined in this :ref:`top`. In this example file, it stands for 1
583 urea molecule dissolved in 1000 water molecules. The molecule type ``SOL``
584 is defined in the ``tip3p.itp`` file. Each name here must correspond to a
585 name given with ``[ moleculetype ]`` earlier in the topology. The order of the blocks of
586 molecule types and the numbers of such molecules must match the
587 coordinate file that accompanies the topology when supplied to :ref:`grompp <gmx grompp>`.
588 The blocks of molecules do not need to be contiguous, but some tools
589 (e.g. :ref:`genion <gmx genion>`) may act only on the first or last such block of a
590 particular molecule type. Also, these blocks have nothing to do with the
591 definition of groups (see sec. :ref:`groupconcept` and
592 sec. :ref:`usinggroups`).
593
594 .. _molitp:
595
596 Molecule.itp file
597 ~~~~~~~~~~~~~~~~~
598
599 If you construct a topology file you will use frequently (like the water
600 molecule, ``tip3p.itp``, which is already constructed for
601 you) it is good to make a ``molecule.itp`` file. This only
602 lists the information of one particular molecule and allows you to
603 re-use the ``[ moleculetype ]`` in multiple systems without
604 re-invoking :ref:`pdb2gmx <gmx pdb2gmx>` or manually copying and pasting. An
605 example ``urea.itp`` follows:
606
607 ::
608
609     [ moleculetype ]
610     ; molname   nrexcl
611     URE         3
612
613     [ atoms ]
614        1  C  1  URE      C      1     0.880229  12.01000   ; amber C  type
615     ...
616        8  H  1  URE    H22      8     0.395055   1.00800   ; amber H  type
617
618     [ bonds ]
619         1       2
620     ...
621         6       8
622     [ dihedrals ] 
623     ;   ai    aj    ak    al funct  definition
624          2     1     3     4   9     
625     ...
626          6     1     3     5   9     
627     [ dihedrals ] 
628          3     6     1     2   4     
629          1     4     3     5   4         
630          1     7     6     8   4
631
632 Using :ref:`itp` files results in a very short
633 :ref:`top` file:
634
635 ::
636
637     ;
638     ;       Example topology file
639     ;
640     ; The force field files to be included
641     #include "amber99.ff/forcefield.itp"
642
643     #include "urea.itp"
644
645     ; Include TIP3P water topology
646     #include "amber99/tip3p.itp"
647
648     [ system ]
649     Urea in Water
650
651     [ molecules ]
652     ;molecule name   nr.
653     Urea             1
654     SOL              1000
655
656 Ifdef statements
657 ~~~~~~~~~~~~~~~~
658
659 A very powerful feature in |Gromacs| is the use of ``#ifdef``
660 statements in your :ref:`top` file. By making use of this
661 statement, and associated ``#define`` statements like were
662 seen in ``amber99.ff/forcefield.itp`` earlier,
663 different parameters for one molecule can be used in the same
664 :ref:`top` file. An example is given for TFE, where there is
665 an option to use different charges on the atoms: charges derived by De
666 Loof et al. :ref:`132 <refLoof92>` or by Van Buuren and
667 Berendsen \ :ref:`133 <refBuuren93a>`. In fact, you can use much of the
668 functionality of the C preprocessor, ``cpp``, because
669 :ref:`grompp <gmx grompp>` contains similar pre-processing functions to scan
670 the file. The way to make use of the ``#ifdef`` option is as
671 follows:
672
673 -  either use the option ``define = -DDeLoof`` in the
674    :ref:`mdp` file (containing :ref:`grompp <gmx grompp>` input
675    parameters), or use the line ``#define DeLoof`` early in
676    your :ref:`top` or :ref:`itp` file; and
677
678 -  put the ``#ifdef`` statements in your
679    :ref:`top`, as shown below:
680
681
682 ::
683
684     ...
685
686
687
688     [ atoms ]
689     ; nr     type     resnr    residu     atom      cgnr      charge        mass
690     #ifdef DeLoof
691     ; Use Charges from DeLoof
692        1        C        1        TFE        C         1        0.74        
693        2        F        1        TFE        F         1       -0.25        
694        3        F        1        TFE        F         1       -0.25        
695        4        F        1        TFE        F         1       -0.25        
696        5      CH2        1        TFE      CH2         1        0.25        
697        6       OA        1        TFE       OA         1       -0.65        
698        7       HO        1        TFE       HO         1        0.41        
699     #else
700     ; Use Charges from VanBuuren
701        1        C        1        TFE        C         1        0.59        
702        2        F        1        TFE        F         1       -0.2         
703        3        F        1        TFE        F         1       -0.2         
704        4        F        1        TFE        F         1       -0.2         
705        5      CH2        1        TFE      CH2         1        0.26        
706        6       OA        1        TFE       OA         1       -0.55        
707        7       HO        1        TFE       HO         1        0.3         
708     #endif
709
710     [ bonds ]
711     ;  ai    aj funct           c0           c1
712         6     7     1 1.000000e-01 3.138000e+05 
713         1     2     1 1.360000e-01 4.184000e+05 
714         1     3     1 1.360000e-01 4.184000e+05 
715         1     4     1 1.360000e-01 4.184000e+05 
716         1     5     1 1.530000e-01 3.347000e+05 
717         5     6     1 1.430000e-01 3.347000e+05 
718     ...
719
720 This mechanism is used by :ref:`pdb2gmx <gmx pdb2gmx>` to implement optional position
721 restraints (:ref:`positionrestraint`) by ``#include``-ing an :ref:`itp` file
722 whose contents will be meaningful only if a particular ``#define`` is set
723 (and spelled correctly!)
724
725 Topologies for free energy calculations
726 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
727
728 Free energy differences between two systems, A and B, can be calculated
729 as described in sec. :ref:`fecalc`. Systems A and B are described by
730 topologies consisting of the same number of molecules with the same
731 number of atoms. Masses and non-bonded interactions can be perturbed by
732 adding B parameters under the ``[ atoms ]`` directive. Bonded interactions can be
733 perturbed by adding B parameters to the bonded types or the bonded
734 interactions. The parameters that can be perturbed are listed in
735 :numref:`Tables %s <tab-topfile1>` and :numref:`%s <tab-topfile2>`.
736 The :math:`\lambda`-dependence of the
737 interactions is described in section sec. :ref:`feia`. The bonded
738 parameters that are used (on the line of the bonded interaction
739 definition, or the ones looked up on atom types in the bonded type
740 lists) is explained in :numref:`Table %s <tab-topfe>`. In most cases, things should
741 work intuitively. When the A and B atom types in a bonded interaction
742 are not all identical and parameters are not present for the B-state,
743 either on the line or in the bonded types, :ref:`grompp <gmx grompp>` uses the A-state
744 parameters and issues a warning. For free energy calculations, all or no
745 parameters for topology B (:math:`\lambda = 1`) should be added on the
746 same line, after the normal parameters, in the same order as the normal
747 parameters. From |Gromacs| 4.6 onward, if :math:`\lambda` is treated as a
748 vector, then the ``bonded-lambdas`` component controls all bonded terms that
749 are not explicitly labeled as restraints. Restrain terms are controlled
750 by the ``restraint-lambdas`` component.
751
752 .. |NOT| replace:: :math:`-`
753
754 .. _tab-topfe:
755
756 .. table:: The bonded parameters that are used for free energy topologies,
757            on the line of the bonded interaction definition or looked up
758            in the bond types section based on atom types. A and B indicate the
759            parameters used for state A and B respectively, + and |NOT| indicate
760            the (non-)presence of parameters in the topology, x indicates that
761            the presence has no influence.
762
763            +--------------------+---------------+---------------------------------+---------+
764            | B-state atom types | parameters    | parameters in bonded types      |         |
765            +                    +               +-----------------+---------------+         +
766            | all identical to   | on line       | A atom types    | B atom types  | message |
767            +                    +-------+-------+-------+---------+-------+-------+         +
768            | A-state atom types | A     | B     | A     | B       | A     | B     |         |
769            +====================+=======+=======+=======+=========+=======+=======+=========+
770            |                    | +AB   | |NOT| | x     | x       |       |       |         |
771            |                    | +A    | +B    | x     | x       |       |       |         |
772            | yes                | |NOT| | |NOT| | |NOT| | |NOT|   |       |       | error   |
773            |                    | |NOT| | |NOT| | +AB   | |NOT|   |       |       |         |
774            |                    | |NOT| | |NOT| | +A    | +B      |       |       |         |
775            +--------------------+-------+-------+-------+---------+-------+-------+---------+
776            |                    | +AB   | |NOT| | x     | x       | x     | x     | warning |
777            |                    | +A    | +B    | x     | x       | x     | x     |         |
778            |                    | |NOT| | |NOT| | |NOT| | |NOT|   | x     | x     | error   |
779            | no                 | |NOT| | |NOT| | +AB   | |NOT|   | |NOT| | |NOT| | warning |
780            |                    | |NOT| | |NOT| | +A    | +B      | |NOT| | |NOT| | warning |
781            |                    | |NOT| | |NOT| | +A    | x       | +B    | |NOT| |         |
782            |                    | |NOT| | |NOT| | +A    | x       | +     | +B    |         |
783            +--------------------+-------+-------+-------+---------+-------+-------+---------+
784
785
786
787 Below is an example of a topology which changes from 200 propanols to
788 200 pentanes using the GROMOS-96 force field.
789
790 ::
791
792      
793     ; Include force field parameters
794     #include "gromos43a1.ff/forcefield.itp"
795
796     [ moleculetype ]
797     ; Name            nrexcl
798     PropPent          3
799
800     [ atoms ]
801     ; nr type resnr residue atom cgnr  charge    mass  typeB chargeB  massB
802       1    H    1     PROP    PH    1   0.398    1.008  CH3     0.0  15.035
803       2   OA    1     PROP    PO    1  -0.548  15.9994  CH2     0.0  14.027
804       3  CH2    1     PROP   PC1    1   0.150   14.027  CH2     0.0  14.027
805       4  CH2    1     PROP   PC2    2   0.000   14.027
806       5  CH3    1     PROP   PC3    2   0.000   15.035
807
808     [ bonds ]
809     ;  ai    aj funct    par_A  par_B 
810         1     2     2    gb_1   gb_26
811         2     3     2    gb_17  gb_26
812         3     4     2    gb_26  gb_26
813         4     5     2    gb_26
814
815     [ pairs ]
816     ;  ai    aj funct
817         1     4     1
818         2     5     1
819
820     [ angles ]
821     ;  ai    aj    ak funct    par_A   par_B
822         1     2     3     2    ga_11   ga_14
823         2     3     4     2    ga_14   ga_14
824         3     4     5     2    ga_14   ga_14
825
826     [ dihedrals ]
827     ;  ai    aj    ak    al funct    par_A   par_B
828         1     2     3     4     1    gd_12   gd_17
829         2     3     4     5     1    gd_17   gd_17
830
831     [ system ]
832     ; Name
833     Propanol to Pentane
834
835     [ molecules ]
836     ; Compound        #mols
837     PropPent          200
838
839 Atoms that are not perturbed, ``PC2`` and
840 ``PC3``, do not need B-state parameter specifications, since
841 the B parameters will be copied from the A parameters. Bonded
842 interactions between atoms that are not perturbed do not need B
843 parameter specifications, as is the case for the last bond in the
844 example topology. Topologies using the OPLS/AA force field need no
845 bonded parameters at all, since both the A and B parameters are
846 determined by the atom types. Non-bonded interactions involving one or
847 two perturbed atoms use the free-energy perturbation functional forms.
848 Non-bonded interactions between two non-perturbed atoms use the normal
849 functional forms. This means that when, for instance, only the charge of
850 a particle is perturbed, its Lennard-Jones interactions will also be
851 affected when lambda is not equal to zero or one.
852
853 **Note** that this topology uses the GROMOS-96 force field, in which the
854 bonded interactions are not determined by the atom types. The bonded
855 interaction strings are converted by the C-preprocessor. The force-field
856 parameter files contain lines like:
857
858 ::
859
860     #define gb_26       0.1530  7.1500e+06
861
862     #define gd_17     0.000       5.86          3
863
864 .. _constraintforce:
865
866 Constraint forces
867 ~~~~~~~~~~~~~~~~~
868
869 | The constraint force between two atoms in one molecule can be
870   calculated with the free energy perturbation code by adding a
871   constraint between the two atoms, with a different length in the A and
872   B topology. When the B length is 1 nm longer than the A length and
873   lambda is kept constant at zero, the derivative of the Hamiltonian
874   with respect to lambda is the constraint force. For constraints
875   between molecules, the pull code can be used, see sec. :ref:`pull`.
876   Below is an example for calculating the constraint force at 0.7 nm
877   between two methanes in water, by combining the two methanes into one
878   “molecule.” **Note** that the definition of a “molecule” in |Gromacs|
879   does not necessarily correspond to the chemical definition of a
880   molecule. In |Gromacs|, a “molecule” can be defined as any group of
881   atoms that one wishes to consider simultaneously. The added constraint
882   is of function type 2, which means that it is not used for generating
883   exclusions (see sec. :ref:`excl`). Note that the constraint free energy
884   term is included in the derivative term, and is specifically included
885   in the ``bonded-lambdas`` component. However, the free energy for changing
886   constraints is *not* included in the potential energy differences used
887   for BAR and MBAR, as this requires reevaluating the energy at each of
888   the constraint components. This functionality is planned for later
889   versions.
890
891 ::
892
893     ; Include force-field parameters
894     #include "gromos43a1.ff/forcefield.itp"
895
896     [ moleculetype ]
897     ; Name            nrexcl
898     Methanes               1
899
900     [ atoms ]
901     ; nr   type   resnr  residu   atom    cgnr     charge    mass
902        1    CH4     1     CH4      C1       1          0    16.043
903        2    CH4     1     CH4      C2       2          0    16.043
904     [ constraints ]
905     ;  ai    aj funct   length_A  length_B
906         1     2     2        0.7       1.7
907
908     #include "gromos43a1.ff/spc.itp"
909
910     [ system ]
911     ; Name
912     Methanes in Water
913
914     [ molecules ]
915     ; Compound        #mols
916     Methanes              1
917     SOL                2002
918
919 Coordinate file
920 ~~~~~~~~~~~~~~~
921
922 Files with the :ref:`gro` file extension contain a molecular
923 structure in GROMOS-87 format. A sample piece is included below:
924
925 ::
926
927     MD of 2 waters, reformat step, PA aug-91
928         6
929         1WATER  OW1    1   0.126   1.624   1.679  0.1227 -0.0580  0.0434
930         1WATER  HW2    2   0.190   1.661   1.747  0.8085  0.3191 -0.7791
931         1WATER  HW3    3   0.177   1.568   1.613 -0.9045 -2.6469  1.3180
932         2WATER  OW1    4   1.275   0.053   0.622  0.2519  0.3140 -0.1734
933         2WATER  HW2    5   1.337   0.002   0.680 -1.0641 -1.1349  0.0257
934         2WATER  HW3    6   1.326   0.120   0.568  1.9427 -0.8216 -0.0244
935        1.82060   1.82060   1.82060
936
937 This format is fixed, *i.e.* all columns are in a fixed position. If you
938 want to read such a file in your own program without using the |Gromacs|
939 libraries you can use the following formats:
940
941 **C-format:**
942 ``“%5i%5s%5s%5i%8.3f%8.3f%8.3f%8.4f%8.4f%8.4f”``
943
944 Or to be more precise, with title *etc.* it looks like this:
945
946 ::
947
948       "%s\n", Title
949       "%5d\n", natoms
950       for (i=0; (i<natoms); i++) {
951         "%5d%-5s%5s%5d%8.3f%8.3f%8.3f%8.4f%8.4f%8.4f\n",
952           residuenr,residuename,atomname,atomnr,x,y,z,vx,vy,vz
953       }
954       "%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n",
955         box[X][X],box[Y][Y],box[Z][Z],
956         box[X][Y],box[X][Z],box[Y][X],box[Y][Z],box[Z][X],box[Z][Y]
957
958 **Fortran format:**
959 ``(i5,2a5,i5,3f8.3,3f8.4)``
960
961 So ``confin.gro`` is the |Gromacs| coordinate file and is
962 almost the same as the GROMOS-87 file (for GROMOS users: when used with
963 ``ntx=7``). The only difference is the box for which |Gromacs|
964 uses a tensor, not a vector.