Gromacs
2024.3
|
#include <gromacs/applied_forces/awh/correlationgrid.h>
BiasGrid 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... | |
|
strong |
gmx::CorrelationGrid::CorrelationGrid | ( | int | numPoints, |
int | numDims, | ||
double | blockLengthInit, | ||
BlockLengthMeasure | blockLengthMeasure, | ||
double | dtSample | ||
) |
Constructor.
[in] | numPoints | Number of points in the grid. |
[in] | numDims | Number of dimensions of the grid. |
[in] | blockLengthInit | Initial length of the blocks used for block averaging. |
[in] | blockLengthMeasure | Sets how we measure block length. |
[in] | dtSample | Time step for sampling correlations. |
|
inline |
Adds a weighted data vector to one point in the correlation grid.
[in] | pointIndex | Index of the point to add data to. |
[in] | weight | Weight to assign to the data. |
[in] | data | One data point for each grid dimension. |
[in] | t | The 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.
[in] | correlationGridHistory | The correlation grid state history. |
const BlockLengthMeasure gmx::CorrelationGrid::blockLengthMeasure_ |
The measure for the block length.
const double gmx::CorrelationGrid::dtSample_ |
Time in between samples.