Rename some paramters in nblib listed forces
authorejjordan <ejjordan@kth.se>
Mon, 7 Jun 2021 10:39:41 +0000 (12:39 +0200)
committerJoe Jordan <ejjordan12@gmail.com>
Mon, 7 Jun 2021 12:45:18 +0000 (12:45 +0000)
This is pure refactoring.
HarmonicAngleType -> HarmonicAngle
EquilDistance -> EquilConstant

14 files changed:
api/nblib/listed_forces/bondtypes.h
api/nblib/listed_forces/conversions.hpp
api/nblib/listed_forces/definitions.h
api/nblib/listed_forces/kernels.hpp
api/nblib/listed_forces/tests/calculator.cpp
api/nblib/listed_forces/tests/conversions.cpp
api/nblib/listed_forces/tests/helpers.cpp
api/nblib/listed_forces/tests/linear_chain_input.hpp
api/nblib/listed_forces/tests/transformations.cpp
api/nblib/listed_forces/tests/typetests.cpp
api/nblib/samples/methane-water-integration.cpp
api/nblib/tests/molecules.cpp
api/nblib/tests/testsystems.cpp
api/nblib/tests/topology.cpp

index cef684d822506f4e8bce05042aae18d29f7f3d0b..7e281c045272aaa7446bac0ad5951d921836f5e4 100644 (file)
@@ -61,13 +61,13 @@ namespace nblib
 {
 using Name          = std::string;
 using ForceConstant = real;
-using EquilDistance = real;
+using EquilConstant = real;
 using Exponent      = real;
 
 using Degrees = StrongType<real, struct DegreeParameter>;
 using Radians = StrongType<real, struct RadianParameter>;
 
-/*! \brief Basic template for interactions with 2 parameters named forceConstant and equilDistance
+/*! \brief Basic template for interactions with 2 parameters named forceConstant and equilConstant
  *
  * \tparam Phantom unused template parameter for type distinction
  *
@@ -81,36 +81,36 @@ class TwoParameterInteraction
 {
 public:
     TwoParameterInteraction() = default;
-    TwoParameterInteraction(ForceConstant f, EquilDistance d) : forceConstant_(f), equilDistance_(d)
+    TwoParameterInteraction(ForceConstant f, EquilConstant d) : forceConstant_(f), equilConstant_(d)
     {
     }
 
     [[nodiscard]] const ForceConstant& forceConstant() const { return forceConstant_; }
-    [[nodiscard]] const EquilDistance& equilDistance() const { return equilDistance_; }
+    [[nodiscard]] const EquilConstant& equilConstant() const { return equilConstant_; }
 
 private:
     ForceConstant forceConstant_;
-    EquilDistance equilDistance_;
+    EquilConstant equilConstant_;
 };
 
 template<class Phantom>
 inline bool operator<(const TwoParameterInteraction<Phantom>& a, const TwoParameterInteraction<Phantom>& b)
 {
-    return std::tie(a.forceConstant(), a.equilDistance())
-           < std::tie(b.forceConstant(), b.equilDistance());
+    return std::tie(a.forceConstant(), a.equilConstant())
+           < std::tie(b.forceConstant(), b.equilConstant());
 }
 
 template<class Phantom>
 inline bool operator==(const TwoParameterInteraction<Phantom>& a, const TwoParameterInteraction<Phantom>& b)
 {
-    return std::tie(a.forceConstant(), a.equilDistance())
-           == std::tie(b.forceConstant(), b.equilDistance());
+    return std::tie(a.forceConstant(), a.equilConstant())
+           == std::tie(b.forceConstant(), b.equilConstant());
 }
 
 /*! \brief harmonic bond type
  *
  *  It represents the interaction of the form
- *  V(r; forceConstant, equilDistance) = 0.5 * forceConstant * (r - equilDistance)^2
+ *  V(r, forceConstant, equilDistance) = 0.5 * forceConstant * (r - equilConstant)^2
  */
 using HarmonicBondType = TwoParameterInteraction<struct HarmonicBondTypeParameter>;
 
@@ -118,7 +118,7 @@ using HarmonicBondType = TwoParameterInteraction<struct HarmonicBondTypeParamete
 /*! \brief GROMOS bond type
  *
  * It represents the interaction of the form
- * V(r; forceConstant, equilDistance) = 0.25 * forceConstant * (r^2 - equilDistance^2)^2
+ * V(r, forceConstant, equilDistance) = 0.25 * forceConstant * (r^2 - equilConstant^2)^2
  */
 using G96BondType = TwoParameterInteraction<struct G96BondTypeParameter>;
 
@@ -126,7 +126,7 @@ using G96BondType = TwoParameterInteraction<struct G96BondTypeParameter>;
 /*! \brief FENE bond type
  *
  * It represents the interaction of the form
- * V(r; forceConstant, equilDistance) = - 0.5 * forceConstant * equilDistance^2 * log( 1 - (r / equilDistance)^2)
+ * V(r, forceConstant, equilConstant) = - 0.5 * forceConstant * equilDistance^2 * log( 1 - (r / equilConstant)^2)
  */
 using FENEBondType = TwoParameterInteraction<struct FENEBondTypeParameter>;
 
@@ -134,7 +134,7 @@ using FENEBondType = TwoParameterInteraction<struct FENEBondTypeParameter>;
 /*! \brief Half-attractive quartic bond type
  *
  * It represents the interaction of the form
- * V(r; forceConstant, equilDistance) = 0.5 * forceConstant * (r - equilDistance)^4
+ * V(r, forceConstant, equilConstant) = 0.5 * forceConstant * (r - equilConstant)^4
  */
 using HalfAttractiveQuarticBondType =
         TwoParameterInteraction<struct HalfAttractiveQuarticBondTypeParameter>;
@@ -143,13 +143,13 @@ using HalfAttractiveQuarticBondType =
 /*! \brief Cubic bond type
  *
  * It represents the interaction of the form
- * V(r; quadraticForceConstant, cubicForceConstant, equilDistance) = quadraticForceConstant * (r -
- * equilDistance)^2 + quadraticForceConstant * cubicForceConstant * (r - equilDistance)
+ * V(r, quadraticForceConstant, cubicForceConstant, equilConstant) = quadraticForceConstant * (r -
+ * equilConstant)^2 + quadraticForceConstant * cubicForceConstant * (r - equilDistance)
  */
 struct CubicBondType
 {
     CubicBondType() = default;
-    CubicBondType(ForceConstant fq, ForceConstant fc, EquilDistance d) :
+    CubicBondType(ForceConstant fq, ForceConstant fc, EquilConstant d) :
         quadraticForceConstant_(fq), cubicForceConstant_(fc), equilDistance_(d)
     {
     }
@@ -159,12 +159,12 @@ struct CubicBondType
         return quadraticForceConstant_;
     }
     [[nodiscard]] const ForceConstant& cubicForceConstant() const { return cubicForceConstant_; }
-    [[nodiscard]] const EquilDistance& equilDistance() const { return equilDistance_; }
+    [[nodiscard]] const EquilConstant& equilDistance() const { return equilDistance_; }
 
 private:
     ForceConstant quadraticForceConstant_;
     ForceConstant cubicForceConstant_;
-    EquilDistance equilDistance_;
+    EquilConstant equilDistance_;
 };
 
 inline bool operator<(const CubicBondType& a, const CubicBondType& b)
@@ -182,25 +182,25 @@ inline bool operator==(const CubicBondType& a, const CubicBondType& b)
 /*! \brief Morse bond type
  *
  * It represents the interaction of the form
- * V(r; forceConstant, exponent, equilDistance) = forceConstant * ( 1 - exp( -exponent * (r - equilDistance))
+ * V(r, forceConstant, exponent, equilDistance) = forceConstant * ( 1 - exp( -exponent * (r - equilConstant))
  */
 class MorseBondType
 {
 public:
     MorseBondType() = default;
-    MorseBondType(ForceConstant f, Exponent e, EquilDistance d) :
+    MorseBondType(ForceConstant f, Exponent e, EquilConstant d) :
         forceConstant_(f), exponent_(e), equilDistance_(d)
     {
     }
 
     [[nodiscard]] const ForceConstant& forceConstant() const { return forceConstant_; }
     [[nodiscard]] const Exponent&      exponent() const { return exponent_; }
-    [[nodiscard]] const EquilDistance& equilDistance() const { return equilDistance_; }
+    [[nodiscard]] const EquilConstant& equilDistance() const { return equilDistance_; }
 
 private:
     ForceConstant forceConstant_;
     Exponent      exponent_;
-    EquilDistance equilDistance_;
+    EquilConstant equilDistance_;
 };
 
 inline bool operator<(const MorseBondType& a, const MorseBondType& b)
@@ -220,17 +220,17 @@ inline bool operator==(const MorseBondType& a, const MorseBondType& b)
  *
  * Note: the angle is always stored as radians internally
  */
-struct HarmonicAngleType : public TwoParameterInteraction<struct HarmonicAngleTypeParameter>
+struct HarmonicAngle : public TwoParameterInteraction<struct HarmonicAngleTypeParameter>
 {
-    HarmonicAngleType() = default;
+    HarmonicAngle() = default;
     //! \brief construct from angle given in radians
-    HarmonicAngleType(Radians angle, ForceConstant f) :
+    HarmonicAngle(Radians angle, ForceConstant f) :
         TwoParameterInteraction<struct HarmonicAngleTypeParameter>{ f, angle }
     {
     }
 
     //! \brief construct from angle given in degrees
-    HarmonicAngleType(Degrees angle, ForceConstant f) :
+    HarmonicAngle(Degrees angle, ForceConstant f) :
         TwoParameterInteraction<struct HarmonicAngleTypeParameter>{ f, angle * DEG2RAD }
     {
     }
@@ -253,12 +253,12 @@ public:
     {
     }
 
-    [[nodiscard]] const EquilDistance& equilDistance() const { return phi_; }
+    [[nodiscard]] const EquilConstant& equilDistance() const { return phi_; }
     [[nodiscard]] const ForceConstant& forceConstant() const { return forceConstant_; }
     [[nodiscard]] const Multiplicity&  multiplicity() const { return multiplicity_; }
 
 private:
-    EquilDistance phi_;
+    EquilConstant phi_;
     ForceConstant forceConstant_;
     Multiplicity  multiplicity_;
 };
index c8319857405f9d2755d90089622a13b68f540e18..fc79786029c50462e71bdb26bf673eb0ee7bd4f1 100644 (file)
@@ -91,7 +91,7 @@ struct ListedIndex<G96BondType> : std::integral_constant<int, F_G96BONDS>
 };
 
 template<>
-struct ListedIndex<HarmonicAngleType> : std::integral_constant<int, F_ANGLES>
+struct ListedIndex<HarmonicAngle> : std::integral_constant<int, F_ANGLES>
 {
 };
 
@@ -131,19 +131,19 @@ void transferParameters(const ListedTypeData<HarmonicBondType>& interactions, gm
     {
         t_iparams param;
         param.harmonic.krA = hbond.forceConstant();
-        param.harmonic.rA  = hbond.equilDistance();
+        param.harmonic.rA  = hbond.equilConstant();
         gmx_params.iparams.push_back(param);
     }
 }
 
 template<>
-void transferParameters(const ListedTypeData<HarmonicAngleType>& interactions, gmx_ffparams_t& gmx_params)
+void transferParameters(const ListedTypeData<HarmonicAngle>& interactions, gmx_ffparams_t& gmx_params)
 {
     for (const auto& angle : interactions.parameters)
     {
         t_iparams param;
         param.harmonic.krA = angle.forceConstant();
-        param.harmonic.rA  = angle.equilDistance() / DEG2RAD;
+        param.harmonic.rA  = angle.equilConstant() / DEG2RAD;
         gmx_params.iparams.push_back(param);
     }
 }
index 04c1e10bd4ca2253be10721dace4bd5484fdca65..beb75a2a632fefad343e7fc3b9238805fa5fdb85 100644 (file)
@@ -67,7 +67,7 @@ namespace nblib
 
 using SupportedTwoCenterTypes =
         TypeList<HarmonicBondType, G96BondType, CubicBondType, FENEBondType, HalfAttractiveQuarticBondType>;
-using SupportedThreeCenterTypes = TypeList<HarmonicAngleType>;
+using SupportedThreeCenterTypes = TypeList<HarmonicAngle>;
 using SupportedFourCenterTypes = TypeList<ProperDihedral, ImproperDihedral, RyckaertBellemanDihedral>;
 using SupportedFiveCenterTypes = TypeList<Default5Center>;
 
index 94b6b4c33c601f6a81277833fe23e067badcdd79..1f5b339ea77da58cffa0dc92b292955dde3f6c7c 100644 (file)
@@ -114,7 +114,7 @@ inline std::tuple<T, T, T> harmonicScalarForce(T kA, T kB, T xA, T xB, T x, T la
 template <class T>
 inline auto bondKernel(T dr, const HarmonicBondType& bond)
 {
-    return harmonicScalarForce(bond.forceConstant(), bond.equilDistance(), dr);
+    return harmonicScalarForce(bond.forceConstant(), bond.equilConstant(), dr);
 }
 
 
@@ -177,8 +177,8 @@ inline std::tuple<T, T, T> g96ScalarForce(T kA, T kB, T xA, T xB, T x, T lambda)
 template <class T>
 inline auto bondKernel(T dr, const G96BondType& bond)
 {
-    // NOTE: Not assuming GROMACS' convention of storing squared bond.equilDistance() for this type
-    return g96ScalarForce(bond.forceConstant(), bond.equilDistance() * bond.equilDistance(), dr * dr);
+    // NOTE: Not assuming GROMACS' convention of storing squared bond.equilConstant() for this type
+    return g96ScalarForce(bond.forceConstant(), bond.equilConstant() * bond.equilConstant(), dr * dr);
 }
 
 
@@ -284,7 +284,7 @@ inline std::tuple<T, T> FENEScalarForce(T k, T x0, T x)
 template <class T>
 inline auto bondKernel(T dr, const FENEBondType& bond)
 {
-    return FENEScalarForce(bond.forceConstant(), bond.equilDistance(), dr);
+    return FENEScalarForce(bond.forceConstant(), bond.equilConstant(), dr);
 }
 
 
@@ -384,7 +384,7 @@ inline std::tuple<T, T, T> halfAttractiveScalarForce(T kA, T kB, T xA, T xB, T x
 template <class T>
 inline auto bondKernel(T dr, const HalfAttractiveQuarticBondType& bond)
 {
-    return halfAttractiveScalarForce(bond.forceConstant(), bond.equilDistance(), dr);
+    return halfAttractiveScalarForce(bond.forceConstant(), bond.equilConstant(), dr);
 }
 
 
@@ -396,9 +396,9 @@ inline auto bondKernel(T dr, const HalfAttractiveQuarticBondType& bond)
 //! Three-center interaction type dispatch
 
 template <class T>
-inline auto threeCenterKernel(T dr, const HarmonicAngleType& angle)
+inline auto threeCenterKernel(T dr, const HarmonicAngle& angle)
 {
-    return harmonicScalarForce(angle.forceConstant(), angle.equilDistance(), dr);
+    return harmonicScalarForce(angle.forceConstant(), angle.equilConstant(), dr);
 }
 
 
@@ -442,7 +442,7 @@ static inline real dihedralPhi(rvec dxIJ, rvec dxKJ, rvec dxKL, rvec m, rvec n)
 template <class T>
 inline auto fourCenterKernel(T phi, const ImproperDihedral& improperDihedral)
 {
-    T deltaPhi = phi - improperDihedral.equilDistance();
+    T deltaPhi = phi - improperDihedral.equilConstant();
     /* deltaPhi cannot be outside (-pi,pi) */
     makeAnglePeriodic(deltaPhi);
     const T force = -improperDihedral.forceConstant()  * deltaPhi;
index 4d94a33c2d33d655320c9a04f1c2a4b23bdd4c65..4093f00c2849a64ee1501dc74aa7e92904ebb211 100644 (file)
@@ -104,15 +104,15 @@ protected:
         // one bond between atoms 0-1 with bond1 parameters and another between atoms 1-2 with bond2 parameters
         std::vector<InteractionIndex<HarmonicBondType>> bondIndices{ { 0, 1, 0 }, { 1, 2, 1 } };
 
-        HarmonicAngleType                                angle(Degrees(108.53), 397.5);
-        std::vector<HarmonicAngleType>                   angles{ angle };
-        std::vector<InteractionIndex<HarmonicAngleType>> angleIndices{ { 0, 1, 2, 0 } };
+        HarmonicAngle                                angle(Degrees(108.53), 397.5);
+        std::vector<HarmonicAngle>                   angles{ angle };
+        std::vector<InteractionIndex<HarmonicAngle>> angleIndices{ { 0, 1, 2, 0 } };
 
         pickType<HarmonicBondType>(interactions).indices    = bondIndices;
         pickType<HarmonicBondType>(interactions).parameters = bonds;
 
-        pickType<HarmonicAngleType>(interactions).indices    = angleIndices;
-        pickType<HarmonicAngleType>(interactions).parameters = angles;
+        pickType<HarmonicAngle>(interactions).indices    = angleIndices;
+        pickType<HarmonicAngle>(interactions).parameters = angles;
 
         // initial position for the methanol atoms from the spc-water example
         x = std::vector<gmx::RVec>{ { 1.97, 1.46, 1.209 }, { 1.978, 1.415, 1.082 }, { 1.905, 1.46, 1.03 } };
@@ -153,8 +153,8 @@ TEST_F(ListedExampleData, ComputeHarmonicBondEnergies)
 
 TEST_F(ListedExampleData, ComputeHarmonicAngleForces)
 {
-    auto indices = pickType<HarmonicAngleType>(interactions).indices;
-    auto angles  = pickType<HarmonicAngleType>(interactions).parameters;
+    auto indices = pickType<HarmonicAngle>(interactions).indices;
+    auto angles  = pickType<HarmonicAngle>(interactions).parameters;
     computeForces(indices, angles, x, &forces, *pbc);
 
     RefDataChecker vector3DTest(1e-4);
index b7356059af86925a7b6a8f47bfc55c252f348e93..29dafc5099b0deeb40bb27b99cba28200bc38fa9 100644 (file)
@@ -65,16 +65,16 @@ ListedInteractionData someBondsAndAngles()
     std::vector<HarmonicBondType> bonds{ bond1, bond2 };
     pickType<HarmonicBondType>(interactions).parameters = bonds;
 
-    HarmonicAngleType              angle1(Degrees(100), 100);
-    HarmonicAngleType              angle2(Degrees(101), 200);
-    std::vector<HarmonicAngleType> angles{ angle1, angle2 };
-    pickType<HarmonicAngleType>(interactions).parameters = angles;
+    HarmonicAngle              angle1(Degrees(100), 100);
+    HarmonicAngle              angle2(Degrees(101), 200);
+    std::vector<HarmonicAngle> angles{ angle1, angle2 };
+    pickType<HarmonicAngle>(interactions).parameters = angles;
 
     std::vector<InteractionIndex<HarmonicBondType>> bondIndices{ { 0, 1, 0 }, { 1, 2, 0 }, { 2, 3, 1 } };
     pickType<HarmonicBondType>(interactions).indices = std::move(bondIndices);
 
-    std::vector<InteractionIndex<HarmonicAngleType>> angleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 1 } };
-    pickType<HarmonicAngleType>(interactions).indices = std::move(angleIndices);
+    std::vector<InteractionIndex<HarmonicAngle>> angleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 1 } };
+    pickType<HarmonicAngle>(interactions).indices = std::move(angleIndices);
 
     return interactions;
 }
@@ -87,9 +87,9 @@ TEST(ListedShims, ParameterConversion)
 
     EXPECT_EQ(gmx_params->iparams.size(), 4);
     EXPECT_EQ(gmx_params->iparams[0].harmonic.rA,
-              pickType<HarmonicBondType>(interactions).parameters[0].equilDistance());
+              pickType<HarmonicBondType>(interactions).parameters[0].equilConstant());
     EXPECT_REAL_EQ_TOL(gmx_params->iparams[2].harmonic.rA,
-                       pickType<HarmonicAngleType>(interactions).parameters[0].equilDistance() / DEG2RAD,
+                       pickType<HarmonicAngle>(interactions).parameters[0].equilConstant() / DEG2RAD,
                        gmx::test::defaultRealTolerance());
 
     EXPECT_EQ(idef->il[F_BONDS].iatoms.size(), 9);
index 87f16ff9f04e1848067021646d36dc8263e53e42..22fde45d78cc318c6d784074f95ea94e76f86db9 100644 (file)
@@ -62,8 +62,8 @@ TEST(NBlibTest, CanSplitListedWork)
 {
     ListedInteractionData interactions;
 
-    HarmonicAngleType angle(Degrees(1), 1);
-    HarmonicBondType  bond(1, 1);
+    HarmonicAngle    angle(Degrees(1), 1);
+    HarmonicBondType bond(1, 1);
 
     int largestIndex = 20;
     int nSplits      = 3; // split ranges: [0,5], [6,11], [12, 19]
@@ -71,30 +71,30 @@ TEST(NBlibTest, CanSplitListedWork)
     std::vector<InteractionIndex<HarmonicBondType>> bondIndices{
         { 0, 1, 0 }, { 0, 6, 0 }, { 11, 12, 0 }, { 18, 19, 0 }
     };
-    std::vector<InteractionIndex<HarmonicAngleType>> angleIndices{
+    std::vector<InteractionIndex<HarmonicAngle>> angleIndices{
         { 0, 1, 2, 0 }, { 0, 6, 7, 0 }, { 11, 12, 13, 0 }, { 17, 19, 18, 0 }
     };
 
-    pickType<HarmonicBondType>(interactions).indices  = bondIndices;
-    pickType<HarmonicAngleType>(interactions).indices = angleIndices;
+    pickType<HarmonicBondType>(interactions).indices = bondIndices;
+    pickType<HarmonicAngle>(interactions).indices    = angleIndices;
 
     std::vector<ListedInteractionData> splitInteractions =
             splitListedWork(interactions, largestIndex, nSplits);
 
     std::vector<InteractionIndex<HarmonicBondType>> refBondIndices0{ { 0, 1, 0 }, { 0, 6, 0 } };
-    std::vector<InteractionIndex<HarmonicAngleType>> refAngleIndices0{ { 0, 1, 2, 0 }, { 0, 6, 7, 0 } };
-    std::vector<InteractionIndex<HarmonicBondType>>  refBondIndices1{ { 11, 12, 0 } };
-    std::vector<InteractionIndex<HarmonicAngleType>> refAngleIndices1{ { 11, 12, 13, 0 } };
-    std::vector<InteractionIndex<HarmonicBondType>>  refBondIndices2{ { 18, 19, 0 } };
-    std::vector<InteractionIndex<HarmonicAngleType>> refAngleIndices2{ { 17, 19, 18, 0 } };
+    std::vector<InteractionIndex<HarmonicAngle>> refAngleIndices0{ { 0, 1, 2, 0 }, { 0, 6, 7, 0 } };
+    std::vector<InteractionIndex<HarmonicBondType>> refBondIndices1{ { 11, 12, 0 } };
+    std::vector<InteractionIndex<HarmonicAngle>>    refAngleIndices1{ { 11, 12, 13, 0 } };
+    std::vector<InteractionIndex<HarmonicBondType>> refBondIndices2{ { 18, 19, 0 } };
+    std::vector<InteractionIndex<HarmonicAngle>>    refAngleIndices2{ { 17, 19, 18, 0 } };
 
     EXPECT_EQ(refBondIndices0, pickType<HarmonicBondType>(splitInteractions[0]).indices);
     EXPECT_EQ(refBondIndices1, pickType<HarmonicBondType>(splitInteractions[1]).indices);
     EXPECT_EQ(refBondIndices2, pickType<HarmonicBondType>(splitInteractions[2]).indices);
 
-    EXPECT_EQ(refAngleIndices0, pickType<HarmonicAngleType>(splitInteractions[0]).indices);
-    EXPECT_EQ(refAngleIndices1, pickType<HarmonicAngleType>(splitInteractions[1]).indices);
-    EXPECT_EQ(refAngleIndices2, pickType<HarmonicAngleType>(splitInteractions[2]).indices);
+    EXPECT_EQ(refAngleIndices0, pickType<HarmonicAngle>(splitInteractions[0]).indices);
+    EXPECT_EQ(refAngleIndices1, pickType<HarmonicAngle>(splitInteractions[1]).indices);
+    EXPECT_EQ(refAngleIndices2, pickType<HarmonicAngle>(splitInteractions[2]).indices);
 }
 
 
index e00aaeb18977a3f350442a79caf3ba183639fd90..05dc6480d6ca4f790d597c3670d6b88f2cc1b8e4 100644 (file)
@@ -63,9 +63,9 @@ public:
         std::vector<HarmonicBondType> bonds{ bond1, bond2 };
         pickType<HarmonicBondType>(interactions).parameters = bonds;
 
-        HarmonicAngleType              angle(Degrees(179.9), 397.5);
-        std::vector<HarmonicAngleType> angles{ angle };
-        pickType<HarmonicAngleType>(interactions).parameters = angles;
+        HarmonicAngle              angle(Degrees(179.9), 397.5);
+        std::vector<HarmonicAngle> angles{ angle };
+        pickType<HarmonicAngle>(interactions).parameters = angles;
 
         std::vector<InteractionIndex<HarmonicBondType>> bondIndices;
         for (int i = 0; i < nParticles - 1; ++i)
@@ -75,12 +75,12 @@ public:
         }
         pickType<HarmonicBondType>(interactions).indices = bondIndices;
 
-        std::vector<InteractionIndex<HarmonicAngleType>> angleIndices;
+        std::vector<InteractionIndex<HarmonicAngle>> angleIndices;
         for (int i = 0; i < nParticles - 2; ++i)
         {
-            angleIndices.push_back(InteractionIndex<HarmonicAngleType>{ i, i + 1, i + 2, 0 });
+            angleIndices.push_back(InteractionIndex<HarmonicAngle>{ i, i + 1, i + 2, 0 });
         }
-        pickType<HarmonicAngleType>(interactions).indices = angleIndices;
+        pickType<HarmonicAngle>(interactions).indices = angleIndices;
 
         // initialize coordinates
         x.resize(nParticles);
index 31aa3455873673325d0a94a78024c765e820e0a3..d6d60bb2770f1552047ed8d09d3a6fa680ebfe3a 100644 (file)
@@ -65,8 +65,8 @@ ListedInteractionData unsortedInteractions()
     std::vector<InteractionIndex<HarmonicBondType>> bondIndices{ { 0, 2, 0 }, { 0, 1, 0 } };
     pickType<HarmonicBondType>(interactions).indices = std::move(bondIndices);
 
-    std::vector<InteractionIndex<HarmonicAngleType>> angleIndices{ { 0, 1, 2, 0 }, { 1, 0, 2, 0 } };
-    pickType<HarmonicAngleType>(interactions).indices = std::move(angleIndices);
+    std::vector<InteractionIndex<HarmonicAngle>> angleIndices{ { 0, 1, 2, 0 }, { 1, 0, 2, 0 } };
+    pickType<HarmonicAngle>(interactions).indices = std::move(angleIndices);
 
     std::vector<InteractionIndex<ProperDihedral>> dihedralIndices{ { 0, 2, 1, 3, 0 }, { 0, 1, 2, 3, 0 } };
     pickType<ProperDihedral>(interactions).indices = std::move(dihedralIndices);
@@ -80,12 +80,12 @@ TEST(ListedTransformations, SortInteractionIndices)
     sortInteractions(interactions);
 
     std::vector<InteractionIndex<HarmonicBondType>> refBondIndices{ { 0, 1, 0 }, { 0, 2, 0 } };
-    std::vector<InteractionIndex<HarmonicAngleType>> refAngleIndices{ { 1, 0, 2, 0 }, { 0, 1, 2, 0 } };
-    std::vector<InteractionIndex<ProperDihedral>>    refDihedralIndices{ { 0, 1, 2, 3, 0 },
+    std::vector<InteractionIndex<HarmonicAngle>>  refAngleIndices{ { 1, 0, 2, 0 }, { 0, 1, 2, 0 } };
+    std::vector<InteractionIndex<ProperDihedral>> refDihedralIndices{ { 0, 1, 2, 3, 0 },
                                                                       { 0, 2, 1, 3, 0 } };
 
     EXPECT_EQ(pickType<HarmonicBondType>(interactions).indices, refBondIndices);
-    EXPECT_EQ(pickType<HarmonicAngleType>(interactions).indices, refAngleIndices);
+    EXPECT_EQ(pickType<HarmonicAngle>(interactions).indices, refAngleIndices);
     EXPECT_EQ(pickType<ProperDihedral>(interactions).indices, refDihedralIndices);
 }
 
index cbca8eb3ed66c0ca54d0236013d3f5e79572adc0..83d3610e75ff2610006a0d1e7164577f447ebe6b 100644 (file)
@@ -63,9 +63,8 @@ std::vector<InteractionIndex<HarmonicBondType>> c_HarmonicBondIndices{ { 0, 1, 0
 std::vector<std::vector<HarmonicBondType>> c_InputHarmonicBond = { { HarmonicBondType(500, 0.15) } };
 
 // Parameters for harmonic angles
-std::vector<InteractionIndex<HarmonicAngleType>> c_HarmonicAngleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 0 } };
-std::vector<std::vector<HarmonicAngleType>> c_InputHarmonicAngle = { { HarmonicAngleType(Degrees(100),
-                                                                                         50.0) } };
+std::vector<InteractionIndex<HarmonicAngle>> c_HarmonicAngleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 0 } };
+std::vector<std::vector<HarmonicAngle>> c_InputHarmonicAngle = { { HarmonicAngle(Degrees(100), 50.0) } };
 
 //! Function types for testing dihedrals. Add new terms at the end.
 std::vector<std::vector<ProperDihedral>> c_InputDihs = { { { ProperDihedral(Degrees(-105.0), 15.0, 2) } } /*, { ImproperDihedral(100.0, 50.0) }*/ };
@@ -167,10 +166,10 @@ INSTANTIATE_TEST_CASE_P(TwoCenter,
                                            ::testing::ValuesIn(c_coordinatesForTests)));
 
 class HarmonicAngleTest :
-    public ListedForcesBase<HarmonicAngleType>,
-    public testing::TestWithParam<std::tuple<std::vector<HarmonicAngleType>, std::vector<gmx::RVec>>>
+    public ListedForcesBase<HarmonicAngle>,
+    public testing::TestWithParam<std::tuple<std::vector<HarmonicAngle>, std::vector<gmx::RVec>>>
 {
-    using Base = ListedForcesBase<HarmonicAngleType>;
+    using Base = ListedForcesBase<HarmonicAngle>;
 
 public:
     HarmonicAngleTest() :
index e574fea72e516a2c3c57a99a92f99f22bbae4c08..8012de656b24d31d72ef7cbcc360eae4dc44f582 100644 (file)
@@ -96,8 +96,8 @@ int main()
     HarmonicBondType ohHarmonicBond(1, 1);
     HarmonicBondType hcHarmonicBond(2, 1);
 
-    HarmonicAngleType hohAngle(Degrees(120), 1);
-    HarmonicAngleType hchAngle(Degrees(109.5), 1);
+    HarmonicAngle hohAngle(Degrees(120), 1);
+    HarmonicAngle hchAngle(Degrees(109.5), 1);
 
     // add harmonic bonds for water
     water.addInteraction(ParticleName("O"), ParticleName("H1"), ohHarmonicBond);
index a63cadcd16a532e612d10f16d7783310acf07cbe..d4fb155d0e09de59e494f8ea1f1e832087d44c5e 100644 (file)
@@ -193,9 +193,9 @@ TEST(NBlibTest, CanAddInteractions)
     molecule.addParticle(ParticleName("H1"), H);
     molecule.addParticle(ParticleName("H2"), H);
 
-    HarmonicBondType  hb(1, 2);
-    CubicBondType     cub(1, 2, 3);
-    HarmonicAngleType ang(Degrees(1), 1);
+    HarmonicBondType hb(1, 2);
+    CubicBondType    cub(1, 2, 3);
+    HarmonicAngle    ang(Degrees(1), 1);
 
     molecule.addInteraction(ParticleName("O"), ParticleName("H1"), hb);
     molecule.addInteraction(ParticleName("O"), ParticleName("H2"), hb);
@@ -209,7 +209,7 @@ TEST(NBlibTest, CanAddInteractions)
     //! cubic bonds
     EXPECT_EQ(pickType<CubicBondType>(interactionData).interactions_.size(), 1);
     //! angular interactions
-    EXPECT_EQ(pickType<HarmonicAngleType>(interactionData).interactions_.size(), 1);
+    EXPECT_EQ(pickType<HarmonicAngle>(interactionData).interactions_.size(), 1);
 }
 
 } // namespace
index 1559f73293b9b14685b7792e64f8f3c2be8bb40f..db9ca65893e5fb3fd3631470fafb7e66fafe99fe 100644 (file)
@@ -166,7 +166,7 @@ MethanolMoleculeBuilder::MethanolMoleculeBuilder() : methanol_(MoleculeName("MeO
     HarmonicBondType ometBond(1.1, 1.2);
     methanol_.addInteraction(ParticleName("O2"), ParticleName("Me1"), ometBond);
 
-    HarmonicAngleType ochAngle(Degrees(108.52), 397.5);
+    HarmonicAngle ochAngle(Degrees(108.52), 397.5);
     methanol_.addInteraction(ParticleName("O2"), ParticleName("Me1"), ParticleName("H3"), ochAngle);
 }
 
index ff4d0336d929edc9eaa0e3c2af468a7d70628dfa..b29a33da68558d8aa6c12d0429ee0e01c4d1c5b3 100644 (file)
@@ -366,8 +366,8 @@ TEST(NBlibTest, TopologyListedInteractionsMultipleTypes)
     Molecule water    = WaterMoleculeBuilder{}.waterMolecule();
     Molecule methanol = MethanolMoleculeBuilder{}.methanolMolecule();
 
-    CubicBondType     testBond(1., 1., 1.);
-    HarmonicAngleType testAngle(Degrees(1), 1);
+    CubicBondType testBond(1., 1., 1.);
+    HarmonicAngle testAngle(Degrees(1), 1);
 
     water.addInteraction(ParticleName("H1"), ParticleName("H2"), testBond);
     water.addInteraction(ParticleName("H1"), ParticleName("Oxygen"), ParticleName("H2"), testAngle);
@@ -389,7 +389,7 @@ TEST(NBlibTest, TopologyListedInteractionsMultipleTypes)
     auto  interactionData   = topology.getInteractionData();
     auto& harmonicBonds     = pickType<HarmonicBondType>(interactionData);
     auto& cubicBonds        = pickType<CubicBondType>(interactionData);
-    auto& angleInteractions = pickType<HarmonicAngleType>(interactionData);
+    auto& angleInteractions = pickType<HarmonicAngle>(interactionData);
 
     HarmonicBondType              ohBond(1., 1.);
     HarmonicBondType              ohBondMethanol(1.01, 1.02);
@@ -413,9 +413,9 @@ TEST(NBlibTest, TopologyListedInteractionsMultipleTypes)
     EXPECT_EQ(cubicBondsReference, cubicBonds.parameters);
     EXPECT_EQ(cubicIndicesReference, cubicBonds.indices);
 
-    HarmonicAngleType                                methanolAngle(Degrees(108.52), 397.5);
-    std::vector<HarmonicAngleType>                   angleReference{ testAngle, methanolAngle };
-    std::vector<InteractionIndex<HarmonicAngleType>> angleIndicesReference{
+    HarmonicAngle                                methanolAngle(Degrees(108.52), 397.5);
+    std::vector<HarmonicAngle>                   angleReference{ testAngle, methanolAngle };
+    std::vector<InteractionIndex<HarmonicAngle>> angleIndicesReference{
         { std::min(H1, H2), Ow, std::max(H1, H2), 0 }, { std::min(MeH1, MeO1), Me1, std::max(MeO1, MeH1), 1 }
     };
     EXPECT_EQ(angleReference, angleInteractions.parameters);