Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes
gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest Class Reference

Inherits TestWithParam< std::tuple< ConstraintsTestSystem, t_pbc > >.

+ Collaboration diagram for gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest:

Description

Test fixture for constraints.

The fixture uses following test systems:

  1. Two atoms, connected with one constraint (e.g. NH).
  2. Three atoms, connected consequently with two constraints (e.g. CH2).
  3. Three atoms, constrained to the fourth atom (e.g. CH3).
  4. Four atoms, connected by two independent constraints.
  5. Three atoms, connected by three constraints in a triangle (e.g. H2O with constrained H-O-H angle).
  6. Four atoms, connected by three consequential constraints.

For all systems, the final lengths of the constraints are tested against the reference values, the direction of each constraint is checked. Test also verifies that the center of mass has not been shifted by the constraints and that its velocity has not changed. For some systems, the value for scaled virial tensor is checked against pre-computed data.

Public Member Functions

void checkFinalPositions (const ConstraintsTestData &testData)
 Test if the final position correspond to the reference data. More...
 
void checkFinalVelocities (const ConstraintsTestData &testData)
 Test if the final velocities correspond to the reference data. More...
 
void checkVirialTensor (const ConstraintsTestData &testData)
 The test of virial tensor. More...
 

Static Public Member Functions

static void checkConstrainsLength (FloatingPointTolerance tolerance, const ConstraintsTestData &testData, t_pbc pbc)
 The test on the final length of constrained bonds. More...
 
static void checkConstrainsDirection (const ConstraintsTestData &testData, t_pbc pbc)
 The test on the final length of constrained bonds. More...
 
static void checkCOMCoordinates (FloatingPointTolerance tolerance, const ConstraintsTestData &testData)
 The test on the coordinates of the center of the mass (COM) of the system. More...
 
static void checkCOMVelocity (FloatingPointTolerance tolerance, const ConstraintsTestData &testData)
 The test on the velocity of the center of the mass (COM) of the system. More...
 
static std::vector
< std::unique_ptr
< IConstraintsTestRunner > > 
getRunners ()
 Before any test is run, work out whether any compatible GPUs exist.
 

Public Attributes

TestReferenceData refData_
 Reference data.
 
TestReferenceChecker checker_
 Checker for reference data.
 

Member Function Documentation

static void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkCOMCoordinates ( FloatingPointTolerance  tolerance,
const ConstraintsTestData &  testData 
)
inlinestatic

The test on the coordinates of the center of the mass (COM) of the system.

Checks if the center of mass has not been shifted by the constraints. Note, that this test does not take into account the periodic boundary conditions. Hence it will not work should the constraints decide to move atoms across PBC borders.

Parameters
[in]toleranceAllowed tolerance in COM coordinates.
[in]testDataTest data structure.
static void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkCOMVelocity ( FloatingPointTolerance  tolerance,
const ConstraintsTestData &  testData 
)
inlinestatic

The test on the velocity of the center of the mass (COM) of the system.

Checks if the velocity of the center of mass has not changed.

Parameters
[in]toleranceAllowed tolerance in COM velocity components.
[in]testDataTest data structure.
static void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkConstrainsDirection ( const ConstraintsTestData &  testData,
t_pbc  pbc 
)
inlinestatic

The test on the final length of constrained bonds.

Goes through all the constraints and checks if the direction of constraint has not changed by the algorithm (i.e. the constraints algorithm arrived to the solution that is closest to the initial system conformation).

Parameters
[in]testDataTest data structure.
[in]pbcPeriodic boundary data.
static void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkConstrainsLength ( FloatingPointTolerance  tolerance,
const ConstraintsTestData &  testData,
t_pbc  pbc 
)
inlinestatic

The test on the final length of constrained bonds.

Goes through all the constraints and checks if the final length of all the constraints is equal to the target length with provided tolerance.

Parameters
[in]toleranceAllowed tolerance in final lengths.
[in]testDataTest data structure.
[in]pbcPeriodic boundary data.
void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkFinalPositions ( const ConstraintsTestData &  testData)
inline

Test if the final position correspond to the reference data.

Parameters
[in]testDataTest data structure.
void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkFinalVelocities ( const ConstraintsTestData &  testData)
inline

Test if the final velocities correspond to the reference data.

Parameters
[in]testDataTest data structure.
void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkVirialTensor ( const ConstraintsTestData &  testData)
inline

The test of virial tensor.

Checks if the values in the scaled virial tensor are equal to pre-computed values.

Parameters
[in]testDataTest data structure.

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