Gromacs  2024.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
biasstate.cpp File Reference
#include "gmxpre.h"
#include "biasstate.h"
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <optional>
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/math/units.h"
#include "gromacs/math/utilities.h"
#include "gromacs/mdrunutility/multisim.h"
#include "gromacs/mdtypes/awh_history.h"
#include "gromacs/mdtypes/awh_params.h"
#include "gromacs/mdtypes/commrec.h"
#include "gromacs/simd/simd.h"
#include "gromacs/simd/simd_math.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/stringutil.h"
#include "biasgrid.h"
#include "biassharing.h"
#include "correlationgrid.h"
#include "correlationtensor.h"
#include "dimparams.h"
#include "pointstate.h"
+ Include dependency graph for biasstate.cpp:


Implements the BiasState class.

Viveca Lindahl
Berk Hess


void gmx::anonymous_namespace{biasstate.cpp}::sumPmf (gmx::ArrayRef< PointState > pointState, int numSharedUpdate, const BiasSharing *biasSharing, const int biasIndex)
 Sum PMF over multiple simulations, when requested. More...
double gmx::anonymous_namespace{biasstate.cpp}::freeEnergyMinimumValue (gmx::ArrayRef< const PointState > pointState)
 Find the minimum free energy value. More...
double gmx::anonymous_namespace{biasstate.cpp}::biasedLogWeightFromPoint (ArrayRef< const DimParams > dimParams, ArrayRef< const PointState > points, const BiasGrid &grid, int pointIndex, double pointBias, const awh_dvec value, ArrayRef< const double > neighborLambdaEnergies, int gridpointIndex)
 Find and return the log of the probability weight of a point given a coordinate value. More...
std::vector< double > gmx::anonymous_namespace{biasstate.cpp}::calculateFELambdaMarginalDistribution (const BiasGrid &grid, ArrayRef< const int > neighbors, ArrayRef< const double > probWeightNeighbor)
 Calculates the marginal distribution (marginal probability) for each value along a free energy lambda axis. The marginal distribution of one coordinate dimension value is the sum of the probability distribution of all values (herein all neighbor values) with the same value in the dimension of interest. More...
std::string gmx::anonymous_namespace{biasstate.cpp}::gridPointValueString (const BiasGrid &grid, int point)
 Puts together a string describing a grid point. More...
void gmx::anonymous_namespace{biasstate.cpp}::setHistogramUpdateScaleFactors (const BiasParams &params, double newHistogramSize, double oldHistogramSize, double *weightHistScaling, double *logPmfSumScaling)
 Sets the histogram rescaling factors needed to control the histogram size. More...
void gmx::anonymous_namespace{biasstate.cpp}::mergeSharedUpdateLists (std::vector< int > *updateList, int numPoints, const BiasSharing &biasSharing, const int biasIndex)
 Merge update lists from multiple sharing simulations. More...
void gmx::anonymous_namespace{biasstate.cpp}::makeLocalUpdateList (const BiasGrid &grid, ArrayRef< const PointState > points, const awh_ivec originUpdatelist, const awh_ivec endUpdatelist, std::vector< int > *updateList)
 Generate an update list of points sampled since the last update. More...
void gmx::anonymous_namespace{biasstate.cpp}::sumHistograms (gmx::ArrayRef< PointState > pointState, gmx::ArrayRef< double > weightSumCovering, int numSharedUpdate, const BiasSharing *biasSharing, const int biasIndex, const std::vector< int > &localUpdateList)
 Add partial histograms (accumulating between updates) to accumulating histograms. More...
void gmx::anonymous_namespace{biasstate.cpp}::labelCoveredPoints (const std::vector< bool > &visited, const std::vector< bool > &checkCovering, int numPoints, int period, int coverRadius, gmx::ArrayRef< int > covered)
 Label points along an axis as covered or not. More...
static void gmx::normalizeFreeEnergyAndPmfSum (std::vector< PointState > *pointState)
 Normalizes the free energy and PMF sum. More...
static int gmx::countTrailingZeroRows (const MultiDimArray< std::vector< double >, dynamicExtents2D > &data, int numRows, int numColumns)
 Count trailing data rows containing only zeros. More...
static void gmx::readUserPmfAndTargetDistribution (ArrayRef< const DimParams > dimParams, const BiasGrid &grid, const std::string &filename, int numBias, int biasIndex, std::vector< PointState > *pointState)
 Initializes the PMF and target with data read from an input table. More...