[gmx-developers] How to get the globle atoms coordinates in local node?

Yorquant Wang wangykoo at gmail.com
Tue Mar 26 17:04:16 CET 2013


Hi Mark:
    Really thank you for giving help and suggestion!
    I want to using umbrella sampling to calculate PMF using a
self-designed Reaction coodinates(RC).
RC is defined as:
There is a serials of lipids in my simulation box. I choose two atoms in
each lipid molecules as head atom and tail atom.
RC=SUM (A(head atom of lipid i)*B(tail atom of lipid i))
A is function of the head atom of a lipid molecule
B is function of the tail atom of a lipid molecule
RC equals sum of all A*B for all lipid molecules in the simulation box.

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() .

cal_RC(..., t_commrec  *cr,t_mdatoms *md, t_pbc   *pbc, rvec  x[],....)
{
int i=0,ii=0;
for(i=0;i<((pull->grp[1]).nat_loc); i++)
{
 ii = (pull->grp[1]).ind_loc[i];
A[i]= functionA(x[ii]) ;
//      I want to use this local index ii to get its global index ,
//      If I have each head atoms' global index, could I derive the
corresponding tail atoms' global index by molecular top information? If it
could, then I // want to use those corresponding tail atoms' global index
to get their coodinates in local nodes. so I can calulate the RC I need.
.
.
.
}

apply_force()
}

Could you give me some suggestion? Thank you very much!

Best wishes





2013/3/26 Mark Abraham <mark.j.abraham at gmail.com>

>
>
> On Tue, Mar 26, 2013 at 3:03 PM, Yorquant Wang <wangykoo at gmail.com> wrote:
>
>> Hi all:
>>     I want to implement a simple function into GMX4.5. I need to get the
>> atoms' coordinates which is not on this nodes, but I know those atoms
>> globle index. Just like the below situation.
>> ------------------------------
>>
>> int cell_id=cr->dd->ga2la[global_index].cell;
>> int local_index=cr->dd->ga2la[global_index].a;
>> if(0==cell_id)
>> {
>>  rvec* atom_position=&local_state->x[local_index];
>> }
>> else
>> {
>>  *// atom is NOT on this node*
>>  // if atom is on a neighbor node then its position can be acquired using special communication
>>
>> }
>>
>> ------------------------------
>>
>>
>>   What's the special communication? Could you give me a help to tell me
>> which function in GMX  can do this special communication ?
>>
>
> It lives in src/mdlib/domdec_con.c and uses the string "specat" in its
> names. It'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?
>
> If you're able to give some more information about what you're trying to
> achieve, we might be able to suggest a better solution.
>
> Mark
>
> --
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.
>



-- 
Yukun Wang
PhD candidate
Institute of Natural Sciences && College of Life Science, Shanghai Jiao
Tong University
Cell phone: 13621806236.
China Shanghai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20130327/259419ff/attachment.html>


More information about the gromacs.org_gmx-developers mailing list