[gmx-developers] How to obtain the element of an atom?

Morozov, Dmitry dmitry.morozov at jyu.fi
Thu Feb 11 16:29:12 CET 2021


Hi Lorién

One the possible solutions (there are atomic numbers stored in the gmx_mtop_t):


    std::vector<int> atomNumbers

    AtomIterator atoms(*mtop);
    while (atoms->globalAtomNumber() < mtop->natoms)
    {
        atomNumbers.push_back(atoms->atom().atomnumber);
        atoms++;
    }

for that you need some functionality from "gromacs/topology/mtop_util.h"
And mtop here is a pointer to gmx_mtop_t structure


Best,
Dmitry


________________________________
From: gromacs.org_gmx-developers-bounces at maillist.sys.kth.se <gromacs.org_gmx-developers-bounces at maillist.sys.kth.se> on behalf of Lorién López Villellas <lorien.lopez at bsc.es>
Sent: Thursday, February 11, 2021 17:22
To: gmx-developers at gromacs.org <gmx-developers at gromacs.org>
Cc: Pablo Ibañez <imarin at unizar.es>; Miquel Moreto <miquel.moreto at bsc.es>; SANTIAGO MARCO SOLA <santiago.marco at bsc.es>; Jesús Alastruey <jalastru at unizar.es>; Kanduri Prashanth <pkanduri at cscs.ch>; gromacs.org_gmx-developers at maillist.sys.kth.se <gromacs.org_gmx-developers at maillist.sys.kth.se>; Keller Sebastian <keller at cscs.ch>; Holanda Rusu Victor <victor.holanda at cscs.ch>
Subject: Re: [gmx-developers] How to obtain the element of an atom?

Hi.

Why is the element number relevant for constraints? The element number is never used in MD calculations.

We have performed a heavy code optimization based on the structural patterns of the peptide chains. In order to apply this optimization, we need a very specific bond numbering. To get to this bond numbering, we use a bond reordering phase. The reordering algorithm needs to know the elements of the molecule's atoms to locate itself.

Working with the legacy gromacs topology data structures, such as the iatoms (really just a vector of ints) and iparams can be quite challenging. Additionally, adding new code to constraints code is likely to face challenges based on the core gromacs team being hesitant to take on new maintenance burdens. However, depending on how much effort you have to spend on this, I might suggest that you could check out the nblib topology and force calculation API in gromacs 2021. Using this, it could be much easier to implement your new algorithm. Please have a look at the sample scripts in api/nblib/samples to get an idea of how, for instance, listed forces such as bonds are handled by nblib. If this looks promising, perhaps we can have a chat about potential integration pathways.

This project has been running for some years now (since 2013), so we started working with the old C-GROMACS data structures. So far, we have used a custom benchmark, but now we want to evaluate our algorithm's performance in a real environment. I will take a look at nblib.

Regards,
Lorién

El jue, 11 feb 2021 a las 15:52, Joe Jordan (<e.jjordan12 at gmail.com<mailto:e.jjordan12 at gmail.com>>) escribió:
Hi Lorién,

Working with the legacy gromacs topology data structures, such as the iatoms (really just a vector of ints) and iparams can be quite challenging. Additionally, adding new code to constraints code is likely to face challenges based on the core gromacs team being hesitant to take on new maintenance burdens. However, depending on how much effort you have to spend on this, I might suggest that you could check out the nblib topology and force calculation API in gromacs 2021. Using this, it could be much easier to implement your new algorithm. Please have a look at the sample scripts in api/nblib/samples to get an idea of how, for instance, listed forces such as bonds are handled by nblib. If this looks promising, perhaps we can have a chat about potential integration pathways.

Joe

On Thu, Feb 11, 2021 at 3:30 PM Lorién López Villellas <lorien.lopez at bsc.es<mailto:lorien.lopez at bsc.es>> wrote:
Hi all.

We are working on a new parallel algorithm for imposing constraints based on SHAKE. We are currently trying to integrate it into GROMACS.

We use the iatoms array (topology of triplets of constraint type, and indices of the two atoms that compose a bond) just like SHAKE. We need a way to obtain the element (Carbon, Nitrogen, Hidrogen...) of each of the atom indexes in iatoms. As far as we have researched, there is no way to access that data from src/gromacs/mdlib/constr. Where is that information stored?

If there is no way to obtain an atom element, we could also adapt our code to work with similar information if it exists.

We really appreciate any help you can provide.
--
Gromacs Developers mailing list

* Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org<mailto:gmx-developers-request at gromacs.org>.
--
Gromacs Developers mailing list

* Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org<mailto:gmx-developers-request at gromacs.org>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20210211/248db2f0/attachment-0003.html>


More information about the gromacs.org_gmx-developers mailing list