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

#include <gromacs/awh/histogramsize.h>

Description

Tracks global size related properties of the bias histogram.

Tracks the number of updates and the histogram size. Also keep track of the stage (initial/final of the AWH method and printing warnings about covering.

Note
Histogram sizes are floating-point values, since the histogram uses weighted entries and we can assign a floating-point scaling factor when changing it.

Public Member Functions

 HistogramSize (const AwhBiasParams &awhBiasParams, double histogramSizeInitial)
 Constructor. More...
 
double newHistogramSize (const BiasParams &params, double t, bool covered, const std::vector< PointState > &pointStates, ArrayRef< double > weightsumCovering, FILE *fplog)
 Return the new reference weight histogram size for the current update. More...
 
void restoreFromHistory (const AwhBiasStateHistory &stateHistory)
 Restores the histogram size from history. More...
 
void storeState (AwhBiasStateHistory *stateHistory) const
 Store the histogram size state in a history struct. More...
 
int numUpdates () const
 Returns the number of updates since the start of the simulation.
 
void incrementNumUpdates ()
 Increments the number of updates by 1.
 
double histogramSize () const
 Returns the histogram size.
 
void setHistogramSize (double histogramSize, double weightHistogramScalingFactor)
 Sets the histogram size. More...
 
bool inInitialStage () const
 Returns true if we are in the initial stage of the AWH method.
 
double logScaledSampleWeight () const
 Returns The log of the current sample weight, scaled because of the histogram rescaling.
 

Constructor & Destructor Documentation

gmx::HistogramSize::HistogramSize ( const AwhBiasParams &  awhBiasParams,
double  histogramSizeInitial 
)

Constructor.

Parameters
[in]awhBiasParamsThe Bias parameters from inputrec.
[in]histogramSizeInitialThe initial histogram size.

Member Function Documentation

double gmx::HistogramSize::newHistogramSize ( const BiasParams params,
double  t,
bool  covered,
const std::vector< PointState > &  pointStates,
ArrayRef< double >  weightsumCovering,
FILE *  fplog 
)

Return the new reference weight histogram size for the current update.

This function also takes care of checking for covering in the initial stage.

Parameters
[in]paramsThe bias parameters.
[in]tTime.
[in]coveredTrue if the sampling interval has been covered enough.
[in]pointStatesThe state of the grid points.
[in,out]weightsumCoveringThe weight sum for checking covering.
[in,out]fplogLog file.
Returns
the new histogram size.
void gmx::HistogramSize::restoreFromHistory ( const AwhBiasStateHistory &  stateHistory)

Restores the histogram size from history.

Parameters
[in]stateHistoryThe AWH bias state history.
void gmx::HistogramSize::setHistogramSize ( double  histogramSize,
double  weightHistogramScalingFactor 
)

Sets the histogram size.

Parameters
[in]histogramSizeThe new histogram size.
[in]weightHistogramScalingFactorThe factor to scale the weight by.
void gmx::HistogramSize::storeState ( AwhBiasStateHistory *  stateHistory) const

Store the histogram size state in a history struct.

Parameters
[in,out]stateHistoryThe AWH bias state history.

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