[gmx-developers] Re: Editing the GROMACS energy function
francesco.oteri at gmail.com
Fri Aug 31 14:38:54 CEST 2012
I am doing on hacking gromacs and, since gromacs code is very complicated,
in my opinion it is better avoiding to touch so deeply the code.
You can do simply writing your own function and executing it after (or
before, it depends by the details of your modification)
do_force (in md.c) simply modifying the f vector and printing the output
after print_ebin (the function that actually prints results).
Of course this approach is right just if your modification can be developed
as an independent module.
Regarding coordinates, because of domain decomposition, each node can
access only to local atom data.
To obtain the local index starting from the global index, you need to
execute the following code (tested on gromacs 4.5.5):
cell_id = cr->dd->ga2la->laa[global_index].cell;
local_index = cr->dd->ga2la->laa[global_index].la;
if(cell_id == 0)
//atom global_index is on this node
//atom global_index is NOT on this node
you can get the atom_count (total number of atoms) in md.c using:
I hope I've helped you :)
2012/8/31 alex.bjorling <alex.bjorling at gmail.com>
> I'm now in the exact same position as Radhakrishna describes here. After
> posting the following, I did some more research and now have ways to get
> both energy and force from a complicated operation over all coordinates.
> Has anyone been successful in making these modifications?
> View this message in context:
> Sent from the GROMACS Developers Forum mailing list archive at Nabble.com.
> gmx-developers mailing list
> gmx-developers at gromacs.org
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.
Cordiali saluti, Dr.Oteri Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gromacs.org_gmx-developers