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

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

+ Collaboration diagram for gmx::test::TrajectoryComparison:

Description

Function object to compare the fields of two frames vs each others or one frame vs reference data for equality given the matchSettings_ and tolerances_.

If using two frames, they are required to have valid and matching values for time and step. According to matchSettings_, box, position coordinates, velocities and/or forces will be compared between frames, using the tolerances_. Comparisons will only occur when both frames have the requisite data, and will be expected to be equal within the matching component of tolerances_. If a comparison fails, a GoogleTest expectation failure will be given. If a comparison is required by matchSettings_ but cannot be done because either (or both) frames lack the requisite data, descriptive expectation failures will be given.

When comparing a frame to reference data, according to matchSettings_, box, position coordinates, velocities and/or forces will be compared to reference data, using the tolerances_. If a comparison fails, a GoogleTest expectation failure will be given. If a comparison is required by matchSettings_ but cannot be done because the frame lacks the requisite data, descriptive expectation failures will be given.

Public Member Functions

 TrajectoryComparison (const TrajectoryFrameMatchSettings &matchSettings, const TrajectoryTolerances &tolerances)
 Constructor.
 
void operator() (const TrajectoryFrame &reference, const TrajectoryFrame &test) const
 Compare reference with test given the matchSettings_ within tolerances_.
 
void operator() (const TrajectoryFrame &frame, TestReferenceChecker *checker) const
 Compare frame to reference given the matchSettings_ within tolerances_.
 

Static Public Attributes

static const TrajectoryTolerances s_defaultTrajectoryTolerances
 Defaults for trajectory comparisons. More...
 

Member Data Documentation

const TrajectoryTolerances gmx::test::TrajectoryComparison::s_defaultTrajectoryTolerances
static
Initial value:
{
defaultRealTolerance(),
relativeToleranceAsFloatingPoint(1.0, 1.0e-3),
defaultRealTolerance(),
relativeToleranceAsFloatingPoint(100.0, GMX_DOUBLE ? 1.0e-7 : 5.0e-5)
}

Defaults for trajectory comparisons.


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