Gromacs  2024.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::analysismodules::Msd Class Reference
+ Inheritance diagram for gmx::analysismodules::Msd:
+ Collaboration diagram for gmx::analysismodules::Msd:

Description

Implements the gmx msd module.

Todo:

Implement -tensor for full MSD tensor calculation

Implement -rmcomm for total-frame COM removal

Implement -pdb for molecule B factors

Public Member Functions

void initOptions (IOptionsContainer *options, TrajectoryAnalysisSettings *settings) override
 Initializes options understood by the module. More...
 
void optionsFinished (TrajectoryAnalysisSettings *settings) override
 Called after all option values have been set. More...
 
void initAfterFirstFrame (const TrajectoryAnalysisSettings &settings, const t_trxframe &fr) override
 Performs additional initialization after reading the first frame. More...
 
void initAnalysis (const TrajectoryAnalysisSettings &settings, const TopologyInformation &top) override
 Initializes the analysis. More...
 
void analyzeFrame (int frameNumber, const t_trxframe &frame, t_pbc *pbc, TrajectoryAnalysisModuleData *pdata) override
 Analyzes a single frame. More...
 
void finishAnalysis (int nframes) override
 Postprocesses data after frames have been read. More...
 
void writeOutput () override
 Writes output into files and/or standard output/error. More...
 
- Public Member Functions inherited from gmx::TrajectoryAnalysisModule
virtual
TrajectoryAnalysisModuleDataPointer 
startFrames (const AnalysisDataParallelOptions &opt, const SelectionCollection &selections)
 Starts the analysis of frames. More...
 
virtual void finishFrames (TrajectoryAnalysisModuleData *pdata)
 Finishes the analysis of frames. More...
 
int datasetCount () const
 Returns the number of datasets provided by the module. More...
 
const std::vector< std::string > & datasetNames () const
 Returns a vector with the names of datasets provided by the module. More...
 
AbstractAnalysisDatadatasetFromIndex (int index) const
 Returns a pointer to the data set index. More...
 
AbstractAnalysisDatadatasetFromName (const char *name) const
 Returns a pointer to the data set with name name. More...
 
void finishFrameSerial (int frameIndex)
 Processes data in AnalysisData objects in serial for each frame. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gmx::TrajectoryAnalysisModule
 TrajectoryAnalysisModule ()
 Initializes the dataset registration mechanism. More...
 
void registerBasicDataset (AbstractAnalysisData *data, const char *name)
 Registers a dataset that exports data. More...
 
void registerAnalysisDataset (AnalysisData *data, const char *name)
 Registers a parallelized dataset that exports data. More...
 

Member Function Documentation

void gmx::analysismodules::Msd::analyzeFrame ( int  frnr,
const t_trxframe &  fr,
t_pbc pbc,
TrajectoryAnalysisModuleData pdata 
)
overridevirtual

Analyzes a single frame.

Parameters
[in]frnrFrame number, a zero-based index that uniquely identifies the frame.
[in]frCurrent frame.
[in]pbcPeriodic boundary conditions for fr.
[in,out]pdataData structure for frame-local data.

This method is called once for each frame to be analyzed, and should analyze the positions provided in the selections. Data handles and selections should be obtained from the pdata structure.

For threaded analysis, this method is called asynchronously in different threads to analyze different frames. The pdata structure is one of the structures created with startFrames(), but no assumptions should be made about which of these data structures is used. It is guaranteed that two instances of analyzeFrame() are not running concurrently with the same pdata data structure. Any access to data structures not stored in pdata should be designed to be thread-safe.

Implements gmx::TrajectoryAnalysisModule.

void gmx::analysismodules::Msd::finishAnalysis ( int  nframes)
overridevirtual

Postprocesses data after frames have been read.

Parameters
[in]nframesTotal number of frames processed.

This function is called after all finishFrames() calls have been called. nframes will equal the number of calls to analyzeFrame() that have occurred.

Implements gmx::TrajectoryAnalysisModule.

void gmx::analysismodules::Msd::initAfterFirstFrame ( const TrajectoryAnalysisSettings settings,
const t_trxframe &  fr 
)
overridevirtual

Performs additional initialization after reading the first frame.

When this function is called, selections are the same as in initAnalysis(), i.e., they have not been evaluated for the first frame.

It is necessary to override this method only if the module needs to do initialization for which it requires data from the first frame.

The default implementation does nothing.

Reimplemented from gmx::TrajectoryAnalysisModule.

void gmx::analysismodules::Msd::initAnalysis ( const TrajectoryAnalysisSettings settings,
const TopologyInformation top 
)
overridevirtual

Initializes the analysis.

Parameters
[in]settingsSettings to pass to and from the module.
[in]topTopology information.

When this function is called, selections have been initialized based on user input, and a topology has been loaded if provided by the user. For dynamic selections, the selections have been evaluated to the largest possible selection, i.e., the selections passed to analyzeFrame() are always a subset of the selections provided here.

Implements gmx::TrajectoryAnalysisModule.

void gmx::analysismodules::Msd::initOptions ( IOptionsContainer options,
TrajectoryAnalysisSettings settings 
)
overridevirtual

Initializes options understood by the module.

Parameters
[in,out]optionsOptions object to add the options to.
[in,out]settingsSettings to pass to and from the module.

This method is called first after the constructor, and it should add options understood by the module to options. Output values from options (including selections) should be stored in member variables.

In addition to initializing the options, this method can also provide information about the module's requirements using the settings object; see TrajectoryAnalysisSettings for more details.

If settings depend on the option values provided by the user, see optionsFinished().

Implements gmx::TrajectoryAnalysisModule.

void gmx::analysismodules::Msd::optionsFinished ( TrajectoryAnalysisSettings settings)
overridevirtual

Called after all option values have been set.

Parameters
[in,out]settingsSettings to pass to and from the module.

This method is called after option values have been assigned (but interactive selection input has not yet been performed).

If the module needs to change settings that affect topology loading (can be done using the settings object) or selection initialization (can be done using SelectionOptionInfo) based on option values, this method has to be overridden.

The default implementation does nothing.

Reimplemented from gmx::TrajectoryAnalysisModule.

void gmx::analysismodules::Msd::writeOutput ( )
overridevirtual

Writes output into files and/or standard output/error.

All output from the module, excluding data written out for each frame during analyzeFrame(), should be confined into this function. This function is guaranteed to be called only after finishAnalysis().

Implements gmx::TrajectoryAnalysisModule.


The documentation for this class was generated from the following file: