Gromacs  2026.0-dev-20241204-d69d709
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions | Variables
pull_rotation.cpp File Reference
#include "gmxpre.h"
#include <cstddef>
#include <filesystem>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <type_traits>
#include <vector>
#include <gtest/gtest.h>
#include "gromacs/fileio/xvgr.h"
#include "gromacs/math/multidimarray.h"
#include "gromacs/math/vectypes.h"
#include "gromacs/mdspan/layouts.h"
#include "gromacs/mdspan/mdspan.h"
#include "gromacs/topology/ifunc.h"
#include "gromacs/trajectory/energyframe.h"
#include "gromacs/trajectory/trajectoryframe.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/real.h"
#include "gromacs/utility/stringutil.h"
#include "testutils/cmdlinetest.h"
#include "testutils/refdata.h"
#include "testutils/testasserts.h"
#include "testutils/testfilemanager.h"
#include "testutils/trajectoryreader.h"
#include "programs/mdrun/tests/comparison_helpers.h"
#include "energycomparison.h"
#include "energyreader.h"
#include "moduletest.h"
#include "trajectorycomparison.h"
+ Include dependency graph for pull_rotation.cpp:

Description

Tests for mdrun enforced rotation (rotational pulling) functionality.

These tests check the mdrun results for cases where one of the rotation potentials (see the corresponding section in the manual) is turned on. For a small rotation group of 4 atoms with the following atomic positions (.gro format):

4
1AR      AR    1   1.500   1.500   3.200
2AR      AR    2   3.900   5.800   3.500
3AR      AR    3   4.700   6.200   2.100
4AR      AR    4   5.500   4.000   6.600
8.000 8.000 8.000

and these positions of the reference group:

4
1AR      AR    1   1.000   2.000   3.000
2AR      AR    2   4.000   5.500   5.000
3AR      AR    3   4.500   6.000   2.500
4AR      AR    4   5.000   4.500   7.000
8.000 8.000 8.000

the tests for the iso, iso-pf, pm, pm-pf, rm, rm-pf, rm2, rm2-pf, flex, flex-t, flex2 and flex2-t potential types check the energies and forces from each rotational potential for a 5 degree rotation against the results obtained from a Mathematica notebook. As the cut-offs are small, the forces calculated at step zero are from the rotational potential only. The forces in the first frame of the .trr output files should therefore be identical to the Mathematica results.

In addition to the test described above, which checks energies and forces at time step 0, a second test compares a short 25-step trajectory to reference data with slightly looser tolerances.

Author
Carsten Kutzner ckutz.nosp@m.ne@g.nosp@m.wdg.d.nosp@m.e

Classes

class  gmx::test::anonymous_namespace{pull_rotation.cpp}::RotationTest
 Parameterized test fixture for enforced rotation. More...
 

Typedefs

typedef std::tuple
< std::string, double, double > 
gmx::test::anonymous_namespace{pull_rotation.cpp}::Parameters
 Convenience type to provide test parameters as a single argument.
 

Functions

void gmx::test::anonymous_namespace{pull_rotation.cpp}::checkRotForcesAtStepZero (const std::string &fn, const std::vector< std::vector< double >> &reference)
 Compare the forces at the first step to the reference.
 
real gmx::test::anonymous_namespace{pull_rotation.cpp}::getFirstRotEnergyValue (const std::string &fn)
 Return the first entry for the rotational energy stored in the .edr file.
 

Variables

std::map< std::string,
std::vector< std::vector
< double > > > 
gmx::test::anonymous_namespace{pull_rotation.cpp}::referenceForces
 Reference forces per potential resulting from a 5 degree rotation.