[gmx-users] Position restraining of ions.

Gordan Horvat ghorvat at chem.pmf.hr
Thu Jul 16 14:38:54 CEST 2015


I should correct myself. Your top file should work too, because grompp 
assigns certain restraints included in top file to molecules of type 
defined in the first itp file found  above the line that includes these 
restraints.
http://www.gromacs.org/Documentation/Errors#Atom_index_n_in_position_restraints_out_of_bounds

Alternatively, you can put the

#ifdef REST_ON
[ position_restraints ]
;  i funct       fcx        fcy        fcz
    1    1       1000       1000       1000
#endif

section in your top file below the line that includes the ion group itp 
file, or in the itp file of each ion group you want restrained.

Gordan

On 7/16/2015 13:47 PM, Justin Lemkul wrote:
>
>
> On 7/16/15 6:22 AM, Gordan Horvat wrote:
>>   #ifdef REST_ON
>>   #include "POT_rest.itp"
>>   #endif
>>
>> should go at the end of POT_rest.itp file and
>>
>>   #ifdef REST_ON
>>   #include "CL_rest.itp"
>>   #endif
>>
>> should go at the end of CL.itp file. The restraint you listed
>> restraints the
>> first atom of every molecule of the type stated in the corresponding
>> itp file.
>> Since potassium and chloride ions are monoatomic, that should work fine.
>>
>
> Neither of the #ifdefs have to be in the actual .itp files.  They must
> correspond to the [moleculetype], and since they are appropriately
> listed consecutively here, this approach works fine.
>
>> Elsewise, you can just put the line
>>
>>   #include "ionX_rest.itp"
>>
>> at the end of the ionX.itp file which will turn on restraints
>> automatically
>> without having to define -DPOSIONX keyword in mdp file.
>>
>
> This is dangerous because then the restraints are *always* on, which is
> usually undesirable.  If you forget to modify the files if conditions
> change, then run a long simulation...
>
> -Justin
>



More information about the gromacs.org_gmx-users mailing list