<div dir="ltr"><div><div>Dear users,<br></div>I am trying to add an external field which will add some extra force to my simulation system for selected atoms.<br>For that, I was following the &quot;patching mdrun&quot; exercise in <br><a href="http://www.gromacs.org/Developer_Zone/Programming_Guide/Patching_mdrun" target="_blank">http://www.gromacs.org/<wbr>Developer_Zone/Programming_<wbr>Guide/Patching_mdrun</a>.<br><br></div><div>There it tells to replace the function calc_f_el inĀ  gmx/src/mdlib/sim_util.c as follows- <br><pre>for(i=start; (i&lt;start+homenr); i++) {
  if (x[i][ZZ] &lt; box[ZZ][ZZ]/2) {
   Ext[ZZ] = FIELDFAC*Ex[ZZ].a[0]*2*x[i][<wbr>ZZ]/box[ZZ][ZZ];
  }
  else {
   Ext[ZZ] = FIELDFAC*Ex[ZZ].a[0]*(1- 2*x[i][ZZ]/box[ZZ][ZZ]);
  }
  f[i][ZZ] += charge[i]*Ext[ZZ];
} </pre>in order to add an external electric field along Z variable of the box. <br><br></div><div>My questions are-<br></div><div>1. What are the variables <b>&quot;start&quot; </b>and <b>&quot;homenr&quot; </b>mean ? I can understand that they are choosen based on the residues, but not sure how they are read/connected to my pdb file?<br></div><div>2. In order to add force by the external field to selected atoms, is there any way to select atoms from the simulation system ( may be from the index.ndx file ) which can be included here ?<br><br></div>Thank you in advance.<br></div>