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

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.
 
const char * enumValueToString (PressureMatrixType enumValue)
 Helper for describing tests.
 
const char * enumValueToStringForTestName (const BoxShape enumValue)
 Version of enumValueToString with abbreviated names.
 
std::string nameOfTest (const testing::TestParamInfo< ParrinelloRahmanTestParameters > &info)
 Help GoogleTest name our 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

const EnumerationArray
< PressureMatrixType,
Matrix3x3
c_pressureMatrices
 Some matrices of simulation box pressure. 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:114
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:114

Some matrices of simulation box pressure.