Gromacs  2021.3
 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::string >.

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 SetUp () override
 Test setup function. 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 void checkVirialTensor (FloatingPointTolerance tolerance, const ConstraintsTestData &testData)
 The test of virial tensor. More...
 
static std::vector
< std::unique_ptr
< IConstraintsTestRunner > > 
getRunners ()
 Before any test is run, work out whether any compatible GPUs exist.
 

Public Attributes

std::unordered_map
< std::string, t_pbc
pbcs_
 PBC setups.
 

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.
static void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::checkVirialTensor ( FloatingPointTolerance  tolerance,
const ConstraintsTestData &  testData 
)
inlinestatic

The test of virial tensor.

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

Parameters
[in]toleranceTolerance for the tensor values.
[in]testDataTest data structure.
void gmx::test::anonymous_namespace{constr.cpp}::ConstraintsTest::SetUp ( )
inlineoverride

Test setup function.

Setting up the pbcs and algorithms. Note, that corresponding string keywords have to be explicitly added at the end of this file when the tests are called.


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