Gromacs
2021

Internal GROMACS namespace.
This namespace is used to contain some implementationspecific functions and classes. These are not meant for direct user access, but typically reside in public headers because of implementation reasons.
Namespaces  
anonymous_namespace{selection.cpp}  
Classes  
class  AnalysisDataHandleImpl 
Private implementation class for AnalysisDataHandle. More...  
class  AnalysisDataStorageImpl 
Private implementation class for AnalysisDataStorage. More...  
class  AnalysisDataStorageFrameData 
Internal representation for a single stored frame. More...  
class  BasicAverageHistogramModule 
Implements average histogram module that averages perframe histograms. More...  
class  BasicHistogramImpl 
Base class for private implementation classes for histogram modules. More...  
class  EnumIndexStore 
Typespecific implementation for IOptionValueStore for an enum option. More...  
class  OptionSectionImpl 
Internal implementation class for storing an option section. More...  
class  OptionsImpl 
Private implementation class for Options. More...  
class  SelectionData 
Internal data for a single selection. More...  
struct  SimdTraits 
Simd traits. More...  
class  SimdArrayRef 
STLlike container for aligned SIMD type. Used as ArrayRef<SimdReal>. More...  
class  IExceptionInfo 
Base class for ExceptionInfo. More...  
Typedefs  
typedef std::unique_ptr < AnalysisDataStorageFrame >  AnalysisDataFrameBuilderPointer 
Smart pointer type for managing a storage frame builder.  
template<typename T >  
using  SimdTraitsT = typename SimdTraits< T >::type 
template<typename T >  
using  Simd4TraitsT = typename Simd4Traits< T >::type 
typedef std::vector < std::exception_ptr >  NestedExceptionList 
Internal container type for storing a list of nested exceptions.  
typedef std::unique_ptr < IExceptionInfo >  ExceptionInfoPointer 
Smart pointer to manage IExceptionInfo ownership.  
Functions  
AbstractOptionStorage *  createEnumOptionStorage (const AbstractOption &option, const char *const *enumValues, int count, int defaultValue, int defaultValueIfSet, std::unique_ptr< IOptionValueStore< int >> store) 
Helper to create EnumOptionStorage instances. More...  
void  throwUnlessDerivativeIsConsistentWithFunction (const std::function< double(double)> &function, const std::function< double(double)> &derivative, const std::pair< real, real > &range) 
Ensure analytical derivative is the derivative of analytical function. More...  
void  throwUnlessDerivativeIsConsistentWithFunction (ArrayRef< const double > function, ArrayRef< const double > derivative, double inputSpacing, const std::pair< real, real > &range) 
Ensure vector of derivative values is the derivative of function vector. More...  
static double  quotientOfFunctionAndSecondDerivative (double previousPoint, double thisPoint, double nextPoint, double spacing) 
Calculate absolute quotient of function and its second derivative. More...  
real  findSmallestQuotientOfFunctionAndSecondDerivative (const std::function< double(double)> &f, const std::pair< real, real > &range) 
Find smallest quotient between analytical function and its 2nd derivative. More...  
real  findSmallestQuotientOfFunctionAndSecondDerivative (ArrayRef< const double > function, double inputSpacing, const std::pair< real, real > &range) 
Find smallest quotient between vector of values and its 2nd derivative. More...  
static double  quotientOfFunctionAndThirdDerivative (double previousPreviousPoint, double previousPoint, double thisPoint, double nextPoint, double nextNextPoint, double spacing) 
Calculate absolute quotient of function and its third derivative. More...  
real  findSmallestQuotientOfFunctionAndThirdDerivative (const std::function< double(double)> &f, const std::pair< real, real > &range) 
Find smallest quotient between analytical function and its 3rd derivative. More...  
real  findSmallestQuotientOfFunctionAndThirdDerivative (ArrayRef< const double > function, double inputSpacing, const std::pair< real, real > &range) 
Find smallest quotient between function and 2nd derivative (vectors) More...  
std::vector< double >  vectorSecondDerivative (ArrayRef< const double > f, double spacing) 
Calculate second derivative of vector and return vector of same length. More...  
template<class T , class U >  
void  fillMultiplexedTableData (const T inputData, U *multiplexedOutputData, std::size_t valuesPerTablePoint, std::size_t numTables, std::size_t thisTableIndex) 
Copy (temporary) table data into aligned multiplexed vector. More...  
template<typename T >  
static void  ignoreValueHelper (const T &) 
Helper for ignoring values in macros. More...  
void  current_function_helper () 
Helper for defining GMX_CURRENT_FUNCTION.  
void  printFatalErrorHeader (FILE *fp, const char *title, const char *func, const char *file, int line) 
Formats a common header for fatal error messages. More...  
void  printFatalErrorMessageLine (FILE *fp, const char *text, int indent) 
Formats a line of fatal error message text. More...  
void  printFatalErrorFooter (FILE *fp) 
Formats a common footer for fatal error messages. More...  
void  assertHandler (const char *condition, const char *msg, const char *func, const char *file, int line) 
Called when an assert fails. More...  
void gmx::internal::fillMultiplexedTableData  (  const T  inputData, 
U *  multiplexedOutputData,  
std::size_t  valuesPerTablePoint,  
std::size_t  numTables,  
std::size_t  thisTableIndex  
) 
Copy (temporary) table data into aligned multiplexed vector.
This routine takes the temporary data generated for a single table and writes multiplexed output into a multipletabledata vector. If the output vector is empty we will resize it to fit the data, and otherwise we assert the size is correct to add out input data.
T  Type of container for input data 
U  Type of container for output data 
[in]  inputData  Input data for single table 
[in,out]  multiplexedOutputData  Multiplexed output vector, many tables. 
[in]  valuesPerTablePoint  Number of real values for each table point, for instance 4 in DDFZ tables. 
[in]  numTables  Number of tables mixed into multiplexed output 
[in]  thisTableIndex  Index of this table in multiplexed output 
real gmx::internal::findSmallestQuotientOfFunctionAndSecondDerivative  (  const std::function< double(double)> &  f, 
const std::pair< real, real > &  range  
) 
Find smallest quotient between analytical function and its 2nd derivative.
Used to calculate spacing for quadratic spline tables. This function divides the function value by the second derivative (or a very small number when that is zero), and returns the smallest such quotient found in the range.
Our quadratic tables corresponds to linear interpolation of the derivative, which means the derivative will typically have larger error than the value when interpolating. The spacing required to reach a particular relative tolerance in the derivative depends on the quotient between the first derivative and the third derivative of the function itself.
You should call this routine with the analytical derivative as the "function" parameter, and the quotient between "function and second derivative" will then correspond to the quotient bewteen the derivative and the third derivative of the actual function we want to tabulate.
Since all functions that can be tabulated efficiently are reasonably smooth, we simply check 1,000 points in the interval rather than bother about implementing any complicated global optimization scheme.
f  Analytical function 
range  Interval 
real gmx::internal::findSmallestQuotientOfFunctionAndSecondDerivative  (  ArrayRef< const double >  function, 
double  inputSpacing,  
const std::pair< real, real > &  range  
) 
Find smallest quotient between vector of values and its 2nd derivative.
Used to calculate spacing for quadratic spline tables. This function divides the function value by the second derivative (or a very small number when that is zero), and returns the smallest such quotient found in the range.
Our quadratic tables corresponds to linear interpolation of the derivative, which means the derivative will typically have larger error than the value when interpolating. The spacing required to reach a particular relative tolerance in the derivative depends on the quotient between the first derivative and the third derivative of the function itself.
You should call this routine with the analytical derivative as the "function" parameter, and the quotient between "function and second derivative" will then correspond to the quotient bewteen the derivative and the third derivative of the actual function we want to tabulate.
function  Vector with function values 
inputSpacing  Spacing between function values 
range  Interval to check 
real gmx::internal::findSmallestQuotientOfFunctionAndThirdDerivative  (  const std::function< double(double)> &  f, 
const std::pair< real, real > &  range  
) 
Find smallest quotient between analytical function and its 3rd derivative.
Used to calculate table spacing. This function divides the function value by the second derivative (or a very small number when that is zero), and returns the smallest such quotient found in the range.
Our quadratic tables corresponds to linear interpolation of the derivative, which means the derivative will typically have larger error than the value when interpolating. The spacing required to reach a particular relative tolerance in the derivative depends on the quotient between the first derivative and the third derivative of the function itself.
You should call this routine with the analytical derivative as the "function" parameter, and the quotient between "function and second derivative" will then correspond to the quotient bewteen the derivative and the third derivative of the actual function we want to tabulate.
Since all functions that can be tabulated efficiently are reasonably smooth, we simply check 1,000 points in the interval rather than bother about implementing any complicated global optimization scheme.
f  Analytical function 
range  Interval 
real gmx::internal::findSmallestQuotientOfFunctionAndThirdDerivative  (  ArrayRef< const double >  function, 
double  inputSpacing,  
const std::pair< real, real > &  range  
) 
Find smallest quotient between function and 2nd derivative (vectors)
Used to calculate table spacing. This function divides the function value by the second derivative (or a very small number when that is zero), and returns the smallest such quotient found in the range.
Our quadratic tables corresponds to linear interpolation of the derivative, which means the derivative will typically have larger error than the value when interpolating. The spacing required to reach a particular relative tolerance in the derivative depends on the quotient between the first derivative and the third derivative of the function itself.
You should call this routine with the analytical derivative as the "function" parameter, and the quotient between "function and second derivative" will then correspond to the quotient bewteen the derivative and the third derivative of the actual function we want to tabulate.
function  Vector with function values 
inputSpacing  Spacing between function values 
range  Interval to check 

static 
Calculate absolute quotient of function and its second derivative.
This is a utility function used in the functions to find the smallest quotient in a range.
[in]  previousPoint  Value of function at xh. 
[in]  thisPoint  Value of function at x. 
[in]  nextPoint  Value of function at x+h. 
[in]  spacing  Value of h. 

static 
Calculate absolute quotient of function and its third derivative.
This is a utility function used in the functions to find the smallest quotient in a range.
[in]  previousPreviousPoint  Value of function at x2h. 
[in]  previousPoint  Value of function at xh. 
[in]  thisPoint  Value of function at x. 
[in]  nextPoint  Value of function at x+h. 
[in]  nextNextPoint  Value of function at x+2h. 
[in]  spacing  Value of h. 
void gmx::internal::throwUnlessDerivativeIsConsistentWithFunction  (  const std::function< double(double)> &  function, 
const std::function< double(double)> &  derivative,  
const std::pair< real, real > &  range  
) 
Ensure analytical derivative is the derivative of analytical function.
This routine evaluates the numerical derivative of the function for a few (1000) points in the interval and checks that the relative difference between numerical and analytical derivative is within the expected error for the numerical derivative approximation we use.
The main point of this routine is to make sure the user has not made a mistake or sign error when defining the functions.
function  Analytical function to differentiate 
derivative  Analytical derivative to compare with 
range  Range to test 
If  the provided derivative does not seem to match the function. 
void gmx::internal::throwUnlessDerivativeIsConsistentWithFunction  (  ArrayRef< const double >  function, 
ArrayRef< const double >  derivative,  
double  inputSpacing,  
const std::pair< real, real > &  range  
) 
Ensure vector of derivative values is the derivative of function vector.
This routine differentiates a vector of numerical values and checks that the relative difference to a provided vector of numerical derivatives is smaller than the expected error from the numerical differentiation.
The main point of this routine is to make sure the user has not made a mistake or sign error when defining the functions.
To avoid problems if the vectors change from zero to finite values at the start/end of the interval, we only check inside the range requested.
function  Numerical function value vector to differentiate 
derivative  Numerical derivative vector to compare with 
inputSpacing  Distance between input points 
range  Range to test 
If  the provided derivative does not seem to match the function. 
std::vector< double > gmx::internal::vectorSecondDerivative  (  ArrayRef< const double >  f, 
double  spacing  
) 
Calculate second derivative of vector and return vector of same length.
5point approximations are used, with endpoints using noncenter interpolation.
f  Vector (function) for which to calculate second derivative 
spacing  Spacing of input data. 
If  the input vector has fewer than five data points. 