Gromacs  2025.0-dev-20241009-5c23d5f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Variables
settle.cpp File Reference
#include "gmxpre.h"
#include "gromacs/mdlib/settle.h"
#include "config.h"
#include <algorithm>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include <gtest/gtest.h>
#include "gromacs/hardware/device_management.h"
#include "gromacs/math/paddedvector.h"
#include "gromacs/math/vec.h"
#include "gromacs/math/vectypes.h"
#include "gromacs/mdlib/tests/watersystem.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/mdatom.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/idef.h"
#include "gromacs/topology/ifunc.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/real.h"
#include "gromacs/utility/stringutil.h"
#include "gromacs/utility/unique_cptr.h"
#include "testutils/refdata.h"
#include "testutils/test_device.h"
#include "testutils/test_hardware_environment.h"
#include "testutils/testasserts.h"
#include "settletestdata.h"
#include "settletestrunners.h"
+ Include dependency graph for settle.cpp:

Description

Tests for SETTLE constraints.

The test runs on several small systems, containing 1 to 17 water molecules, with and without periodic boundary conditions, with and without velocity and virial updates. The CPU and GPU versions are tested, if the code was compiled with CUDA support and there is a CUDA-capable GPU in the system.

The tests check:

  1. If the final distances between constrained atoms are within tolerance from the target distance.
  2. If the velocities were updated when needed.
  3. If the virial was computed.

The test also compares the results from the CPU and GPU versions of the algorithm: final coordinates, velocities and virial should be within tolerance to one another.

Todo:
This also tests that if the calling code requires velocities and virial updates, that those outputs do change, but does not test that those changes are correct.
Todo:
Only no-PBC and cubic-PBC are tested here, but the correct function of the SIMD version of set_pbx_auic in all cases should be tested elsewhere.
Todo:
The CPU and GPU versions are tested against each other. This should be changed to a proper test against pre-computed reference values. Also, these test will dry-run on a CUDA build if no CUDA-capable GPU is available.
Author
Mark Abraham mark..nosp@m.j.ab.nosp@m.raham.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Artem Zhmurov zhmur.nosp@m.ov@g.nosp@m.mail..nosp@m.com

Classes

struct  gmx::test::anonymous_namespace{settle.cpp}::SettleTestParameters
 Parameters that will vary from test to test. More...
 
class  gmx::test::anonymous_namespace{settle.cpp}::SettleTest
 Test fixture for testing SETTLE. More...
 

Variables

const SettleTestParameters gmx::test::anonymous_namespace{settle.cpp}::parametersSets []
 Sets of parameters on which to run the tests. More...