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

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


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, MaxNumFrames maxNumFrames)
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...

Static Public Member Functions

static EnergyTermsToCompare defaultEnergyTermsToCompare ()
 Defaults for energy comparisons.

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().

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.

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