[gmx-users] Re: Re: The problems of controling one atom through modifygromacs

聂雪川 niexuechuan at 163.com
Fri Apr 23 12:49:31 CEST 2010


Hi Carsten,
   Thank you very much.
   I add some code like "if((cr->dd->ga2la[my_atom-1].cell==0)&&(n==cr->dd->ga2la[my_atom-1].a))".Then it perform very well.
                                                                                                  chuan


> Date: Thu, 22 Apr 2010 09:54:22 +0200
> From: Carsten Kutzner <ckutzne at gwdg.de>
> Subject: Re: [gmx-users] The problems of controling one atom through
> modifygromacs sourse code
> To: "Discussion list for GROMACS users" <gmx-users at gromacs.org>
> Message-ID: <26C546B1-17A7-4ABE-A731-EF30759D1320 at gwdg.de>
> Content-Type: text/plain; charset="gb2312"
> 
> Hi Chuan,
> 
> you might want to take a look at gmx_ga2la.h. The function
> ga2la_home provides the local atom number for a given global
> atom number (or returns FALSE if the atom is not found on the local
> processor).
> 
> Carsten
> 
> 
> On Apr 21, 2010, at 4:40 PM, ÄôÑ©´¨ wrote:
> 
>> Hi,gmx-users,
>>    Now I want to control the motion of a certain atom (due to special needs).So I added some codes like "if(n==my_atom)xprime[n][d]   = x[n][d]+...;"  in the functionstatic "void do_update_md()" of the file "gromacs-4.0.7\src\mdlib\update.c".But when mpi run,The gromacs performs a domain decomposition algorithm ,which assign  a certain amount of atoms to each CPU(The atoms called local atoms).But the serial number "n" of local atoms always start from 0.So the code "if(n==my_atom)" is futile.
>>    Now I come into consideration to differentiate "my_atom" by its name.But I am not sure about whether there exist the atom name at the the process of mdrun.Or Is there a more simple way to  achieve it.
>>  
>> {The functions be involved with domain decomposition algorithm are:
>>  
>>  
>> /src/mdlib/domdec.c(7458) void dd_partition_system()  (called by do_md())
>>  
>> /src/mdlib/domdec.c(3365) static void get_cg_distribution()
>>  
>> /src/mdlib/domdec_network.c(187)void dd_scatter()
>>  
>> }
>>                                                               Thank your.
>>                                                                   chuan
>> -- 


More information about the gromacs.org_gmx-users mailing list