Gromacs  2025.0-dev-20241009-5c23d5f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions | Variables
gmx::test::anonymous_namespace{bonded.cpp} Namespace Reference

Classes

struct  OutputQuantities
 Output from bonded kernels. More...
 
struct  iListInput
 Input structure for listed forces tests. More...
 

Functions

void checkOutput (TestReferenceChecker *checker, const OutputQuantities &output, const BondedKernelFlavor bondedKernelFlavor)
 Utility to check the output from bonded tests. More...
 
std::ostream & operator<< (std::ostream &out, const iListInput &input)
 Prints the interaction and parameters to a stream.
 
void fillIatoms (int ftype, std::vector< t_iatom > *iatoms)
 Utility to fill iatoms struct. More...
 

Variables

constexpr int c_numAtoms = 4
 Number of atoms used in these tests.
 
std::vector< iListInputc_InputBonds
 Function types for testing bonds. Add new terms at the end. More...
 
const real cQuarticAngles [5] = { 1.1, 2.3, 4.6, 7.8, 9.2 }
 Constants for Quartic Angles.
 
std::vector< iListInputc_InputAngles
 Function types for testing angles. Add new terms at the end. More...
 
const real rbcA [NR_RBDIHS] = { -5.35, 13.6, 8.4, -16.7, 0.3, 12.4 }
 Constants for Ryckaert-Bellemans A.
 
const real rbcB [NR_RBDIHS] = { -6.35, 12.6, 8.1, -10.7, 0.9, 15.4 }
 Constants for Ryckaert-Bellemans B.
 
const real rbc [NR_RBDIHS] = { -7.35, 13.6, 8.4, -16.7, 1.3, 12.4 }
 Constants for Ryckaert-Bellemans without FEP.
 
std::vector< iListInputc_InputDihs
 Function types for testing dihedrals. Add new terms at the end. More...
 
std::vector< iListInputc_InputPols
 Function types for testing polarization. Add new terms at the end. More...
 
std::vector< iListInputc_InputRestraints
 Function types for testing polarization. Add new terms at the end. More...
 
std::vector< iListInputc_InputBondsZeroLength
 Function types for testing bond with zero length, has zero reference length to make physical sense. More...
 
std::vector< iListInputc_InputAnglesZeroAngle
 Function types for testing angles with zero angle, has zero reference angle to make physical sense. More...
 
std::vector< PaddedVector< RVec > > c_coordinatesForTests
 Coordinates for testing. More...
 
std::vector< PaddedVector< RVec > > c_coordinatesForTestsZeroBondLength
 Coordinates for testing bonds with zero length. More...
 
std::vector< PaddedVector< RVec > > c_coordinatesForTestsZeroAngle
 Coordinates for testing bonds with zero length. More...
 
std::vector< PbcTypec_pbcForTests = { PbcType::No, PbcType::XY, PbcType::Xyz }
 PBC values for testing.
 

Function Documentation

void gmx::test::anonymous_namespace{bonded.cpp}::checkOutput ( TestReferenceChecker *  checker,
const OutputQuantities &  output,
const BondedKernelFlavor  bondedKernelFlavor 
)

Utility to check the output from bonded tests.

Parameters
[in]checkerReference checker
[in]outputThe output from the test to check
[in]bondedKernelFlavorFlavor for determining what output to check
void gmx::test::anonymous_namespace{bonded.cpp}::fillIatoms ( int  ftype,
std::vector< t_iatom > *  iatoms 
)

Utility to fill iatoms struct.

Parameters
[in]ftypeFunction type
[out]iatomsPointer to iatoms struct

Variable Documentation

std::vector<PaddedVector<RVec> > gmx::test::anonymous_namespace{bonded.cpp}::c_coordinatesForTests
Initial value:
= {
{ { 1.382, 1.573, 1.482 }, { 1.281, 1.559, 1.596 }, { 1.292, 1.422, 1.663 }, { 1.189, 1.407, 1.775 } }
}

Coordinates for testing.

Taken from a butane molecule, so we have some normal-sized bonds and angles to test.

Todo:
Test also some weirder values
std::vector<PaddedVector<RVec> > gmx::test::anonymous_namespace{bonded.cpp}::c_coordinatesForTestsZeroAngle
Initial value:
= {
{ { 0.005, 0.0, 0.1 }, { 0.0, 0.0, 0.0 }, { 0.005, 0.0, 0.1 }, { 0.5, 0.18, 0.22 } }
}

Coordinates for testing bonds with zero length.

std::vector<PaddedVector<RVec> > gmx::test::anonymous_namespace{bonded.cpp}::c_coordinatesForTestsZeroBondLength
Initial value:
= {
{ { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 }, { 0.005, 0.0, 0.1 }, { 0.005, 0.0, 0.1 } }
}

Coordinates for testing bonds with zero length.

std::vector<iListInput> gmx::test::anonymous_namespace{bonded.cpp}::c_InputAngles
Initial value:
= {
{ iListInput(2e-3, 1e-8).setHarmonic(F_ANGLES, 100.0, 50.0) },
{ iListInput(2e-3, 1e-8).setHarmonic(F_ANGLES, 100.15, 50.0, 95.0, 30.0) },
{ iListInput(8e-3, 1e-8).setHarmonic(F_G96ANGLES, 100.0, 50.0) },
{ iListInput(8e-3, 1e-8).setHarmonic(F_G96ANGLES, 100.0, 50.0, 95.0, 30.0) },
{ iListInput().setLinearAngle(50.0, 0.4) },
{ iListInput().setLinearAngle(50.0, 0.4, 40.0, 0.6) },
{ iListInput(2e-6, 1e-8).setCrossBondBonds(0.8, 0.7, 45.0) },
{ iListInput(3e-6, 1e-8).setCrossBondAngles(0.8, 0.7, 0.3, 45.0) },
{ iListInput(2e-2, 1e-8).setUreyBradley(950.0, 46.0, 0.3, 5.0) },
{ iListInput(2e-2, 1e-8).setUreyBradley(100.0, 45.0, 0.3, 5.0, 90.0, 47.0, 0.32, 7.0) },
{ iListInput(2e-3, 1e-8).setQuarticAngles(87.0, cQuarticAngles) }
}
const real cQuarticAngles[5]
Constants for Quartic Angles.
Definition: bonded.cpp:680

Function types for testing angles. Add new terms at the end.

std::vector<iListInput> gmx::test::anonymous_namespace{bonded.cpp}::c_InputAnglesZeroAngle
Initial value:
= {
{ iListInput(2e-3, 1e-8).setHarmonic(F_ANGLES, 0.0, 50.0) },
}

Function types for testing angles with zero angle, has zero reference angle to make physical sense.

std::vector<iListInput> gmx::test::anonymous_namespace{bonded.cpp}::c_InputBonds
Initial value:
= {
{ iListInput(2e-6F, 1e-8).setHarmonic(F_BONDS, 0.15, 500.0) },
{ iListInput(2e-6F, 1e-8).setHarmonic(F_BONDS, 0.15, 500.0, 0.17, 400.0) },
{ iListInput(1e-4F, 1e-8).setHarmonic(F_G96BONDS, 0.15, 50.0) },
{ iListInput().setHarmonic(F_G96BONDS, 0.15, 50.0, 0.17, 40.0) },
{ iListInput().setCubic(0.16, 50.0, 2.0) },
{ iListInput(2e-6F, 1e-8).setMorse(0.15, 50.0, 2.0, 0.17, 40.0, 1.6) },
{ iListInput(2e-6F, 1e-8).setMorse(0.15, 30.0, 2.7) },
{ iListInput().setFene(0.4, 5.0) }
}

Function types for testing bonds. Add new terms at the end.

std::vector<iListInput> gmx::test::anonymous_namespace{bonded.cpp}::c_InputBondsZeroLength
Initial value:
= {
{ iListInput().setHarmonic(F_BONDS, 0.0, 500.0) },
}

Function types for testing bond with zero length, has zero reference length to make physical sense.

std::vector<iListInput> gmx::test::anonymous_namespace{bonded.cpp}::c_InputDihs
Initial value:
= {
{ iListInput(5e-4, 1e-8).setPDihedrals(F_PDIHS, -100.0, 10.0, 2, -80.0, 20.0) },
{ iListInput(1e-4, 1e-8).setPDihedrals(F_PDIHS, -105.0, 15.0, 2) },
{ iListInput(2e-4, 1e-8).setHarmonic(F_IDIHS, 100.0, 50.0) },
{ iListInput(2e-4, 1e-8).setHarmonic(F_IDIHS, 100.15, 50.0, 95.0, 30.0) },
{ iListInput(4e-4, 1e-8).setRbDihedrals(rbcA, rbcB) },
{ iListInput(4e-4, 1e-8).setRbDihedrals(rbc) }
}
const real rbc[NR_RBDIHS]
Constants for Ryckaert-Bellemans without FEP.
Definition: bonded.cpp:704
const real rbcA[NR_RBDIHS]
Constants for Ryckaert-Bellemans A.
Definition: bonded.cpp:698
const real rbcB[NR_RBDIHS]
Constants for Ryckaert-Bellemans B.
Definition: bonded.cpp:701

Function types for testing dihedrals. Add new terms at the end.

std::vector<iListInput> gmx::test::anonymous_namespace{bonded.cpp}::c_InputPols
Initial value:
= {
{ iListInput(2e-5, 1e-8).setPolarization(0.12) },
{ iListInput(2e-3, 1e-8).setAnharmPolarization(0.0013, 0.02, 1235.6) },
{ iListInput(1.4e-3, 1e-8).setTholePolarization(0.26, 0.07, 0.09) },
{ iListInput(2e-3, 1e-8).setWaterPolarization(0.001, 0.0012, 0.0016, 0.095, 0.15, 0.02) },
}

Function types for testing polarization. Add new terms at the end.

std::vector<iListInput> gmx::test::anonymous_namespace{bonded.cpp}::c_InputRestraints
Initial value:
= {
{ iListInput(1e-4, 1e-8).setPDihedrals(F_ANGRES, -100.0, 10.0, 2, -80.0, 20.0) },
{ iListInput(1e-4, 1e-8).setPDihedrals(F_ANGRES, -105.0, 15.0, 2) },
{ iListInput(1e-4, 1e-8).setPDihedrals(F_ANGRESZ, -100.0, 10.0, 2, -80.0, 20.0) },
{ iListInput(1e-4, 1e-8).setPDihedrals(F_ANGRESZ, -105.0, 15.0, 2) },
{ iListInput(2e-3, 1e-8).setHarmonic(F_RESTRANGLES, 100.0, 50.0) },
{ iListInput(2e-3, 1e-8).setHarmonic(F_RESTRANGLES, 100.0, 50.0, 110.0, 45.0) }
}

Function types for testing polarization. Add new terms at the end.