Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
gmx::test::EnergyComparison Class Reference

#include <programs/mdrun/tests/energycomparison.h>

Description

Function object to compare all energy terms of reference with all matching terms from test within the given tolerances.

Public Member Functions

 EnergyComparison (const EnergyTermsToCompare &energyTermsToCompare)
 Constructor.
 
std::vector< std::string > getEnergyNames () const
 Return the names of energies that will be compared. More...
 
void operator() (const EnergyFrame &reference, const EnergyFrame &test) const
 Compare reference with test within energyTermsToCompare_. More...
 

Public Attributes

EnergyTermsToCompare energyTermsToCompare_
 Energy terms to match with given tolerances.
 

Static Public Attributes

static const EnergyTermsToCompare s_defaultEnergyTermsToCompare
 Defaults for energy comparisons. More...
 

Member Function Documentation

std::vector< std::string > gmx::test::EnergyComparison::getEnergyNames ( ) const

Return the names of energies that will be compared.

This function can be used to provide an input for openEnergyFileToReadTerms().

Todo:
This returns a copy of the keys, which is convenient, but inefficient. Alternatively, this could return a view of the keys from a range rather than a container, but there's no implementation of that in C++11 at the moment.
void gmx::test::EnergyComparison::operator() ( const EnergyFrame reference,
const EnergyFrame test 
) const

Compare reference with test within energyTermsToCompare_.

Ignore any key found in either reference or test that is not found in the other. For all keys found in both frames, compare the values with EXPECT_REAL_EQ_TOL and the given tolerance for that key.

Member Data Documentation

const EnergyTermsToCompare gmx::test::EnergyComparison::s_defaultEnergyTermsToCompare
static
Initial value:
= {
{ interaction_function[F_EPOT].longname, relativeToleranceAsUlp(10.0, 50) },
{ interaction_function[F_EKIN].longname, relativeToleranceAsUlp(10.0, 50) },
{ interaction_function[F_PRES].longname, relativeToleranceAsUlp(10.0, 15000) },
}

Defaults for energy comparisons.


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