Gromacs  2025-dev-20240910-a7e2421
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions | Variables
gmx::test::anonymous_namespace{pmegathertest.cpp} Namespace Reference

Classes

struct  SplineData
 A structure for all the spline data which depends in size both on the PME order and atom count. More...
 
struct  TestSystem
 A structure for the input atom data, which depends in size on atom count. More...
 
class  GatherTest
 Test fixture. More...
 
class  GatherTestBody
 Test case whose body checks that gather works. More...
 

Typedefs

typedef std::tuple
< std::string, int, IVec,
std::string, std::string, int > 
GatherInputParameters
 Convenience typedef of the test input parameters. More...
 

Functions

SplineData getSplineData (const int pmeOrder, const int atomCount)
 Return synthetic spline data to gather.
 
std::string nameOfTest (const testing::TestParamInfo< GatherInputParameters > &info)
 Help GoogleTest name our test cases. More...
 
std::string fullNameOfTest (const testing::TestParamInfo< GatherInputParameters > &info, const std::string &testName)
 Help GoogleTest name our test cases. More...
 

Variables

std::vector< IVec > const c_inputGridSizes { IVec{ 16, 12, 14 }, IVec{ 13, 15, 11 } }
 A couple of valid inputs for grid sizes.
 
const std::map< std::string,
SparseRealGridValuesInput
c_inputGrids
 Two input grids - only non-zero values have to be listed. More...
 
std::vector< RVec > const c_sampleForcesFull
 Input forces for reduction. More...
 
std::map< std::string, TestSystemc_testSystems
 Test systems to use. More...
 
const auto c_inputBoxNames = ::testing::Values("rect", "tric")
 Moved out from instantiations for readability.
 
const auto c_inputGridNames = ::testing::Values("first", "second")
 Moved out from instantiations for readability.
 
const auto c_inputTestSystemNames = ::testing::Values("1 atom", "2 atoms", "13 atoms")
 Moved out from instantiations for readability.
 

Typedef Documentation

typedef std::tuple<std::string, int, IVec, std::string, std::string, int> gmx::test::anonymous_namespace{pmegathertest.cpp}::GatherInputParameters

Convenience typedef of the test input parameters.

Parameters:

  • unit cell box
  • PME interpolation order
  • grid dimensions
  • grid values
  • test system
  • PME hardware context index

Function Documentation

std::string gmx::test::anonymous_namespace{pmegathertest.cpp}::fullNameOfTest ( const testing::TestParamInfo< GatherInputParameters > &  info,
const std::string &  testName 
)

Help GoogleTest name our test cases.

This is intended to work like a custom test-naming function that would be passed as the fourth argument to INSTANTIATE_TEST_SUITE_P, except that we are not using that macro for these tests. All components of GatherInputParameters affect this name.

std::string gmx::test::anonymous_namespace{pmegathertest.cpp}::nameOfTest ( const testing::TestParamInfo< GatherInputParameters > &  info)

Help GoogleTest name our test cases.

This is intended to work like a custom test-naming function that would be passed as the fourth argument to INSTANTIATE_TEST_SUITE_P, except that we are not using that macro for these tests. Only the components of GatherInputParameters that affect the reference data values affect this name. Hardware context does not affect this name.

Variable Documentation

const std::map<std::string, SparseRealGridValuesInput> gmx::test::anonymous_namespace{pmegathertest.cpp}::c_inputGrids
Initial value:
= {
{ "first",
{ IVec{ 0, 0, 0 }, 3.5F },
{ IVec{ 7, 0, 0 }, -2.5F },
{ IVec{ 3, 5, 7 }, -0.006F },
{ IVec{ 1, 6, 7 }, -2.76F },
{ IVec{ 3, 1, 2 }, 0.6F },
{ IVec{ 6, 2, 4 }, 7.1F },
{ IVec{ 4, 5, 6 }, 4.1F },
{ IVec{ 4, 4, 6 }, -3.7F },
} },
{ "second",
{ IVec{ 0, 4, 0 }, 6.F },
{ IVec{ 4, 2, 7 }, 13.76F },
{ IVec{ 0, 6, 7 }, 3.6F },
{ IVec{ 3, 2, 8 }, 0.61F },
{ IVec{ 5, 4, 3 }, 2.1F },
{ IVec{ 2, 5, 10 }, 3.6F },
{ IVec{ 5, 3, 6 }, 2.1F },
{ IVec{ 6, 6, 6 }, 6.1F },
} }
}
SparseGridValuesInput< real > SparseRealGridValuesInput
Non-zero real grid values.
Definition: pmetestcommon.h:116
BasicVector< int > IVec
Shorthand for C++ ivec-equivalent type.
Definition: vectypes.h:344

Two input grids - only non-zero values have to be listed.

std::vector<RVec> const gmx::test::anonymous_namespace{pmegathertest.cpp}::c_sampleForcesFull
Initial value:
{
RVec{ 0.02F, 0.87F, 0.95F }, RVec{ 0.66F, 0.67F, 0.38F }, RVec{ 0.45F, 0.04F, 0.94F },
RVec{ 0.54F, 0.76F, 0.58F }, RVec{ 0.83F, 0.31F, 0.73F }, RVec{ 0.71F, 0.06F, 0.35F },
RVec{ 0.32F, 0.35F, 0.61F }, RVec{ 0.27F, 0.98F, 0.83F }, RVec{ 0.11F, 0.3F, 0.42F },
RVec{ 0.95F, 0.69F, 0.58F }, RVec{ 0.29F, 0.1F, 0.68F }, RVec{ 0.94F, 0.62F, 0.51F },
RVec{ 0.47F, 0.04F, 0.47F }, RVec{ 0.34F, 0.71F, 0.52F }
}
BasicVector< real > RVec
Shorthand for C++ rvec-equivalent type.
Definition: vectypes.h:340

Input forces for reduction.

std::map<std::string, TestSystem> gmx::test::anonymous_namespace{pmegathertest.cpp}::c_testSystems
Initial value:
= {
{ "1 atom",
{ GridLineIndicesVector{ { IVec(4, 2, 6) } },
ChargesVector{ 4.95F },
CoordinatesVector(1, { 1e6, 1e7, -1e8 }) } },
{ "2 atoms",
{ GridLineIndicesVector{ { IVec(1, 4, 10), IVec(0, 6, 6) } },
ChargesVector{ { 3.11F, 3.97F } },
CoordinatesVector(2, { 1e6, 1e7, -1e8 }) } },
{ "13 atoms",
IVec{ 0, 1, 4 },
IVec{ 6, 3, 0 },
IVec{ 7, 2, 2 },
IVec{ 8, 3, 1 },
IVec{ 4, 0, 3 },
IVec{ 0, 0, 0 },
IVec{ 8, 5, 8 },
IVec{ 4, 4, 2 },
IVec{ 7, 1, 7 },
IVec{ 8, 5, 5 },
IVec{ 2, 6, 5 },
IVec{ 1, 6, 2 },
IVec{ 7, 1, 8 },
} },
ChargesVector{ { 1.08F, 2.09F, 1.1F, 4.13F, 3.31F, 2.8F, 5.83F, 5.09F, 6.1F, 2.86F, 0.24F, 5.76F, 5.19F } },
CoordinatesVector(13, { 1e6, 1e7, -1e8 }) } },
}
std::vector< real > ChargesVector
Charges.
Definition: pmetestcommon.h:97
std::vector< RVec > CoordinatesVector
Coordinates.
Definition: pmetestcommon.h:99
std::vector< IVec > GridLineIndicesVector
Gridline indices.
Definition: pmetestcommon.h:103
BasicVector< int > IVec
Shorthand for C++ ivec-equivalent type.
Definition: vectypes.h:344

Test systems to use.

The coordinates are intentionally bogus in this test - only the size matters; the gridline indices are fed directly as inputs