From 84ad12a3c6b0dadcc5f6921c7aaaadbd8ee9045b Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Sat, 5 May 2012 13:54:18 +1000 Subject: [PATCH] Fixing of things associated with aminoacid.rtp header Code, commenting and documentation changes, including * expanded self-documention boolean variable names * clean up of dihedral generation code * more reuse of output code * more use of t_restp objects * documentation in every force field's .rtp files * clarified why and when generated dihedrals get superseded Change-Id: I384f498f1124795e33c0ec1707ad52558bf15eb1 --- include/gen_ad.h | 6 +- include/hackblock.h | 6 +- share/top/amber03.ff/aminoacids.rtp | 28 ++- share/top/amber03.ff/dna.rtp | 28 ++- share/top/amber03.ff/rna.rtp | 28 ++- share/top/amber94.ff/aminoacids.rtp | 28 ++- share/top/amber94.ff/dna.rtp | 28 ++- share/top/amber94.ff/rna.rtp | 28 ++- share/top/amber96.ff/aminoacids.rtp | 28 ++- share/top/amber96.ff/dna.rtp | 28 ++- share/top/amber96.ff/rna.rtp | 28 ++- share/top/amber99.ff/aminoacids.rtp | 28 ++- share/top/amber99.ff/dna.rtp | 28 ++- share/top/amber99.ff/rna.rtp | 28 ++- share/top/amber99sb-ildn.ff/aminoacids.rtp | 28 ++- share/top/amber99sb-ildn.ff/dna.rtp | 28 ++- share/top/amber99sb-ildn.ff/rna.rtp | 28 ++- share/top/amber99sb.ff/aminoacids.rtp | 28 ++- share/top/amber99sb.ff/dna.rtp | 28 ++- share/top/amber99sb.ff/rna.rtp | 28 ++- share/top/amberGS.ff/aminoacids.rtp | 28 ++- share/top/amberGS.ff/dna.rtp | 28 ++- share/top/amberGS.ff/rna.rtp | 28 ++- share/top/charmm27.ff/aminoacids.rtp | 32 ++- share/top/charmm27.ff/dna.rtp | 28 ++- share/top/charmm27.ff/lipids.rtp | 28 ++- share/top/charmm27.ff/rna.rtp | 28 ++- share/top/encads.ff/aminoacids.rtp | 22 +- share/top/encadv.ff/aminoacids.rtp | 22 +- share/top/gmx.ff/aminoacids.rtp | 28 ++- share/top/gmx2.ff/aminoacids.rtp | 28 ++- share/top/gromos43a1.ff/aminoacids.rtp | 28 ++- share/top/gromos43a2.ff/aminoacids.rtp | 28 ++- share/top/gromos45a3.ff/aminoacids.rtp | 20 ++ share/top/gromos53a5.ff/aminoacids.rtp | 20 ++ share/top/gromos53a6.ff/aminoacids.rtp | 20 ++ share/top/oplsaa.ff/aminoacids.rtp | 28 ++- src/kernel/g_x2top.c | 28 ++- src/kernel/gen_ad.c | 310 ++++++++++++++++------------- src/kernel/pdb2top.c | 10 +- src/kernel/resall.c | 158 +++++++-------- 41 files changed, 986 insertions(+), 480 deletions(-) diff --git a/include/gen_ad.h b/include/gen_ad.h index baf479241c..65ea814a94 100644 --- a/include/gen_ad.h +++ b/include/gen_ad.h @@ -48,9 +48,9 @@ extern "C" { void generate_excls(t_nextnb *nnb, int nrexcl, t_excls excls[]); void clean_excls(t_nextnb *nnb, int nrexcl, t_excls excls[]); -void gen_pad(t_nextnb *nnb, t_atoms *atoms, int nrexcl, gmx_bool bH14, - t_params plist[], t_excls excls[], t_hackblock hb[], - gmx_bool bAlldih, gmx_bool bRemoveDih, gmx_bool bAllowMissing); +void gen_pad(t_nextnb *nnb, t_atoms *atoms, t_restp rtp[], + t_params plist[], t_excls excls[], t_hackblock hb[], + gmx_bool bAllowMissing); #ifdef __cplusplus } diff --git a/include/hackblock.h b/include/hackblock.h index 8827987e54..68c839ab49 100644 --- a/include/hackblock.h +++ b/include/hackblock.h @@ -80,10 +80,10 @@ typedef struct { char ***atomname; int *cgnr; /* Bonded interaction setup */ - gmx_bool bAlldih; + gmx_bool bKeepAllGeneratedDihedrals; int nrexcl; - gmx_bool HH14; - gmx_bool bRemoveDih; + gmx_bool bGenerateHH14Interactions; + gmx_bool bRemoveDihedralIfWithImproper; /* list of bonded interactions to add */ t_rbondeds rb[ebtsNR]; } t_restp; diff --git a/share/top/amber03.ff/aminoacids.rtp b/share/top/amber03.ff/aminoacids.rtp index aae899f1f7..91ea601a8b 100644 --- a/share/top/amber03.ff/aminoacids.rtp +++ b/share/top/amber03.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber03.ff/dna.rtp b/share/top/amber03.ff/dna.rtp index 3bf03f2087..c237514743 100644 --- a/share/top/amber03.ff/dna.rtp +++ b/share/top/amber03.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber03.ff/rna.rtp b/share/top/amber03.ff/rna.rtp index 2880af338b..63b65a00b0 100644 --- a/share/top/amber03.ff/rna.rtp +++ b/share/top/amber03.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber94.ff/aminoacids.rtp b/share/top/amber94.ff/aminoacids.rtp index 87d6581c7f..fc5ab38a7b 100644 --- a/share/top/amber94.ff/aminoacids.rtp +++ b/share/top/amber94.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber94.ff/dna.rtp b/share/top/amber94.ff/dna.rtp index 3bf03f2087..c237514743 100644 --- a/share/top/amber94.ff/dna.rtp +++ b/share/top/amber94.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber94.ff/rna.rtp b/share/top/amber94.ff/rna.rtp index 2880af338b..63b65a00b0 100644 --- a/share/top/amber94.ff/rna.rtp +++ b/share/top/amber94.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber96.ff/aminoacids.rtp b/share/top/amber96.ff/aminoacids.rtp index 85f0eb2a7c..31655a9b2b 100644 --- a/share/top/amber96.ff/aminoacids.rtp +++ b/share/top/amber96.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber96.ff/dna.rtp b/share/top/amber96.ff/dna.rtp index 3bf03f2087..c237514743 100644 --- a/share/top/amber96.ff/dna.rtp +++ b/share/top/amber96.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber96.ff/rna.rtp b/share/top/amber96.ff/rna.rtp index 2880af338b..63b65a00b0 100644 --- a/share/top/amber96.ff/rna.rtp +++ b/share/top/amber96.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99.ff/aminoacids.rtp b/share/top/amber99.ff/aminoacids.rtp index 4fb1b08899..c01f9d4df2 100644 --- a/share/top/amber99.ff/aminoacids.rtp +++ b/share/top/amber99.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99.ff/dna.rtp b/share/top/amber99.ff/dna.rtp index 3bf03f2087..c237514743 100644 --- a/share/top/amber99.ff/dna.rtp +++ b/share/top/amber99.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99.ff/rna.rtp b/share/top/amber99.ff/rna.rtp index 2880af338b..63b65a00b0 100644 --- a/share/top/amber99.ff/rna.rtp +++ b/share/top/amber99.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99sb-ildn.ff/aminoacids.rtp b/share/top/amber99sb-ildn.ff/aminoacids.rtp index 7423abcbc1..efb9077947 100644 --- a/share/top/amber99sb-ildn.ff/aminoacids.rtp +++ b/share/top/amber99sb-ildn.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99sb-ildn.ff/dna.rtp b/share/top/amber99sb-ildn.ff/dna.rtp index 3bf03f2087..c237514743 100644 --- a/share/top/amber99sb-ildn.ff/dna.rtp +++ b/share/top/amber99sb-ildn.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99sb-ildn.ff/rna.rtp b/share/top/amber99sb-ildn.ff/rna.rtp index 2880af338b..63b65a00b0 100644 --- a/share/top/amber99sb-ildn.ff/rna.rtp +++ b/share/top/amber99sb-ildn.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99sb.ff/aminoacids.rtp b/share/top/amber99sb.ff/aminoacids.rtp index 4fb1b08899..c01f9d4df2 100644 --- a/share/top/amber99sb.ff/aminoacids.rtp +++ b/share/top/amber99sb.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99sb.ff/dna.rtp b/share/top/amber99sb.ff/dna.rtp index 3bf03f2087..c237514743 100644 --- a/share/top/amber99sb.ff/dna.rtp +++ b/share/top/amber99sb.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amber99sb.ff/rna.rtp b/share/top/amber99sb.ff/rna.rtp index 2880af338b..63b65a00b0 100644 --- a/share/top/amber99sb.ff/rna.rtp +++ b/share/top/amber99sb.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amberGS.ff/aminoacids.rtp b/share/top/amberGS.ff/aminoacids.rtp index 87d6581c7f..fc5ab38a7b 100644 --- a/share/top/amberGS.ff/aminoacids.rtp +++ b/share/top/amberGS.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amberGS.ff/dna.rtp b/share/top/amberGS.ff/dna.rtp index 3bf03f2087..c237514743 100644 --- a/share/top/amberGS.ff/dna.rtp +++ b/share/top/amberGS.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/amberGS.ff/rna.rtp b/share/top/amberGS.ff/rna.rtp index 2880af338b..63b65a00b0 100644 --- a/share/top/amberGS.ff/rna.rtp +++ b/share/top/amberGS.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove impropers over the same bond as a proper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 9 4 1 3 1 0 diff --git a/share/top/charmm27.ff/aminoacids.rtp b/share/top/charmm27.ff/aminoacids.rtp index 0b9978f21e..7eef837af4 100644 --- a/share/top/charmm27.ff/aminoacids.rtp +++ b/share/top/charmm27.ff/aminoacids.rtp @@ -1,14 +1,26 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 -; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih - 1 5 9 2 1 3 1 0 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such +; bondtype angletype dihedraltype impropertype all_dih nrexcl HH14 bRemoveDih + 1 5 9 2 1 3 1 0 [ ALA ] [ atoms ] diff --git a/share/top/charmm27.ff/dna.rtp b/share/top/charmm27.ff/dna.rtp index 72bd8df318..c3eed3d891 100644 --- a/share/top/charmm27.ff/dna.rtp +++ b/share/top/charmm27.ff/dna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 5 9 2 1 3 1 0 diff --git a/share/top/charmm27.ff/lipids.rtp b/share/top/charmm27.ff/lipids.rtp index 351e4f652e..39326d0c0c 100644 --- a/share/top/charmm27.ff/lipids.rtp +++ b/share/top/charmm27.ff/lipids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 5 9 2 1 3 1 0 diff --git a/share/top/charmm27.ff/rna.rtp b/share/top/charmm27.ff/rna.rtp index 78d01d6ee5..6356c97fb6 100644 --- a/share/top/charmm27.ff/rna.rtp +++ b/share/top/charmm27.ff/rna.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 5 9 2 1 3 1 0 diff --git a/share/top/encads.ff/aminoacids.rtp b/share/top/encads.ff/aminoacids.rtp index 7587f8f1ff..a23099b5d4 100644 --- a/share/top/encads.ff/aminoacids.rtp +++ b/share/top/encads.ff/aminoacids.rtp @@ -5,7 +5,27 @@ ; study the parameter files of Encad. ; [ bondedtypes ] -; bonds angles dihedrals impropers all_dihedrals nrexcl keep_dihedrals_on_impropers +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such +; bonds angles dihedrals impropers all_dihedrals nrexcl bHH14 bRemoveDih 1 1 1 1 0 3 1 diff --git a/share/top/encadv.ff/aminoacids.rtp b/share/top/encadv.ff/aminoacids.rtp index c964099f2d..7682e6a9a5 100644 --- a/share/top/encadv.ff/aminoacids.rtp +++ b/share/top/encadv.ff/aminoacids.rtp @@ -5,7 +5,27 @@ ; study the parameter files of Encad. ; [ bondedtypes ] -; bonds angles dihedrals impropers all_dihedrals nrexcl keep_dihedrals_on_impropers +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such +; bonds angles dihedrals impropers all_dihedrals nrexcl bHH14 bRemoveDih 1 1 1 1 0 3 1 diff --git a/share/top/gmx.ff/aminoacids.rtp b/share/top/gmx.ff/aminoacids.rtp index daa9356449..0a89b9bdf3 100644 --- a/share/top/gmx.ff/aminoacids.rtp +++ b/share/top/gmx.ff/aminoacids.rtp @@ -30,14 +30,26 @@ ; GROningen MAchine for Chemical Simulation ; [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 1 2 0 3 0 1 diff --git a/share/top/gmx2.ff/aminoacids.rtp b/share/top/gmx2.ff/aminoacids.rtp index 301cc37339..1a1e35d1fd 100644 --- a/share/top/gmx2.ff/aminoacids.rtp +++ b/share/top/gmx2.ff/aminoacids.rtp @@ -30,14 +30,26 @@ ; Gyas ROwers Mature At Cryogenic Speed ; [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 1 2 0 3 0 1 diff --git a/share/top/gromos43a1.ff/aminoacids.rtp b/share/top/gromos43a1.ff/aminoacids.rtp index dc987fe7d8..6e9547a8c4 100644 --- a/share/top/gromos43a1.ff/aminoacids.rtp +++ b/share/top/gromos43a1.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 2 2 1 2 0 3 0 1 diff --git a/share/top/gromos43a2.ff/aminoacids.rtp b/share/top/gromos43a2.ff/aminoacids.rtp index 747d20dd2a..fa3f1719da 100644 --- a/share/top/gromos43a2.ff/aminoacids.rtp +++ b/share/top/gromos43a2.ff/aminoacids.rtp @@ -1,12 +1,24 @@ [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 2 2 1 2 0 3 0 1 diff --git a/share/top/gromos45a3.ff/aminoacids.rtp b/share/top/gromos45a3.ff/aminoacids.rtp index db9528cb90..1fd82241bc 100644 --- a/share/top/gromos45a3.ff/aminoacids.rtp +++ b/share/top/gromos45a3.ff/aminoacids.rtp @@ -1,4 +1,24 @@ [ bondedtypes ] +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers 2 2 1 2 diff --git a/share/top/gromos53a5.ff/aminoacids.rtp b/share/top/gromos53a5.ff/aminoacids.rtp index c4b601d0d4..aa47ae68ac 100644 --- a/share/top/gromos53a5.ff/aminoacids.rtp +++ b/share/top/gromos53a5.ff/aminoacids.rtp @@ -1,4 +1,24 @@ [ bondedtypes ] +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers 2 2 1 2 diff --git a/share/top/gromos53a6.ff/aminoacids.rtp b/share/top/gromos53a6.ff/aminoacids.rtp index 3effc69110..b42ec5279f 100644 --- a/share/top/gromos53a6.ff/aminoacids.rtp +++ b/share/top/gromos53a6.ff/aminoacids.rtp @@ -1,4 +1,24 @@ [ bondedtypes ] +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers 2 2 1 2 diff --git a/share/top/oplsaa.ff/aminoacids.rtp b/share/top/oplsaa.ff/aminoacids.rtp index df212ae524..fd21b48467 100644 --- a/share/top/oplsaa.ff/aminoacids.rtp +++ b/share/top/oplsaa.ff/aminoacids.rtp @@ -13,14 +13,26 @@ ; you should use PME. [ bondedtypes ] -; Col 1: Type of bond -; Col 2: Type of angles -; Col 3: Type of proper dihedrals -; Col 4: Type of improper dihedrals -; Col 5: Generate all dihedrals if 1, only heavy atoms of 0. -; Col 6: Number of excluded neighbors for nonbonded interactions -; Col 7: Generate 1,4 interactions between pairs of hydrogens if 1 -; Col 8: Remove propers over the same bond as an improper if it is 1 +; Column 1 : default bondtype +; Column 2 : default angletype +; Column 3 : default proper dihedraltype +; Column 4 : default improper dihedraltype +; Column 5 : This controls the generation of dihedrals from the bonding. +; All possible dihedrals are generated automatically. A value of +; 1 here means that all these are retained. A value of +; 0 here requires generated dihedrals be removed if +; * there are any dihedrals on the same central atoms +; specified in the residue topology, or +; * there are other identical generated dihedrals +; sharing the same central atoms, or +; * there are other generated dihedrals sharing the +; same central bond that have fewer hydrogen atoms +; Column 6 : number of neighbors to exclude from non-bonded interactions +; Column 7 : 1 = generate 1,4 interactions between pairs of hydrogen atoms +; 0 = do not generate such +; Column 8 : 1 = remove proper dihedrals if found centered on the same +; bond as an improper dihedral +; 0 = do not generate such ; bonds angles dihedrals impropers all_dihedrals nrexcl HH14 RemoveDih 1 1 3 1 1 3 1 0 diff --git a/src/kernel/g_x2top.c b/src/kernel/g_x2top.c index 6d82673e5c..519fec272b 100644 --- a/src/kernel/g_x2top.c +++ b/src/kernel/g_x2top.c @@ -61,6 +61,7 @@ #include "vec.h" #include "g_x2top.h" #include "atomprop.h" +#include "hackblock.h" char atp[7] = "HCNOSX"; #define NATP (asize(atp)-1) @@ -403,9 +404,12 @@ int main(int argc, char *argv[]) }; #define NFILE asize(fnm) static real scale = 1.1, kb = 4e5,kt = 400,kp = 5; - static int nexcl = 3; - static gmx_bool bRemoveDih = FALSE; - static gmx_bool bParam = TRUE, bH14 = TRUE,bAllDih = FALSE,bRound = TRUE; + static t_restp rtp_header_settings; + static gmx_bool bRemoveDihedralIfWithImproper = FALSE; + static gmx_bool bGenerateHH14Interactions = TRUE; + static gmx_bool bKeepAllGeneratedDihedrals = FALSE; + static int nrexcl = 3; + static gmx_bool bParam = TRUE, bRound = TRUE; static gmx_bool bPairs = TRUE, bPBC = TRUE; static gmx_bool bUsePDBcharge = FALSE,bVerbose=FALSE; static const char *molnm = "ICE"; @@ -415,13 +419,13 @@ int main(int argc, char *argv[]) "Force field for your simulation. Type \"select\" for interactive selection." }, { "-v", FALSE, etBOOL, {&bVerbose}, "Generate verbose output in the top file." }, - { "-nexcl", FALSE, etINT, {&nexcl}, + { "-nexcl", FALSE, etINT, {&nrexcl}, "Number of exclusions" }, - { "-H14", FALSE, etBOOL, {&bH14}, + { "-H14", FALSE, etBOOL, {&bGenerateHH14Interactions}, "Use 3rd neighbour interactions for hydrogen atoms" }, - { "-alldih", FALSE, etBOOL, {&bAllDih}, + { "-alldih", FALSE, etBOOL, {&bKeepAllGeneratedDihedrals}, "Generate all proper dihedrals" }, - { "-remdih", FALSE, etBOOL, {&bRemoveDih}, + { "-remdih", FALSE, etBOOL, {&bRemoveDihedralIfWithImproper}, "Remove dihedrals on the same bond as an improper" }, { "-pairs", FALSE, etBOOL, {&bPairs}, "Output 1-4 interactions (pairs) in topology file" }, @@ -449,6 +453,12 @@ int main(int argc, char *argv[]) asize(desc),desc,asize(bugs),bugs,&oenv); bRTP = opt2bSet("-r",NFILE,fnm); bTOP = opt2bSet("-o",NFILE,fnm); + /* C89 requirements mean that these struct members cannot be used in + * the declaration of pa. So some temporary variables are needed. */ + rtp_header_settings.bRemoveDihedralIfWithImproper = bRemoveDihedralIfWithImproper; + rtp_header_settings.bGenerateHH14Interactions = bGenerateHH14Interactions; + rtp_header_settings.bKeepAllGeneratedDihedrals = bKeepAllGeneratedDihedrals; + rtp_header_settings.nrexcl = nrexcl; if (!bRTP && !bTOP) gmx_fatal(FARGS,"Specify at least one output file"); @@ -502,7 +512,7 @@ int main(int argc, char *argv[]) init_nnb(&nnb,atoms->nr,4); gen_nnb(&nnb,plist); print_nnb(&nnb,"NNB"); - gen_pad(&nnb,atoms,bH14,nexcl,plist,excls,NULL,bAllDih,bRemoveDih,TRUE); + gen_pad(&nnb,atoms,&rtp_header_settings,plist,excls,NULL,TRUE); done_nnb(&nnb); if (!bPairs) @@ -532,7 +542,7 @@ int main(int argc, char *argv[]) "Generated by x2top",TRUE,ffdir,1.0); write_top(fp,NULL,mymol.name,atoms,FALSE,bts,plist,excls,atype, - cgnr,nexcl); + cgnr,rtp_header_settings.nrexcl); print_top_mols(fp,mymol.name,ffdir,NULL,0,NULL,1,&mymol); ffclose(fp); diff --git a/src/kernel/gen_ad.c b/src/kernel/gen_ad.c index 977f71efd9..92cc4df570 100644 --- a/src/kernel/gen_ad.c +++ b/src/kernel/gen_ad.c @@ -56,6 +56,12 @@ #include "resall.h" #include "gen_ad.h" +#define DIHEDRAL_WAS_SET_IN_RTP 0 +static gmx_bool was_dihedral_set_in_rtp(t_param *dih) +{ + return dih->c[MAXFORCEPARAM-1] == DIHEDRAL_WAS_SET_IN_RTP; +} + typedef gmx_bool (*peq)(t_param *p1, t_param *p2); static int acomp(const void *a1, const void *a2) @@ -88,29 +94,44 @@ static int pcomp(const void *a1, const void *a2) static int dcomp(const void *d1, const void *d2) { - t_param *p1,*p2; - int dc; + t_param *p1,*p2; + int dc; - p1=(t_param *)d1; - p2=(t_param *)d2; - /* First sort by J & K (the two central) atoms */ - if ((dc=(p1->AJ-p2->AJ))!=0) - return dc; - else if ((dc=(p1->AK-p2->AK))!=0) - return dc; - /* Then make sure to put rtp dihedrals before generated ones */ - else if (p1->c[MAXFORCEPARAM-1]==0 && p2->c[MAXFORCEPARAM-1]==NOTSET) - return -1; - else if (p1->c[MAXFORCEPARAM-1]==NOTSET && p2->c[MAXFORCEPARAM-1]==0) - return 1; - /* Finally, sort by I and J (two outer) atoms */ - else if ((dc=(p1->AI-p2->AI))!=0) - return dc; - else - return (p1->AL-p2->AL); + p1=(t_param *)d1; + p2=(t_param *)d2; + /* First sort by J & K (the two central) atoms */ + if ((dc=(p1->AJ-p2->AJ))!=0) + { + return dc; + } + else if ((dc=(p1->AK-p2->AK))!=0) + { + return dc; + } + /* Then make sure to put rtp dihedrals before generated ones */ + else if (was_dihedral_set_in_rtp(p1) && + !was_dihedral_set_in_rtp(p2)) + { + return -1; + } + else if (!was_dihedral_set_in_rtp(p1) && + was_dihedral_set_in_rtp(p2)) + { + return 1; + } + /* Finally, sort by I and J (two outer) atoms */ + else if ((dc=(p1->AI-p2->AI))!=0) + { + return dc; + } + else + { + return (p1->AL-p2->AL); + } } -static gmx_bool deq(t_param *p1, t_param *p2) + +static gmx_bool is_dihedral_on_same_bond(t_param *p1, t_param *p2) { if (((p1->AJ==p2->AJ) && (p1->AK==p2->AK)) || ((p1->AJ==p2->AK) && (p1->AK==p2->AJ))) @@ -120,30 +141,6 @@ static gmx_bool deq(t_param *p1, t_param *p2) } -static gmx_bool remove_dih(t_param *p, int i, int np) - /* check if dihedral p[i] should be removed */ -{ - gmx_bool bRem; - int j; - - if (p[i].c[MAXFORCEPARAM-1]==NOTSET) { - if (i>0) - bRem = deq(&p[i],&p[i-1]); - else - bRem = FALSE; - /* also remove p[i] if there is a dihedral on the same bond - which has parameters set */ - j=i+1; - while (!bRem && (jAI==p2->AI) && (p1->AJ==p2->AJ)) @@ -324,112 +321,151 @@ static int n_hydro(atom_id a[],char ***atomname) return nh; } -static void clean_dih(t_param *dih, int *ndih,t_param idih[],int nidih, - t_atoms *atoms,gmx_bool bAlldih, gmx_bool bRemoveDih) +/* Clean up the dihedrals (both generated and read from the .rtp + * file). */ +static void clean_dih(t_param *dih, int *ndih,t_param improper[],int nimproper, + t_atoms *atoms,gmx_bool bKeepAllGeneratedDihedrals, + gmx_bool bRemoveDihedralIfWithImproper) { - int i,j,k,l; - int *index,nind; - gmx_bool bIsSet,bKeep; - int bestl,nh,minh; + int i,j,k,l; + int *index,nind; - snew(index,*ndih+1); - if (bAlldih) { - fprintf(stderr,"Keeping all generated dihedrals\n"); - nind = *ndih; - for(i=0; iatomname)) < minh) { - minh=nh; - bestl=l; - } - if (minh == 0) - break; - } - } - if (k != bestl) - cpparam(&(dih[k]),&dih[bestl]); - k++; + k=0; + for(i=0; iatomname); + if (nh < minh) + { + minh=nh; + bestl=l; + } + if (0 == minh) + { + break; + } + } + } + if (k != bestl) + { + cpparam(&dih[k],&dih[bestl]); + } + k++; + } } - } - for (i=k; i<*ndih; i++) - strcpy(dih[i].s,""); - *ndih = k; + for (i = k; i < *ndih; i++) + { + strcpy(dih[i].s,""); + } + *ndih = k; - sfree(index); + sfree(index); } -static int get_impropers(t_atoms *atoms,t_hackblock hb[],t_param **idih, +static int get_impropers(t_atoms *atoms,t_hackblock hb[],t_param **improper, gmx_bool bAllowMissing) { char *a0; - t_rbondeds *idihs; - t_rbonded *hbidih; - int nidih,i,j,k,r,start,ninc,nalloc; + t_rbondeds *impropers; + t_rbonded *hbimproper; + int nimproper,i,j,k,r,start,ninc,nalloc; atom_id ai[MAXATOMLIST]; gmx_bool bStop; ninc = 500; nalloc = ninc; - snew(*idih,nalloc); + snew(*improper,nalloc); /* Add all the impropers from the residue database to the list. */ - nidih = 0; + nimproper = 0; start = 0; if (hb != NULL) { for(i=0; (inres); i++) { - idihs=&hb[i].rb[ebtsIDIHS]; - for(j=0; (jnb); j++) { + impropers=&hb[i].rb[ebtsIDIHS]; + for(j=0; (jnb); j++) { bStop=FALSE; for(k=0; (k<4) && !bStop; k++) { - ai[k] = search_atom(idihs->b[j].a[k],start, + ai[k] = search_atom(impropers->b[j].a[k],start, atoms, "improper",bAllowMissing); if (ai[k] == NO_ATID) bStop = TRUE; } if (!bStop) { - if (nidih == nalloc) { + if (nimproper == nalloc) { nalloc += ninc; - srenew(*idih,nalloc); + srenew(*improper,nalloc); } /* Not broken out */ - set_p(&((*idih)[nidih]),ai,NULL,idihs->b[j].s); - nidih++; + set_p(&((*improper)[nimproper]),ai,NULL,impropers->b[j].s); + nimproper++; } } while ((startnr) && (atoms->atom[start].resind == i)) @@ -437,7 +473,7 @@ static int get_impropers(t_atoms *atoms,t_hackblock hb[],t_param **idih, } } - return nidih; + return nimproper; } static int nb_dist(t_nextnb *nnb,int ai,int aj) @@ -599,17 +635,18 @@ void generate_excls(t_nextnb *nnb, int nrexcl, t_excls excls[]) } } -void gen_pad(t_nextnb *nnb, t_atoms *atoms, int nrexcl, gmx_bool bH14, - t_params plist[], t_excls excls[], t_hackblock hb[], - gmx_bool bAlldih, gmx_bool bRemoveDih, gmx_bool bAllowMissing) +/* Generate pairs, angles and dihedrals from .rtp settings */ +void gen_pad(t_nextnb *nnb, t_atoms *atoms, t_restp rtp[], + t_params plist[], t_excls excls[], t_hackblock hb[], + gmx_bool bAllowMissing) { - t_param *ang,*dih,*pai,*idih; + t_param *ang,*dih,*pai,*improper; t_rbondeds *hbang, *hbdih; char **anm; int res,minres,maxres; int i,j,j1,k,k1,l,l1,m,n,i1,i2; int ninc,maxang,maxdih,maxpai; - int nang,ndih,npai,nidih,nbd; + int nang,ndih,npai,nimproper,nbd; int nFound; gmx_bool bFound,bExcl; @@ -634,7 +671,8 @@ void gen_pad(t_nextnb *nnb, t_atoms *atoms, int nrexcl, gmx_bool bH14, if (hb) gen_excls(atoms,excls,hb,bAllowMissing); - /* extract all i-j-k-l neighbours from nnb struct */ + /* Extract all i-j-k-l neighbours from nnb struct to generate all + * angles and dihedrals. */ for(i=0; (inr); i++) /* For all particles */ for(j=0; (jnrexcl[i][1]); j++) { @@ -729,7 +767,7 @@ void gen_pad(t_nextnb *nnb, t_atoms *atoms, int nrexcl, gmx_bool bH14, /* Set the last parameter to be able to see if the dihedral was in the rtp list. */ - dih[ndih].c[MAXFORCEPARAM-1] = 0; + dih[ndih].c[MAXFORCEPARAM-1] = DIHEDRAL_WAS_SET_IN_RTP; nFound++; ndih++; /* Set the next direct in case the rtp contains @@ -774,7 +812,8 @@ void gen_pad(t_nextnb *nnb, t_atoms *atoms, int nrexcl, gmx_bool bH14, for(m=0; m 0) { - /* Remove dihedrals which are impropers - and when bAlldih is not set remove multiple dihedrals over one bond. - */ fprintf(stderr,"Before cleaning: %d dihedrals\n",ndih); - clean_dih(dih,&ndih,idih,nidih,atoms,bAlldih,bRemoveDih); + clean_dih(dih,&ndih,improper,nimproper,atoms, + rtp[0].bKeepAllGeneratedDihedrals, + rtp[0].bRemoveDihedralIfWithImproper); } /* Now we have unique lists of angles and dihedrals @@ -833,15 +871,15 @@ void gen_pad(t_nextnb *nnb, t_atoms *atoms, int nrexcl, gmx_bool bH14, */ cppar(ang, nang, plist,F_ANGLES); cppar(dih, ndih, plist,F_PDIHS); - cppar(idih,nidih,plist,F_IDIHS); + cppar(improper,nimproper,plist,F_IDIHS); cppar(pai, npai, plist,F_LJ14); /* Remove all exclusions which are within nrexcl */ - clean_excls(nnb,nrexcl,excls); + clean_excls(nnb,rtp[0].nrexcl,excls); sfree(ang); sfree(dih); - sfree(idih); + sfree(improper); sfree(pai); } diff --git a/src/kernel/pdb2top.c b/src/kernel/pdb2top.c index 2c0fd13010..7889a447f2 100644 --- a/src/kernel/pdb2top.c +++ b/src/kernel/pdb2top.c @@ -896,10 +896,10 @@ static void check_restp_types(t_restp *r0,t_restp *r1) { int i; - check_restp_type("all dihedrals",r0->bAlldih,r1->bAlldih); + check_restp_type("all dihedrals",r0->bKeepAllGeneratedDihedrals,r1->bKeepAllGeneratedDihedrals); check_restp_type("nrexcl",r0->nrexcl,r1->nrexcl); - check_restp_type("HH14",r0->HH14,r1->HH14); - check_restp_type("remove dihedrals",r0->bRemoveDih,r1->bRemoveDih); + check_restp_type("HH14",r0->bGenerateHH14Interactions,r1->bGenerateHH14Interactions); + check_restp_type("remove dihedrals",r0->bRemoveDihedralIfWithImproper,r1->bRemoveDihedralIfWithImproper); for(i=0; inr,4); gen_nnb(&nnb,plist); print_nnb(&nnb,"NNB"); - gen_pad(&nnb,atoms,restp[0].nrexcl,restp[0].HH14, - plist,excls,hb,restp[0].bAlldih,restp[0].bRemoveDih, - bAllowMissing); + gen_pad(&nnb,atoms,restp,plist,excls,hb,bAllowMissing); done_nnb(&nnb); /* Make CMAP */ diff --git a/src/kernel/resall.c b/src/kernel/resall.c index 96808b08c4..dfccca2718 100644 --- a/src/kernel/resall.c +++ b/src/kernel/resall.c @@ -248,6 +248,42 @@ void clear_t_restp(t_restp *rrtp) memset((void *)rrtp, 0, sizeof(t_restp)); } +/* print all the ebtsNR type numbers */ +void print_resall_header(FILE *out, t_restp rtp[]) +{ + fprintf(out,"[ bondedtypes ]\n"); + fprintf(out,"; bonds angles dihedrals impropers all_dihedrals nr_exclusions HH14 remove_dih\n"); + fprintf(out," %5d %6d %9d %9d %14d %14d %14d %14d\n\n", + rtp[0].rb[0].type, + rtp[0].rb[1].type, + rtp[0].rb[2].type, + rtp[0].rb[3].type, + rtp[0].bKeepAllGeneratedDihedrals, + rtp[0].nrexcl, + rtp[0].bGenerateHH14Interactions, + rtp[0].bRemoveDihedralIfWithImproper); +} + +void print_resall(FILE *out, int nrtp, t_restp rtp[], + gpp_atomtype_t atype) +{ + int i,bt; + + if (nrtp == 0) { + return; + } + + print_resall_header(out, rtp); + + for(i=0; i 0) { + print_resatoms(out,atype,&rtp[i]); + for(bt=0; btrb[ebtsBONDS].type = 1; /* normal bonds */ + header_settings->rb[ebtsANGLES].type = 1; /* normal angles */ + header_settings->rb[ebtsPDIHS].type = 1; /* normal dihedrals */ + header_settings->rb[ebtsIDIHS].type = 2; /* normal impropers */ + header_settings->rb[ebtsEXCLS].type = 1; /* normal exclusions */ + header_settings->rb[ebtsCMAP].type = 1; /* normal cmap torsions */ + + header_settings->bKeepAllGeneratedDihedrals = FALSE; + header_settings->nrexcl = 3; + header_settings->bGenerateHH14Interactions = TRUE; + header_settings->bRemoveDihedralIfWithImproper = TRUE; /* Column 5 & 6 aren't really bonded types, but we include * them here to avoid introducing a new section: - * Column 5: 1 means generate all dihedrals, 0 not. + * Column 5 : This controls the generation of dihedrals from the bonding. + * All possible dihedrals are generated automatically. A value of + * 1 here means that all these are retained. A value of + * 0 here requires generated dihedrals be removed if + * * there are any dihedrals on the same central atoms + * specified in the residue topology, or + * * there are other identical generated dihedrals + * sharing the same central atoms, or + * * there are other generated dihedrals sharing the + * same central bond that have fewer hydrogen atoms * Column 6: Number of bonded neighbors to exclude. - * Coulmn 7: Generate 1,4 interactions between pairs of hydrogens - * Column 8: Remove impropers over the same bond as a proper dihedral + * Column 7: Generate 1,4 interactions between two hydrogen atoms + * Column 8: Remove proper dihedrals if centered on the same bond + * as an improper dihedral */ - get_a_line(in,line,STRLEN); if (!get_header(line,header)) gmx_fatal(FARGS,"in .rtp file at line:\n%s\n",line); if (gmx_strncasecmp("bondedtypes",header,5)==0) { get_a_line(in,line,STRLEN); if ((nparam=sscanf(line,"%d %d %d %d %d %d %d %d", - &bts[ebtsBONDS],&bts[ebtsANGLES], - &bts[ebtsPDIHS],&bts[ebtsIDIHS], - &dum1,&nrexcl,&dum2,&dum3)) < 4 ) + &header_settings->rb[ebtsBONDS].type,&header_settings->rb[ebtsANGLES].type, + &header_settings->rb[ebtsPDIHS].type,&header_settings->rb[ebtsIDIHS].type, + &dum1,&header_settings->nrexcl,&dum2,&dum3)) < 4 ) { - gmx_fatal(FARGS,"need at least 4 (up to 8) parameters in .rtp file at line:\n%s\n",line); + gmx_fatal(FARGS,"need 4 to 8 parameters in the header of .rtp file %s at line:\n%s\n", rrdb, line); } - bAlldih = (dum1 != 0); - HH14 = (dum2 != 0); - bRemoveDih = (dum3 != 0); + header_settings->bKeepAllGeneratedDihedrals = (dum1 != 0); + header_settings->bGenerateHH14Interactions = (dum2 != 0); + header_settings->bRemoveDihedralIfWithImproper = (dum3 != 0); get_a_line(in,line,STRLEN); if(nparam<5) { fprintf(stderr,"Using default: not generating all possible dihedrals\n"); - bAlldih = FALSE; + header_settings->bKeepAllGeneratedDihedrals = FALSE; } if(nparam<6) { fprintf(stderr,"Using default: excluding 3 bonded neighbors\n"); - nrexcl = 3; + header_settings->nrexcl = 3; } if(nparam<7) { fprintf(stderr,"Using default: generating 1,4 H--H interactions\n"); - HH14 = TRUE; + header_settings->bGenerateHH14Interactions = TRUE; } if(nparam<8) { - fprintf(stderr,"Using default: removing impropers on same bond as a proper\n"); - bRemoveDih = TRUE; + fprintf(stderr,"Using default: removing proper dihedrals found on the same bond as a proper dihedral\n"); + header_settings->bRemoveDihedralIfWithImproper = TRUE; } } else { fprintf(stderr, "Reading .rtp file without '[ bondedtypes ]' directive,\n" - "Will proceed as if the entry\n" - "\n" - "\n[ bondedtypes ]" - "\n; bonds angles dihedrals impropers all_dihedrals nr_exclusions HH14 remove_dih" - "\n %3d %3d %3d %3d %3d %3d %3d %3d" - "\n" - "was present at the beginning of %s", - bts[0],bts[1],bts[2],bts[3], bAlldih ? 1 : 0,nrexcl,HH14,bRemoveDih,rrdb); + "Will proceed as if the entry was:\n"); + print_resall_header(stderr, header_settings); } /* We don't know the current size of rrtp, but simply realloc immediately */ nrtp = *nrtpptr; @@ -351,21 +386,14 @@ void read_resall(char *rrdb, int *nrtpptr, t_restp **rtp, maxrtp+=100; srenew(rrtp,maxrtp); } - clear_t_restp(&rrtp[nrtp]); + + /* Initialise rtp entry structure */ + rrtp[nrtp] = *header_settings; if (!get_header(line,header)) gmx_fatal(FARGS,"in .rtp file at line:\n%s\n",line); rrtp[nrtp].resname = strdup(header); rrtp[nrtp].filebase = strdup(filebase); - /* Set the bonded types */ - rrtp[nrtp].bAlldih = bAlldih; - rrtp[nrtp].nrexcl = nrexcl; - rrtp[nrtp].HH14 = HH14; - rrtp[nrtp].bRemoveDih = bRemoveDih; - for(i=0; i 0) { - print_resatoms(out,atype,&rtp[i]); - for(bt=0; bt