[gmx-developers] How to get acces to t_atom data using new analysys framework

Teemu Murtola teemu.murtola at gmail.com
Tue Feb 5 20:01:11 CET 2013


Hi,

On Wed, Jan 30, 2013 at 6:09 AM, Alexey Shvetsov <alexxy at omrb.pnpi.spb.ru>
 wrote:

> What is the easyest way to get access to t_atom data from topology using
> new
> analysys framework?
>

Before you do that, you should consider whether you can achieve the same
thing with the use of selections. This is of course not always possible,
but if it is, it usually leads to a more flexible tool (in particular if
your tool would assume that each position in the selection is an atom).

On Thu, Jan 31, 2013 at 6:15 AM, Roland Schulz <roland at utk.edu> wrote:

> untested but should work:
>
> initAnalysis(const TrajectoryAnalysisSettings &, const TopologyInformation
> &top)  {
>  top->topology()->atoms;
> }
>

Yes, this is the approach to use. In addition, you will need to either
check for the presence of the topology (by checking the return value for
NULL, or by calling hasTopology()), or tell the framework that your tool
requires the topology (by calling
TrajectoryAnalysisSettings::setFlag(efRequireTop)) to avoid crashing when
the user does not provide a topology.

Best regards,
Teemu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20130205/71a5da94/attachment.html>


More information about the gromacs.org_gmx-developers mailing list