Gromacs  2025-dev-20240913-b871546
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Attributes
gmx::BiasGrid Class Reference

#include <gromacs/applied_forces/awh/biasgrid.h>

Description

The grid for a single bias, generally multidimensional and periodic.

The grid discretizes a multidimensional space with some given resolution. Each dimension is represented by an axis which sets the spatial extent, point spacing and periodicity of the grid in that direction.

Public Member Functions

 BiasGrid (ArrayRef< const DimParams > dimParams, ArrayRef< const AwhDimParams > awhDimParams)
 Construct a grid using AWH input parameters. More...
 
size_t numPoints () const
 Returns the number of points in the grid. More...
 
const GridPointpoint (size_t pointIndex) const
 Returns a reference to a point on the grid. More...
 
int numDimensions () const
 Returns the dimensionality of the grid. More...
 
ArrayRef< const GridAxisaxis () const
 Returns the grid axes. More...
 
const GridAxisaxis (int dim) const
 Returns a grid axis. More...
 
int nearestIndex (const awh_dvec value) const
 Find the grid point with value nearest to the given value. More...
 
bool covers (const awh_dvec value) const
 Query if the value is in the grid. More...
 
bool hasLambdaAxis () const
 Returns true if the grid has a free energy lambda state axis at all.
 
std::optional< int > lambdaAxisIndex () const
 Returns the index of a free energy lambda state axis (there can be no more than one) if there is one.
 
int numFepLambdaStates () const
 Returns the number of free energy lambda states in the grid (the number of points along a free energy lambda state axis) or 0 if there are no free energy lambda state axes.
 

Static Public Attributes

static constexpr double c_numPointsPerSigma = 1.0
 The point density per sigma of the Gaussian distribution in an umbrella. More...
 
static constexpr double c_scopeCutoff = 5.5
 Cut-off in sigma for considering points, neglects 4e-8 of the density.
 

Constructor & Destructor Documentation

gmx::BiasGrid::BiasGrid ( ArrayRef< const DimParams dimParams,
ArrayRef< const AwhDimParams >  awhDimParams 
)

Construct a grid using AWH input parameters.

Parameters
[in]dimParamsDimension parameters including the expected inverse variance of the coordinate living on the grid (determines the grid spacing).
[in]awhDimParamsDimension params from inputrec.

Member Function Documentation

ArrayRef<const GridAxis> gmx::BiasGrid::axis ( ) const
inline

Returns the grid axes.

Returns
a constant reference to the grid axes.
const GridAxis& gmx::BiasGrid::axis ( int  dim) const
inline

Returns a grid axis.

param[in] dim Dimension to return the grid axis for.

Returns
a constant reference to the grid axis.
bool gmx::BiasGrid::covers ( const awh_dvec  value) const

Query if the value is in the grid.

Parameters
[in]valueValue vector.
Returns
true if the value is in the grid.
Note
It is assumed that any periodicity of value has already been taken care of.
int gmx::BiasGrid::nearestIndex ( const awh_dvec  value) const

Find the grid point with value nearest to the given value.

Parameters
[in]valueValue vector.
Returns
the grid point index.
int gmx::BiasGrid::numDimensions ( ) const
inline

Returns the dimensionality of the grid.

Returns
the dimensionality of the grid.
size_t gmx::BiasGrid::numPoints ( ) const
inline

Returns the number of points in the grid.

Returns
the number of points in the grid.
const GridPoint& gmx::BiasGrid::point ( size_t  pointIndex) const
inline

Returns a reference to a point on the grid.

Returns
a constant reference to a point on the grid.

Member Data Documentation

constexpr double gmx::BiasGrid::c_numPointsPerSigma = 1.0
static

The point density per sigma of the Gaussian distribution in an umbrella.

This value should be at least 1 to uniformly cover the reaction coordinate range with density and having it larger than 1 does not add information.


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