Gromacs
2021.6
|
Functions | |
void | sumOverSimulations (gmx::ArrayRef< int > arrayRef, const gmx_multisim_t *multiSimComm) |
Sum an array over all simulations on the master rank of each simulation. More... | |
void | sumOverSimulations (gmx::ArrayRef< double > arrayRef, const gmx_multisim_t *multiSimComm) |
Sum an array over all simulations on the master rank of each simulation. More... | |
template<typename T > | |
void | sumOverSimulations (gmx::ArrayRef< T > arrayRef, const t_commrec *commRecord, const gmx_multisim_t *multiSimComm) |
Sum an array over all simulations on all ranks of each simulation. More... | |
void | sumPmf (gmx::ArrayRef< PointState > pointState, int numSharedUpdate, const t_commrec *commRecord, const gmx_multisim_t *multiSimComm) |
Sum PMF over multiple simulations, when requested. More... | |
double | freeEnergyMinimumValue (gmx::ArrayRef< const PointState > pointState) |
Find the minimum free energy value. More... | |
double | biasedLogWeightFromPoint (const std::vector< DimParams > &dimParams, const std::vector< PointState > &points, const BiasGrid &grid, int pointIndex, double pointBias, const awh_dvec value, gmx::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 > | calculateFELambdaMarginalDistribution (const BiasGrid &grid, gmx::ArrayRef< const int > neighbors, gmx::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... | |
void | updateTargetDistribution (gmx::ArrayRef< PointState > pointState, const BiasParams ¶ms) |
Updates the target distribution for all points. More... | |
std::string | gridPointValueString (const BiasGrid &grid, int point) |
Puts together a string describing a grid point. More... | |
void | setHistogramUpdateScaleFactors (const BiasParams ¶ms, double newHistogramSize, double oldHistogramSize, double *weightHistScaling, double *logPmfSumScaling) |
Sets the histogram rescaling factors needed to control the histogram size. More... | |
void | mergeSharedUpdateLists (std::vector< int > *updateList, int numPoints, const t_commrec *commRecord, const gmx_multisim_t *multiSimComm) |
Merge update lists from multiple sharing simulations. More... | |
void | makeLocalUpdateList (const BiasGrid &grid, const std::vector< 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 | sumHistograms (gmx::ArrayRef< PointState > pointState, gmx::ArrayRef< double > weightSumCovering, int numSharedUpdate, const t_commrec *commRecord, const gmx_multisim_t *multiSimComm, const std::vector< int > &localUpdateList) |
Add partial histograms (accumulating between updates) to accumulating histograms. More... | |
void | 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... | |
double gmx::anonymous_namespace{biasstate.cpp}::biasedLogWeightFromPoint | ( | const std::vector< DimParams > & | dimParams, |
const std::vector< PointState > & | points, | ||
const BiasGrid & | grid, | ||
int | pointIndex, | ||
double | pointBias, | ||
const awh_dvec | value, | ||
gmx::ArrayRef< const double > | neighborLambdaEnergies, | ||
int | gridpointIndex | ||
) |
Find and return the log of the probability weight of a point given a coordinate value.
The unnormalized weight is given by w(point|value) = exp(bias(point) - U(value,point)), where U is a harmonic umbrella potential.
[in] | dimParams | The bias dimensions parameters |
[in] | points | The point state. |
[in] | grid | The grid. |
[in] | pointIndex | Point to evaluate probability weight for. |
[in] | pointBias | Bias for the point (as a log weight). |
[in] | value | Coordinate value. |
[in] | neighborLambdaEnergies | The energy of the system in neighboring lambdas states. Can be empty when there are no free energy lambda state dimensions. |
[in] | gridpointIndex | The index of the current grid point. |
std::vector<double> gmx::anonymous_namespace{biasstate.cpp}::calculateFELambdaMarginalDistribution | ( | const BiasGrid & | grid, |
gmx::ArrayRef< const int > | neighbors, | ||
gmx::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.
[in] | grid | The bias grid. |
[in] | neighbors | The points to use for the calculation of the marginal distribution. |
[in] | probWeightNeighbor | Probability weights of the neighbors. |
double gmx::anonymous_namespace{biasstate.cpp}::freeEnergyMinimumValue | ( | gmx::ArrayRef< const PointState > | pointState | ) |
Find the minimum free energy value.
[in] | pointState | The state of the points. |
std::string gmx::anonymous_namespace{biasstate.cpp}::gridPointValueString | ( | const BiasGrid & | grid, |
int | point | ||
) |
Puts together a string describing a grid point.
[in] | grid | The grid. |
[in] | point | BiasGrid point index. |
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.
A point is covered if it is surrounded by visited points up to a radius = coverRadius.
[in] | visited | Visited? For each point. |
[in] | checkCovering | Check for covering? For each point. |
[in] | numPoints | The number of grid points along this dimension. |
[in] | period | Period in number of points. |
[in] | coverRadius | Cover radius, in points, needed for defining a point as covered. |
[in,out] | covered | In this array elements are 1 for covered points and 0 for non-covered points, this routine assumes that covered has at least size numPoints . |
void gmx::anonymous_namespace{biasstate.cpp}::makeLocalUpdateList | ( | const BiasGrid & | grid, |
const std::vector< 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.
[in] | grid | The AWH bias. |
[in] | points | The point state. |
[in] | originUpdatelist | The origin of the rectangular region that has been sampled since last update. |
[in] | endUpdatelist | The end of the rectangular that has been sampled since last update. |
[in,out] | updateList | Local update list to set (assumed >= npoints long). |
void gmx::anonymous_namespace{biasstate.cpp}::mergeSharedUpdateLists | ( | std::vector< int > * | updateList, |
int | numPoints, | ||
const t_commrec * | commRecord, | ||
const gmx_multisim_t * | multiSimComm | ||
) |
Merge update lists from multiple sharing simulations.
[in,out] | updateList | Update list for this simulation (assumed >= npoints long). |
[in] | numPoints | Total number of points. |
[in] | commRecord | Struct for intra-simulation communication. |
[in] | multiSimComm | Struct for multi-simulation communication. |
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.
For sake of robustness, the reference weight histogram can grow at a rate different from the actual sampling rate. Typically this happens for a limited initial time, alternatively growth is scaled down by a constant factor for all times. Since the size of the reference histogram sets the size of the free energy update this should be reflected also in the PMF. Thus the PMF histogram needs to be rescaled too.
This function should only be called by the bias update function or wrapped by a function that knows what scale factors should be applied when, e.g, getSkippedUpdateHistogramScaleFactors().
[in] | params | The bias parameters. |
[in] | newHistogramSize | New reference weight histogram size. |
[in] | oldHistogramSize | Previous reference weight histogram size (before adding new samples). |
[out] | weightHistScaling | Scaling factor for the reference weight histogram. |
[out] | logPmfSumScaling | Log of the scaling factor for the PMF histogram. |
void gmx::anonymous_namespace{biasstate.cpp}::sumHistograms | ( | gmx::ArrayRef< PointState > | pointState, |
gmx::ArrayRef< double > | weightSumCovering, | ||
int | numSharedUpdate, | ||
const t_commrec * | commRecord, | ||
const gmx_multisim_t * | multiSimComm, | ||
const std::vector< int > & | localUpdateList | ||
) |
Add partial histograms (accumulating between updates) to accumulating histograms.
[in,out] | pointState | The state of the points in the bias. |
[in,out] | weightSumCovering | The weights for checking covering. |
[in] | numSharedUpdate | The number of biases sharing the histrogram. |
[in] | commRecord | Struct for intra-simulation communication. |
[in] | multiSimComm | Struct for multi-simulation communication. |
[in] | localUpdateList | List of points with data. |
void gmx::anonymous_namespace{biasstate.cpp}::sumOverSimulations | ( | gmx::ArrayRef< int > | arrayRef, |
const gmx_multisim_t * | multiSimComm | ||
) |
Sum an array over all simulations on the master rank of each simulation.
[in,out] | arrayRef | The data to sum. |
[in] | multiSimComm | Struct for multi-simulation communication. |
void gmx::anonymous_namespace{biasstate.cpp}::sumOverSimulations | ( | gmx::ArrayRef< double > | arrayRef, |
const gmx_multisim_t * | multiSimComm | ||
) |
Sum an array over all simulations on the master rank of each simulation.
[in,out] | arrayRef | The data to sum. |
[in] | multiSimComm | Struct for multi-simulation communication. |
void gmx::anonymous_namespace{biasstate.cpp}::sumOverSimulations | ( | gmx::ArrayRef< T > | arrayRef, |
const t_commrec * | commRecord, | ||
const gmx_multisim_t * | multiSimComm | ||
) |
Sum an array over all simulations on all ranks of each simulation.
This assumes the data is identical on all ranks within each simulation.
[in,out] | arrayRef | The data to sum. |
[in] | commRecord | Struct for intra-simulation communication. |
[in] | multiSimComm | Struct for multi-simulation communication. |
void gmx::anonymous_namespace{biasstate.cpp}::sumPmf | ( | gmx::ArrayRef< PointState > | pointState, |
int | numSharedUpdate, | ||
const t_commrec * | commRecord, | ||
const gmx_multisim_t * | multiSimComm | ||
) |
Sum PMF over multiple simulations, when requested.
[in,out] | pointState | The state of the points in the bias. |
[in] | numSharedUpdate | The number of biases sharing the histogram. |
[in] | commRecord | Struct for intra-simulation communication. |
[in] | multiSimComm | Struct for multi-simulation communication. |
void gmx::anonymous_namespace{biasstate.cpp}::updateTargetDistribution | ( | gmx::ArrayRef< PointState > | pointState, |
const BiasParams & | params | ||
) |
Updates the target distribution for all points.
The target distribution is always updated for all points at the same time.
[in,out] | pointState | The state of all points. |
[in] | params | The bias parameters. |