Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes
gmx::CorrelationGrid Class Reference

#include <gromacs/awh/correlationgrid.h>

Description

Grid of local correlation tensors.

This class provides the means for a bias to interaction with the grid of correlation tensors. The grid should have the same number of points and the same dimensionality as the bias grid.

Public Types

enum  BlockLengthMeasure { BlockLengthMeasure::Time, BlockLengthMeasure::Weight }
 Enum that sets how we measure block length. More...
 

Public Member Functions

 CorrelationGrid (int numPoints, int numDims, double blockLengthInit, BlockLengthMeasure blockLengthMeasure, double dtSample)
 Constructor. More...
 
void addData (int pointIndex, double weight, gmx::ArrayRef< const double > data, double t)
 Adds a weighted data vector to one point in the correlation grid. More...
 
void restoreStateFromHistory (const CorrelationGridHistory &correlationGridHistory)
 Restores the correlation grid state from the correlation grid history. More...
 
int tensorSize () const
 Returns the number of elements in the tensor: dim*(dim+1)/2.
 
int blockDataListSize () const
 Returns the size of the block data list.
 
const std::vector
< CorrelationTensor > & 
tensors () const
 Get a const reference to the correlation grid data.
 
double getBlockLength () const
 Get the current blocklength.
 
int getNumBlocks () const
 Get the current number of blocks. More...
 

Public Attributes

const double dtSample
 Time in between samples. More...
 
const BlockLengthMeasure blockLengthMeasure
 The measure for the block length. More...
 

Member Enumeration Documentation

Enum that sets how we measure block length.

Enumerator
Time 

Measure block length in time.

Weight 

Measure block length in sampled weight.

Constructor & Destructor Documentation

gmx::CorrelationGrid::CorrelationGrid ( int  numPoints,
int  numDims,
double  blockLengthInit,
BlockLengthMeasure  blockLengthMeasure,
double  dtSample 
)

Constructor.

Parameters
[in]numPointsNumber of points in the grid.
[in]numDimsNumber of dimensions of the grid.
[in]blockLengthInitInitial length of the blocks used for block averaging.
[in]blockLengthMeasureSets how we measure block length.
[in]dtSampleTime step for sampling correlations.

Member Function Documentation

void gmx::CorrelationGrid::addData ( int  pointIndex,
double  weight,
gmx::ArrayRef< const double >  data,
double  t 
)
inline

Adds a weighted data vector to one point in the correlation grid.

Parameters
[in]pointIndexIndex of the point to add data to.
[in]weightWeight to assign to the data.
[in]dataOne data point for each grid dimension.
[in]tThe time when the data was sampled.
int gmx::CorrelationGrid::getNumBlocks ( ) const

Get the current number of blocks.

If we have a finite block span we have a constant number of blocks, otherwise we are always adding more blocks (and we don't keep track of the number), so we return -1.

void gmx::CorrelationGrid::restoreStateFromHistory ( const CorrelationGridHistory &  correlationGridHistory)

Restores the correlation grid state from the correlation grid history.

The setup in the history should match that of this simulation. If this is not the case, an exception is thrown.

Parameters
[in]correlationGridHistoryThe correlation grid state history.

Member Data Documentation

const BlockLengthMeasure gmx::CorrelationGrid::blockLengthMeasure

The measure for the block length.

const double gmx::CorrelationGrid::dtSample

Time in between samples.


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