3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
9 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11 * Copyright (c) 2001-2009, The GROMACS development team,
12 * check out http://www.gromacs.org for more information.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * If you want to redistribute modifications, please consider that
20 * scientific software is very special. Version control is crucial -
21 * bugs must be traceable. We will be happy to consider code for
22 * inclusion in the official distribution, but derived work must not
23 * be called official GROMACS. Details are found in the README & COPYING
24 * files - if they are missing, get the official version at www.gromacs.org.
26 * To help us fund GROMACS development, we humbly ask that you cite
27 * the papers on the package - you can find them in the top README file.
29 * For more info, check our website at http://www.gromacs.org
33 * Declares gmx::AnalysisDataDisplacementModule.
35 * \author Teemu Murtola <teemu.murtola@cbr.su.se>
37 * \ingroup module_analysisdata
39 #ifndef GMX_ANALYSISDATA_MODULES_DISPLACEMENT_H
40 #define GMX_ANALYSISDATA_MODULES_DISPLACEMENT_H
42 #include "../abstractdata.h"
43 #include "../datamodule.h"
48 class AnalysisDataBinAverageModule;
51 * Data module for calculating displacements.
53 * Output data contains a frame for each frame in the input data except the
54 * first one. For each frame, there can be multiple points, each of which
55 * describes displacement for a certain time difference ending that that frame.
56 * The first column contains the time difference (backwards from the current
57 * frame), and the remaining columns the sizes of the displacements.
59 * Current implementation is not very generic, but should be easy to extend.
62 * \ingroup module_analysisdata
64 class AnalysisDataDisplacementModule : public AbstractAnalysisData,
65 public AnalysisDataModuleInterface
68 AnalysisDataDisplacementModule();
69 virtual ~AnalysisDataDisplacementModule();
72 * Sets the largest displacement time to be calculated.
74 void setMaxTime(real tmax);
76 * Sets an histogram module that will receive a MSD histogram.
78 * If this function is not called, no histogram is calculated.
80 void setMSDHistogram(boost::shared_ptr<AnalysisDataBinAverageModule> histm);
82 virtual int flags() const;
84 virtual void dataStarted(AbstractAnalysisData *data);
85 virtual void frameStarted(const AnalysisDataFrameHeader &header);
86 virtual void pointsAdded(const AnalysisDataPointSetRef &points);
87 virtual void frameFinished(const AnalysisDataFrameHeader &header);
88 virtual void dataFinished();
91 virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
92 virtual bool requestStorageInternal(int nframes);
96 PrivateImplPointer<Impl> _impl;
99 //! Smart pointer to manage an AnalysisDataDisplacementModule object.
100 typedef boost::shared_ptr<AnalysisDataDisplacementModule>
101 AnalysisDataDisplacementModulePointer;