Gromacs
2018.7
|
#include <array>
#include <map>
#include <vector>
#include <gtest/gtest.h>
#include "gromacs/ewald/pme.h"
#include "gromacs/ewald/pme-gpu-internal.h"
#include "gromacs/math/gmxcomplex.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/unique_cptr.h"
#include "testhardwarecontexts.h"
Describes common routines and types for PME tests.
Typedefs | |
typedef gmx::unique_cptr < gmx_pme_t, gmx_pme_destroy > | gmx::test::PmeSafePointer |
A safe pointer type for PME. | |
typedef ArrayRef< const real > | gmx::test::ChargesVector |
Charges. | |
typedef std::vector< RVec > | gmx::test::CoordinatesVector |
Coordinates. | |
typedef ArrayRef< RVec > | gmx::test::ForcesVector |
Forces. | |
typedef ArrayRef< const IVec > | gmx::test::GridLineIndicesVector |
Gridline indices. | |
typedef ArrayRef< const real > | gmx::test::SplineParamsDimVector |
Spline parameters (theta or dtheta). A reference to a single dimension's spline data; this means (atomCount * pmeOrder) values or derivatives. | |
typedef std::array < SplineParamsDimVector, 3 > | gmx::test::SplineParamsVector |
Spline parameters (theta or dtheta) in all 3 dimensions. | |
template<typename ValueType > | |
using | gmx::test::SparseGridValuesInput = std::map< IVec, ValueType > |
Non-zero grid values for test input; keys are 3d indices (IVec) | |
typedef SparseGridValuesInput < real > | gmx::test::SparseRealGridValuesInput |
Non-zero real grid values. | |
typedef SparseGridValuesInput < t_complex > | gmx::test::SparseComplexGridValuesInput |
Non-zero complex grid values. | |
template<typename ValueType > | |
using | gmx::test::SparseGridValuesOutput = std::map< std::string, ValueType > |
Non-zero grid values for test output; keys are string representations of the cells' 3d indices (IVec); this allows for better sorting. | |
typedef SparseGridValuesOutput < real > | gmx::test::SparseRealGridValuesOutput |
Non-zero real grid values. | |
typedef SparseGridValuesOutput < t_complex > | gmx::test::SparseComplexGridValuesOutput |
Non-zero complex grid values. | |
typedef std::array< real, 3 *3 > | gmx::test::Matrix3x3 |
TODO: make proper C++ matrix for the whole Gromacs, get rid of this. | |
typedef std::tuple< real, Matrix3x3 > | gmx::test::PmeSolveOutput |
PME solver results - reciprocal energy and virial. | |
Enumerations | |
enum | gmx::test::PmeSolveAlgorithm { Coulomb, LennardJones } |
PME solver type. | |
Functions | |
bool | gmx::test::pmeSupportsInputForMode (const t_inputrec *inputRec, CodePath mode) |
Tells if this generally valid PME input is supported for this mode. | |
gmx_uint64_t | gmx::test::getSplineModuliDoublePrecisionUlps (int splineOrder) |
For double precision checks, the recursive interpolation and use of trig functions in make_dft_mod require a lot more flops, and thus opportunity for deviation between implementations. | |
PmeSafePointer | gmx::test::pmeInitEmpty (const t_inputrec *inputRec, CodePath mode, gmx_device_info_t *gpuInfo, const Matrix3x3 &box, real ewaldCoeff_q, real ewaldCoeff_lj) |
Simple PME initialization based on input, no atom data. More... | |
PmeSafePointer | gmx::test::pmeInitAtoms (const t_inputrec *inputRec, CodePath mode, gmx_device_info_t *gpuInfo, const CoordinatesVector &coordinates, const ChargesVector &charges, const Matrix3x3 &box) |
PME initialization with atom data. More... | |
void | gmx::test::pmePerformSplineAndSpread (gmx_pme_t *pme, CodePath mode, bool computeSplines, bool spreadCharges) |
PME spline calculation and charge spreading. More... | |
void | gmx::test::pmePerformSolve (const gmx_pme_t *pme, CodePath mode, PmeSolveAlgorithm method, real cellVolume, GridOrdering gridOrdering, bool computeEnergyAndVirial) |
PME solving. | |
void | gmx::test::pmePerformGather (gmx_pme_t *pme, CodePath mode, PmeForceOutputHandling inputTreatment, ForcesVector &forces) |
PME force gathering. | |
void | gmx::test::pmeFinalizeTest (const gmx_pme_t *pme, CodePath mode) |
PME test finalization before fetching the outputs. | |
void | gmx::test::pmeSetSplineData (const gmx_pme_t *pme, CodePath mode, const SplineParamsDimVector &splineValues, PmeSplineDataType type, int dimIndex) |
Setting atom spline values/derivatives to be used in spread/gather. More... | |
void | gmx::test::pmeSetGridLineIndices (const gmx_pme_t *pme, CodePath mode, const GridLineIndicesVector &gridLineIndices) |
Setting gridline indices to be used in spread/gather. More... | |
void | gmx::test::pmeSetRealGrid (const gmx_pme_t *pme, CodePath mode, const SparseRealGridValuesInput &gridValues) |
Setting real grid to be used in gather. | |
void | gmx::test::pmeSetComplexGrid (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering, const SparseComplexGridValuesInput &gridValues) |
Setting complex grid to be used in solve. | |
SplineParamsDimVector | gmx::test::pmeGetSplineData (const gmx_pme_t *pme, CodePath mode, PmeSplineDataType type, int dimIndex) |
Getting the single dimension's spline values or derivatives. | |
GridLineIndicesVector | gmx::test::pmeGetGridlineIndices (const gmx_pme_t *pme, CodePath mode) |
Getting the gridline indices. | |
SparseRealGridValuesOutput | gmx::test::pmeGetRealGrid (const gmx_pme_t *pme, CodePath mode) |
Getting the real grid (spreading output of pmePerformSplineAndSpread()) | |
SparseComplexGridValuesOutput | gmx::test::pmeGetComplexGrid (const gmx_pme_t *pme, CodePath mode, GridOrdering gridOrdering) |
Getting the complex grid output of pmePerformSolve() | |
PmeSolveOutput | gmx::test::pmeGetReciprocalEnergyAndVirial (const gmx_pme_t *pme, CodePath mode, PmeSolveAlgorithm method) |
Getting the reciprocal energy and virial. | |
Variables | |
constexpr gmx_int64_t | gmx::test::c_splineModuliSinglePrecisionUlps = 1 |
Spline moduli are computed in double precision, so they're very good in single precision. | |