# '\[ atomtypes \]' Invalid order for directive atomtypes

**URL:** <https://gromacs.bioexcel.eu/t/atomtypes-invalid-order-for-directive-atomtypes/5355>\
**Category:** User discussions\
**Tags:** grompp\
**Created:** [December 3, 2022, 4:55pm UTC](https://gromacs.bioexcel.eu/t/atomtypes-invalid-order-for-directive-atomtypes/5355 "2022-12-03T16:55:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![merry](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@merry](https://gromacs.bioexcel.eu/u/merry)\
**Post date:** [December 3, 2022, 4:55pm UTC](https://gromacs.bioexcel.eu/t/atomtypes-invalid-order-for-directive-atomtypes/5355/1 "2022-12-03T16:55:53Z")

</div>

GROMACS version: 2019.4  
GROMACS modification: No

Hi. I get the itp file for my polymer (containing 305 atoms) using the PolyParGen ([http://polypargen.com](http://polypargen.com)), as follows:

; GENERATED BY PolyParGen 2022/11/29 12:31:04UTC  
; Automatic parameter generation tool:LigParGen  
;

[atomtypes]  
ppg\_AAA H0 1.0080 0.000 A 2.50000E-01 1.25520E-01  
ppg\_AAB C1 12.0110 0.000 A 3.50000E-01 2.76144E-01  
ppg\_AAC O2 15.9990 0.000 A 2.90000E-01 5.85760E-01  
ppg\_AAD O3 15.9990 0.000 A 3.12000E-01 7.11280E-01  
ppg\_AAE H4 1.0080 0.000 A 0.00000E+00 0.00000E+00  
ppg\_AAF H5 1.0080 0.000 A 2.50000E-01 1.25520E-01  
ppg\_AAG C6 12.0110 0.000 A 3.50000E-01 2.76144E-01  
ppg\_AAH O7 15.9990 0.000 A 2.90000E-01 5.85760E-01  
ppg\_AAI C8 12.0110 0.000 A 3.55000E-01 2.92880E-01  
ppg\_AAJ O9 15.9990 0.000 A 2.96000E-01 8.78640E-01  
ppg\_AAK O10 15.9990 0.000 A 3.12000E-01 7.11280E-01  
ppg\_AAL H11 1.0080 0.000 A 0.00000E+00 0.00000E+00

[moleculetype]  
; Name nrexcl  
LIG 3

[atoms]  
; nr type resnr residue atom cgnr charge mass  
1 ppg\_AAB 1 LIG C004 1 -0.2390 12.0110  
2 ppg\_AAA 1 LIG H003 1 0.0895 1.0080  
3 ppg\_AAA 1 LIG H002 1 0.0896 1.0080  
4 ppg\_AAA 1 LIG H001 1 0.0895 1.0080  
5 ppg\_AAB 1 LIG C003 1 -0.1713 12.0110  
6 ppg\_AAA 1 LIG H005 1 0.1197 1.0080  
7 ppg\_AAA 1 LIG H004 1 0.1198 1.0080  
8 ppg\_AAB 1 LIG C002 1 0.4357 12.0110  
9 ppg\_AAC 1 LIG O000 1 -0.4147 15.9990  
10 ppg\_AAB 1 LIG C001 1 0.0259 12.0110  
11 ppg\_AAA 1 LIG H00Q 1 0.1045 1.0080  
12 ppg\_AAA 1 LIG H00P 1 0.1045 1.0080  
13 ppg\_AAB 1 LIG C000 1 -0.0078 12.0110  
14 ppg\_AAA 1 LIG H00R 1 0.0873 1.0080  
15 ppg\_AAA 1 LIG H000 1 0.0871 1.0080  
16 ppg\_AAC 1 LIG O007 1 -0.3810 15.9990  
17 ppg\_AAB 1 LIG C00G 1 0.0101 12.0110  
18 ppg\_AAA 1 LIG H00T 1 0.0973 1.0080  
19 ppg\_AAA 1 LIG H00S 1 0.0972 1.0080  
20 ppg\_AAB 1 LIG C00H 1 0.0043 12.0110  
21 ppg\_AAA 1 LIG H00V 1 0.0897 1.0080  
.  
.  
.  
.  
.  
.

Then, I manually created a topology file as follows:

;  
#include “lig.itp”

; Include Position restraint file  
#ifdef POSRES  
#include “posre.itp”  
#endif

[system]  
; Name  
Polymer

[molecules]  
; Compound #mols  
LIG 1

When I used the command:  
gmx\_mpi grompp -f min\_vac.mdp -c box.gro -p topol.top -o min\_vac.tpr

I encountered with the following error:

Fatal error:  
Syntax error - File lig.itp, line 5  
Last line read:  
‘[atomtypes]’  
Invalid order for directive atomtypes

How to resolve this issue?

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [December 3, 2022, 5:07pm UTC](https://gromacs.bioexcel.eu/t/atomtypes-invalid-order-for-directive-atomtypes/5355/2 "2022-12-03T17:07:43Z")

</div>

You need to `#include` a parent force field first, or manually define a `[defaults]` directive. You cannot being a topology with `[atomtypes]`.
