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

Classes

struct  Matrix3x3ToString
 Helper functor for naming tests. More...
 

Typedefs

using ParrinelloRahmanTestParameters = std::tuple< PressureCouplingOptions, PressureMatrixType, BoxShape, Matrix3x3, Matrix3x3 >
 Convenience typedef of the test input parameters. More...
 
using ParrRahmTest = ::testing::TestWithParam< ParrinelloRahmanTestParameters >
 Test fixture - abbreviated ParrinelloRahman to ParrRahm for shorter refdata filenames.
 

Enumerations

enum  PressureMatrixType {
  UniformDiagonal, PressureMatrixType::PartlyUniformDiagonal, PressureMatrixType::Diagonal, PressureMatrixType::General,
  PressureMatrixType::Extreme, PressureMatrixType::Count
}
 Some kinds of matrices of simulation box pressure. More...
 
enum  BoxShape : int {
  Cubic, Rectilinear, RhombicDodecahedronXYSquare, RhombicDodecahedronXYHexagon,
  TruncatedOctahedron, Other, Count
}
 Simulation box types.
 

Functions

void isAlmostDiagonalMatrix (const char *name, const Matrix3x3 &m)
 GoogleTest expectations about whether matrices are diagonal or not.
 
std::string pressureCouplingOptionsToString (const PressureCouplingOptions options)
 Helper function for naming tests.
 
template<BoxShape boxShape>
Matrix3x3 makeBox (real spacing)
 Template for box-making function.
 
template<>
Matrix3x3 makeBox< BoxShape::Cubic > (real spacing)
 Template specialization to make a cubic box.
 
template<>
Matrix3x3 makeBox< BoxShape::Rectilinear > (real spacing)
 Template specialization to make a rectilinear box.
 
template<>
Matrix3x3 makeBox< BoxShape::RhombicDodecahedronXYSquare > (real spacing)
 Template specialization to make a rhombic dodecahedral box where the XY face is a square.
 
template<>
Matrix3x3 makeBox< BoxShape::RhombicDodecahedronXYHexagon > (real spacing)
 Template specialization to make a rhombic dodecahedral box where the XY face is a hexagon.
 
template<>
Matrix3x3 makeBox< BoxShape::TruncatedOctahedron > (real spacing)
 Template specialization to make a truncated octahedral box.
 
template<>
Matrix3x3 makeBox< BoxShape::Other > (real spacing)
 Template specialization to make an arbitrary conformant box.
 
template<BoxShape boxShape>
std::vector< Matrix3x3makeBoxes (std::initializer_list< real > boxSizes)
 Make a vector of boxes whose type is boxShape and leading dimension one of the boxSizes.
 

Variables

constexpr
gmx::EnumerationArray
< PressureMatrixType, const
char * > 
sc_pressureMatrixTypeNames
 Helper array for describing tests. More...
 
const EnumerationArray
< PressureMatrixType,
Matrix3x3
c_pressureMatrices
 Some matrices of simulation box pressure. More...
 
constexpr
gmx::EnumerationArray
< BoxShape, const char * > 
sc_boxShapeNames
 
const NameOfTestFromTuple
< ParrinelloRahmanTestParameters
sc_testNamer
 Tuple of formatters to name the parameterized test cases. More...
 
const EnumerationArray
< BoxShape, std::vector
< Matrix3x3 > > 
c_boxVectors
 Sets of box vectors to use in tests. More...
 
const EnumerationArray
< BoxShape, std::vector
< Matrix3x3 > > 
c_boxVelocities
 Sets of box velocity vectors to use in tests. More...
 
const std::vector
< PressureCouplingOptions > 
c_options
 Sets of pressure-coupling MDP options to use in tests. More...
 

Typedef Documentation

using gmx::test::anonymous_namespace{parrinellorahman.cpp}::ParrinelloRahmanTestParameters = typedef std::tuple<PressureCouplingOptions, PressureMatrixType, BoxShape, Matrix3x3, Matrix3x3>

Convenience typedef of the test input parameters.

Parameters:

  • pressure-coupling MDP options
  • the matrix properties of the input pressure
  • the shape of the box
  • the box matrix
  • the box velocity matrix

Enumeration Type Documentation

enum gmx::test::anonymous_namespace{parrinellorahman.cpp}::PressureMatrixType
strong

Some kinds of matrices of simulation box pressure.

The symmetric ones are useful for testing e.g. that anisotropic coupling preserves symmetry if the inputs are symmetric.

Enumerator
PartlyUniformDiagonal 

all three diagonal entries are equal

Diagonal 

two diagonal entries are equal

General 

diagonal with unequal entries

Extreme 

All elements non-zero.

Count 

All elements non-zero and of large magnitude.

Variable Documentation

const EnumerationArray<BoxShape, std::vector<Matrix3x3> > gmx::test::anonymous_namespace{parrinellorahman.cpp}::c_boxVectors
Initial value:
= {
makeBoxes<BoxShape::Cubic>({ 2.5, 1e4 }),
makeBoxes<BoxShape::Rectilinear>({ 2.5, 1e4 }),
makeBoxes<BoxShape::RhombicDodecahedronXYSquare>({ 2.5, 1e4 }),
makeBoxes<BoxShape::RhombicDodecahedronXYHexagon>({ 2.5, 1e4 }),
makeBoxes<BoxShape::TruncatedOctahedron>({ 2.5, 1e4 }),
makeBoxes<BoxShape::Other>({ 2.5, 1e4 }),
}

Sets of box vectors to use in tests.

const EnumerationArray<BoxShape, std::vector<Matrix3x3> > gmx::test::anonymous_namespace{parrinellorahman.cpp}::c_boxVelocities
Initial value:
= {
makeBoxes<BoxShape::Cubic>({ -1e2, -1., -1e-7, 0., 1e-7, 1., 1e2 }),
makeBoxes<BoxShape::Rectilinear>({ -1e2, -1., -1e-7, 0., 1e-7, 1., 1e2 }),
makeBoxes<BoxShape::RhombicDodecahedronXYSquare>({ -1e2, -1., -1e-7, 0., 1e-7, 1., 1e2 }),
makeBoxes<BoxShape::RhombicDodecahedronXYHexagon>({ -1e2, -1., -1e-7, 0., 1e-7, 1., 1e2 }),
makeBoxes<BoxShape::TruncatedOctahedron>({ -1e2, -1., -1e-7, 0., 1e-7, 1., 1e2 }),
makeBoxes<BoxShape::Other>({ -1e2, -1., -1e-7, 0., 1e-7, 1., 1e2 }),
}

Sets of box velocity vectors to use in tests.

const std::vector<PressureCouplingOptions> gmx::test::anonymous_namespace{parrinellorahman.cpp}::c_options
Initial value:
= []() {
PressureCouplingOptions options;
options.epc = PressureCoupling::ParrinelloRahman;
options.tau_p = 1.;
Matrix3x3 compressibility = diagonalMatrix<real, 3, 3>(4.5e-5);
fillLegacyMatrix(compressibility, options.compress);
Matrix3x3 referencePressure = identityMatrix<real, 3, 3>();
fillLegacyMatrix(referencePressure, options.ref_p);
std::vector<PressureCouplingOptions> optionsVector;
for (const PressureCouplingType pressureCouplingType : { PressureCouplingType::Isotropic,
PressureCouplingType::Anisotropic })
{
options.epct = pressureCouplingType;
optionsVector.push_back(options);
}
return optionsVector;
}()
static void fillLegacyMatrix(Matrix3x3ConstSpan newMatrix, matrix legacyMatrix)
Fill legacy matrix from new matrix type.
Definition: matrix.h:144
std::array< real, DIM *DIM > Matrix3x3
TODO: make proper C++ matrix for the whole Gromacs, get rid of this.
Definition: pmetestcommon.h:127
PressureCouplingType
Pressure coupling type.
Definition: md_enums.h:210

Sets of pressure-coupling MDP options to use in tests.

const EnumerationArray<PressureMatrixType, Matrix3x3> gmx::test::anonymous_namespace{parrinellorahman.cpp}::c_pressureMatrices
Initial value:
= {
Matrix3x3{{ -2.1, 0, 0,
0, -2.1, 0,
0, 0, -2.1 }},
Matrix3x3{{ -2.1, 0, 0,
0, -2.1, 0,
0, 0, 3.4 }},
Matrix3x3{{ -2.1, 0, 0,
0, -1.7, 0,
0, 0, 3.4 }},
Matrix3x3{{ -2.1, 1.3, -1.1,
1.4, -1.7, 2.3,
-1.0, 2.2, 3.4}},
Matrix3x3{{ 2e5, 1e5, 3e5,
3e5, 1e5, 2e5,
1e5, 2e5, 3e5}}
}
std::array< real, DIM *DIM > Matrix3x3
TODO: make proper C++ matrix for the whole Gromacs, get rid of this.
Definition: pmetestcommon.h:127

Some matrices of simulation box pressure.

constexpr gmx::EnumerationArray<BoxShape, const char*> gmx::test::anonymous_namespace{parrinellorahman.cpp}::sc_boxShapeNames
Initial value:
= {
"shape_cubic",
"shape_rect",
"shape_rds",
"shape_rdh",
"shape_to",
"shape_other"
}
constexpr gmx::EnumerationArray<PressureMatrixType, const char*> gmx::test::anonymous_namespace{parrinellorahman.cpp}::sc_pressureMatrixTypeNames
Initial value:
= {
"pmt_unif diag",
"pmt_part unif diag",
"pmt_diagonal",
"pmt_general",
"pmt_extreme"
}

Helper array for describing tests.

These are used in naming test reference data files, and we have hard limits on file lengths, so we must abbreviate.

const NameOfTestFromTuple<ParrinelloRahmanTestParameters> gmx::test::anonymous_namespace{parrinellorahman.cpp}::sc_testNamer
Initial value:
{ std::make_tuple(
pressureCouplingOptionsToString,
sc_pressureMatrixTypeNames,
sc_boxShapeNames,
Matrix3x3ToString{ "box" },
Matrix3x3ToString{ "boxv" }) }

Tuple of formatters to name the parameterized test cases.