Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
#include "gmxpre.h"
#include "biasgrid.h"
#include <cassert>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <optional>
#include "gromacs/math/functions.h"
#include "gromacs/math/utilities.h"
#include "gromacs/mdtypes/awh_params.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/stringutil.h"
+ Include dependency graph for biasgrid.cpp:

Description

Implements functions in grid.h.

Author
Viveca Lindahl
Berk Hess hess@.nosp@m.kth..nosp@m.se

Functions

double gmx::anonymous_namespace{biasgrid.cpp}::centerPeriodicValueAroundZero (const double x, double period)
 Return x so that it is periodic in [-period/2, +period/2). More...
 
int gmx::anonymous_namespace{biasgrid.cpp}::indexWithinPeriod (int x, int period)
 If period>0, return x so that it is periodic in [0, period), else return x. More...
 
double gmx::anonymous_namespace{biasgrid.cpp}::getIntervalLengthPeriodic (double origin, double end, double period)
 Get the length of the interval (origin, end). More...
 
double gmx::anonymous_namespace{biasgrid.cpp}::getDeviationPeriodic (double x, double x0, double period)
 Get the deviation x - x0. More...
 
double gmx::getDeviationFromPointAlongGridAxis (const BiasGrid &grid, int dimIndex, int pointIndex, double value)
 Get the deviation along one dimension from the given value to a point in the grid. More...
 
double gmx::getDeviationFromPointAlongGridAxis (const BiasGrid &grid, int dimIndex, int pointIndex1, int pointIndex2)
 Get the deviation from one point to another along one dimension in the grid. More...
 
bool gmx::pointsAlongLambdaAxis (const BiasGrid &grid, int pointIndex1, int pointIndex2)
 Checks whether two points are along a free energy lambda state axis. More...
 
bool gmx::pointsHaveDifferentLambda (const BiasGrid &grid, int pointIndex1, int pointIndex2)
 Checks whether two points are different in the free energy lambda state dimension (if any). More...
 
void gmx::linearArrayIndexToMultiDim (int indexLinear, int ndim, const awh_ivec numPointsDim, awh_ivec indexMulti)
 Convert a linear array index to a multidimensional one. More...
 
void gmx::linearGridindexToMultiDim (const BiasGrid &grid, int indexLinear, awh_ivec indexMulti)
 Convert a linear grid point index to a multidimensional one. More...
 
int gmx::multiDimArrayIndexToLinear (const awh_ivec indexMulti, int numDim, const awh_ivec numPointsDim)
 Convert multidimensional array index to a linear one. More...
 
int gmx::anonymous_namespace{biasgrid.cpp}::multiDimGridIndexToLinear (ArrayRef< const GridAxis > axis, const awh_ivec indexMulti)
 Convert a multidimensional grid point index to a linear one. More...
 
int gmx::multiDimGridIndexToLinear (const BiasGrid &grid, const awh_ivec indexMulti)
 Convert a multidimensional grid point index to a linear one. More...
 
bool gmx::anonymous_namespace{biasgrid.cpp}::stepInMultiDimArray (int numDim, const awh_ivec numPoints, awh_ivec indexDim)
 Take a step in a multidimensional array. More...
 
void gmx::anonymous_namespace{biasgrid.cpp}::gridToSubgridIndex (const BiasGrid &grid, const awh_ivec subgridOrigin, const awh_ivec subgridNpoints, int point, awh_ivec subgridIndex)
 Transforms a grid point index to to the multidimensional index of a subgrid. More...
 
bool gmx::anonymous_namespace{biasgrid.cpp}::subgridToGridIndex (const BiasGrid &grid, const awh_ivec subgridOrigin, const awh_ivec subgridIndex, int *gridIndex)
 Transform a multidimensional subgrid index to a grid point index. More...
 
bool gmx::advancePointInSubgrid (const BiasGrid &grid, const awh_ivec subgridOrigin, const awh_ivec subgridNpoints, int *gridPointIndex)
 Find the next grid point in the sub-part of the grid given a starting point. More...
 
static int gmx::pointDistanceAlongAxis (const GridAxis &axis, double x, double x0)
 Returns the point distance between from value x to value x0 along the given axis. More...
 
static bool gmx::valueIsInGrid (const awh_dvec value, ArrayRef< const GridAxis > axis)
 Query if a value is in range of the grid. More...
 
static int gmx::getNearestIndexInGrid (const awh_dvec value, ArrayRef< const GridAxis > axis)
 Map a value to the nearest point in the grid. More...
 
void gmx::anonymous_namespace{biasgrid.cpp}::setNeighborsOfGridPoint (int pointIndex, const BiasGrid &grid, std::vector< int > *neighborIndexArray)
 Find and set the neighbors of a grid point. More...
 
void gmx::mapGridToDataGrid (std::vector< int > *gridpointToDatapoint, const MultiDimArray< std::vector< double >, dynamicExtents2D > &data, int numDataPoints, const std::string &dataFilename, const BiasGrid &grid, const std::string &correctFormatMessage)
 Maps each point in the grid to a point in the data grid. More...