#include <string>
#include <vector>
using namespace gmx;
{
public:
virtual void analyzeFrame(
int frnr,
const t_trxframe &fr,
t_pbc *pbc,
virtual void finishAnalysis(int nframes);
virtual void writeOutput();
private:
class ModuleData;
std::string fnDist_;
double cutoff_;
};
AnalysisTemplate::AnalysisTemplate()
: cutoff_(0.0)
{
registerAnalysisDataset(&data_, "avedist");
}
void
{
static const char *const desc[] = {
"This is a template for writing your own analysis tools for",
"GROMACS. The advantage of using GROMACS for this is that you",
"have access to all information in the topology, and your",
"program will be able to handle all types of coordinates and",
"trajectory files supported by GROMACS. In addition,",
"you get a lot of functionality for free from the trajectory",
"analysis library, including support for flexible dynamic",
"selections. Go ahead an try it![PAR]",
"To get started with implementing your own analysis program,",
"follow the instructions in the README file provided.",
"This template implements a simple analysis programs that calculates",
"average distances from a reference group to one or more",
"analysis groups."
};
.filetype(eftPlot).outputFile()
.
store(&fnDist_).defaultBasename(
"avedist")
.description("Average distances from reference group"));
.
store(&refsel_).required()
.description("Reference group to calculate distances from"));
.storeVector(&sel_).required().multiValue()
.description("Groups to calculate distances to"));
.description("Cutoff for distance calculation (0 = no cutoff)"));
settings->
setFlag(TrajectoryAnalysisSettings::efRequireTop);
}
void
{
if (!fnDist_.empty())
{
plotm->setFileName(fnDist_);
plotm->setTitle("Average distance");
plotm->setXAxisIsTime();
plotm->setYLabel("Distance (nm)");
}
}
void
{
for (size_t g = 0; g < sel_.size(); ++g)
{
for (int i = 0; i < nr; ++i)
{
}
frave /= nr;
}
}
void
{
}
void
{
for (size_t g = 0; g < sel_.size(); ++g)
{
fprintf(stderr, "Average mean distance for '%s': %.3f nm\n",
sel_[g].name(), avem_->average(0, g));
}
}
int
main(
int argc,
char *argv[])
{
return gmx::TrajectoryAnalysisCommandLineRunner::runAsMain<AnalysisTemplate>(argc, argv);
}