Hi Mark:<div>    Really thank you for giving help and suggestion!</div><div>    I want to using umbrella sampling to calculate PMF using a self-designed Reaction coodinates(RC).</div><div>RC is defined as: </div><div>There is a serials of lipids in my simulation box. I choose two atoms in each lipid molecules as head atom and tail atom.</div>

<div>RC=SUM (A(head atom of lipid i)*B(tail atom of lipid i))</div><div>A is function of the head atom of a lipid molecule</div><div>B is function of the tail atom of a lipid molecule</div><div>RC equals sum of all A*B for all lipid molecules in the simulation box.</div>

<div><br></div><div>My coding strategy is: I firstly defined a pull group including all the head atoms of lipids, then I introduing a function cal_RC() in pullutil.c file, and call it at the end of function pull_calc_coms() .</div>

<div><br></div><div>cal_RC(..., t_commrec  *cr,t_mdatoms *md, t_pbc   *pbc, rvec  x[],....)</div><div>{</div><div><div>int i=0,ii=0;</div><div>for(i=0;i&lt;((pull-&gt;grp[1]).nat_loc); i++) </div><div>{</div><div> ii = (pull-&gt;grp[1]).ind_loc[i]; </div>

</div><div>A[i]= functionA(x[ii]) ;</div><div>//      I want to use this local index ii to get its global index , </div><div>//      If I have each head atoms&#39; global index, could I derive the corresponding tail atoms&#39; global index by molecular top information? If it could, then I // want to use those corresponding tail atoms&#39; global index to get their coodinates in local nodes. so I can calulate the RC I need.</div>
<div>.</div><div>.</div><div>.</div><div>}</div><div><br></div><div>apply_force()</div><div>}</div><div><br></div><div>Could you give me some suggestion? Thank you very much!</div><div><br></div><div>Best wishes 
</div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">2013/3/26 Mark Abraham <span dir="ltr">&lt;<a href="mailto:mark.j.abraham@gmail.com" target="_blank">mark.j.abraham@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div>On Tue, Mar 26, 2013 at 3:03 PM, Yorquant Wang <span dir="ltr">&lt;<a href="mailto:wangykoo@gmail.com" target="_blank">wangykoo@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all:<div>    I want to implement a simple function into GMX4.5. I need to get the atoms&#39; coordinates which is not on this nodes, but I know those atoms globle index. Just like the below situation.</div><hr style="line-height:18px;color:rgb(79,107,114);font-size:12px;font-family:arial,verdana,helvetica">



<p style="line-height:18px;color:rgb(79,107,114);font-size:12px;font-family:arial,verdana,helvetica;margin:0.5em 0px;padding:0px"><code style="font-family:&#39;Lucida Console&#39;,Courier,monospace;font-size:14px;color:rgb(0,52,113)"></code></p>



<pre style="margin-top:0.5em;margin-bottom:0.5em;margin-left:1em;padding:0px 0px 0px 1em;border-left-width:4px;border-left-style:solid;border-left-color:rgb(170,170,170);background-color:rgb(254,254,254);overflow:visible;line-height:18px">
<span style="font-size:12px;color:rgb(119,119,119)">int cell_id=<a title="Developer_Zone/Programming_Guide/Data_Structures#t_commrec" style="color:rgb(51,102,204);text-decoration:none">cr</a>-&gt;<a title="Developer_Zone/Programming_Guide/Data_Structures#gmx_domdec_t" style="color:rgb(51,102,204);text-decoration:none">dd</a>-&gt;<a title="Developer_Zone/Programming_Guide/Data_Structures#gmx_ga2la_t" style="color:rgb(51,102,204);text-decoration:none">ga2la</a>[global_index].cell;
int local_index=<a title="Developer_Zone/Programming_Guide/Data_Structures#t_commrec" style="color:rgb(51,102,204);text-decoration:none">cr</a>-&gt;<a title="Developer_Zone/Programming_Guide/Data Structures#gmx_domdec_t" style="color:rgb(51,102,204);text-decoration:none">dd</a>-&gt;<a title="Developer_Zone/Programming_Guide/Data_Structures#gmx_ga2la_t" style="color:rgb(51,102,204);text-decoration:none">ga2la</a>[global_index].a;
if(0==cell_id)
{
 rvec* atom_position=&amp;<a title="Developer_Zone/Programming_Guide/Data_Structures#t_state" style="color:rgb(51,102,204);text-decoration:none">local_state</a>-&gt;<a title="Developer_Zone/Programming_Guide/Data_Structures#X" style="color:rgb(51,102,204);text-decoration:none">x</a>[local_index];
}
else
{
 <em>// atom is NOT on this node</em>
 // if atom is on a neighbor node then its position can be acquired using </span><font color="#ff0000" size="4">special communication </font></pre><div><span style="background-color:rgb(254,254,254);color:rgb(119,119,119);font-size:12px;line-height:18px">}</span></div>



<div><span style="background-color:rgb(254,254,254);color:rgb(119,119,119);font-size:12px;line-height:18px"><br></span></div><div><hr style="line-height:18px;color:rgb(79,107,114);font-size:12px;font-family:arial,verdana,helvetica">



<br></div><div><span style="background-color:rgb(254,254,254);color:rgb(119,119,119);font-size:12px;line-height:18px"><br></span></div><div>  What&#39;s the special communication? Could you give me a help to tell me which function in GMX  can do this <span style="background-color:rgb(254,254,254);line-height:18px"><font color="#ff0000">special communication</font></span><span style="color:rgb(255,0,0);font-size:large;background-color:rgb(254,254,254);line-height:18px"> </span>?</div>


</blockquote><div><br></div></div><div>It lives in src/mdlib/domdec_con.c and uses the string &quot;specat&quot; in its names. It&#39;s intended for managing information to support things like constraints and virtual sites across DD boundaries, and not as a general query mechanism. What is that code fragment you gave?</div>


<div><br></div><div>If you&#39;re able to give some more information about what you&#39;re trying to achieve, we might be able to suggest a better solution.</div><span><font color="#888888"><div><br></div>
<div>Mark</div></font></span></div>
<br>--<br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don&#39;t post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><span><font color="#888888">Yukun Wang <br>

PhD candidate<br><span style="text-align:center">Institute of Natural Sciences &amp;&amp; College of Life Science, Shanghai Jiao Tong University</span><br>Cell phone: 13621806236.<br>China Shanghai</font></span>
</div>