From: ejjordan Date: Mon, 7 Jun 2021 10:39:41 +0000 (+0200) Subject: Rename some paramters in nblib listed forces X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=140eb6c6cc68bb0ab780912d7a184012cb2f3c98;p=alexxy%2Fgromacs.git Rename some paramters in nblib listed forces This is pure refactoring. HarmonicAngleType -> HarmonicAngle EquilDistance -> EquilConstant --- diff --git a/api/nblib/listed_forces/bondtypes.h b/api/nblib/listed_forces/bondtypes.h index cef684d822..7e281c0452 100644 --- a/api/nblib/listed_forces/bondtypes.h +++ b/api/nblib/listed_forces/bondtypes.h @@ -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; using Radians = StrongType; -/*! \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 inline bool operator<(const TwoParameterInteraction& a, const TwoParameterInteraction& 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 inline bool operator==(const TwoParameterInteraction& a, const TwoParameterInteraction& 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; @@ -118,7 +118,7 @@ using HarmonicBondType = TwoParameterInteraction; @@ -126,7 +126,7 @@ using G96BondType = TwoParameterInteraction; /*! \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; @@ -134,7 +134,7 @@ using FENEBondType = TwoParameterInteraction; /*! \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; @@ -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 HarmonicAngle : public TwoParameterInteraction { - HarmonicAngleType() = default; + HarmonicAngle() = default; //! \brief construct from angle given in radians - HarmonicAngleType(Radians angle, ForceConstant f) : + HarmonicAngle(Radians angle, ForceConstant f) : TwoParameterInteraction{ f, angle } { } //! \brief construct from angle given in degrees - HarmonicAngleType(Degrees angle, ForceConstant f) : + HarmonicAngle(Degrees angle, ForceConstant f) : TwoParameterInteraction{ 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_; }; diff --git a/api/nblib/listed_forces/conversions.hpp b/api/nblib/listed_forces/conversions.hpp index c831985740..fc79786029 100644 --- a/api/nblib/listed_forces/conversions.hpp +++ b/api/nblib/listed_forces/conversions.hpp @@ -91,7 +91,7 @@ struct ListedIndex : std::integral_constant }; template<> -struct ListedIndex : std::integral_constant +struct ListedIndex : std::integral_constant { }; @@ -131,19 +131,19 @@ void transferParameters(const ListedTypeData& 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& interactions, gmx_ffparams_t& gmx_params) +void transferParameters(const ListedTypeData& 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); } } diff --git a/api/nblib/listed_forces/definitions.h b/api/nblib/listed_forces/definitions.h index 04c1e10bd4..beb75a2a63 100644 --- a/api/nblib/listed_forces/definitions.h +++ b/api/nblib/listed_forces/definitions.h @@ -67,7 +67,7 @@ namespace nblib using SupportedTwoCenterTypes = TypeList; -using SupportedThreeCenterTypes = TypeList; +using SupportedThreeCenterTypes = TypeList; using SupportedFourCenterTypes = TypeList; using SupportedFiveCenterTypes = TypeList; diff --git a/api/nblib/listed_forces/kernels.hpp b/api/nblib/listed_forces/kernels.hpp index 94b6b4c33c..1f5b339ea7 100644 --- a/api/nblib/listed_forces/kernels.hpp +++ b/api/nblib/listed_forces/kernels.hpp @@ -114,7 +114,7 @@ inline std::tuple harmonicScalarForce(T kA, T kB, T xA, T xB, T x, T la template 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 g96ScalarForce(T kA, T kB, T xA, T xB, T x, T lambda) template 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 FENEScalarForce(T k, T x0, T x) template 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 halfAttractiveScalarForce(T kA, T kB, T xA, T xB, T x template 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 -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 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; diff --git a/api/nblib/listed_forces/tests/calculator.cpp b/api/nblib/listed_forces/tests/calculator.cpp index 4d94a33c2d..4093f00c28 100644 --- a/api/nblib/listed_forces/tests/calculator.cpp +++ b/api/nblib/listed_forces/tests/calculator.cpp @@ -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> bondIndices{ { 0, 1, 0 }, { 1, 2, 1 } }; - HarmonicAngleType angle(Degrees(108.53), 397.5); - std::vector angles{ angle }; - std::vector> angleIndices{ { 0, 1, 2, 0 } }; + HarmonicAngle angle(Degrees(108.53), 397.5); + std::vector angles{ angle }; + std::vector> angleIndices{ { 0, 1, 2, 0 } }; pickType(interactions).indices = bondIndices; pickType(interactions).parameters = bonds; - pickType(interactions).indices = angleIndices; - pickType(interactions).parameters = angles; + pickType(interactions).indices = angleIndices; + pickType(interactions).parameters = angles; // initial position for the methanol atoms from the spc-water example x = std::vector{ { 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(interactions).indices; - auto angles = pickType(interactions).parameters; + auto indices = pickType(interactions).indices; + auto angles = pickType(interactions).parameters; computeForces(indices, angles, x, &forces, *pbc); RefDataChecker vector3DTest(1e-4); diff --git a/api/nblib/listed_forces/tests/conversions.cpp b/api/nblib/listed_forces/tests/conversions.cpp index b7356059af..29dafc5099 100644 --- a/api/nblib/listed_forces/tests/conversions.cpp +++ b/api/nblib/listed_forces/tests/conversions.cpp @@ -65,16 +65,16 @@ ListedInteractionData someBondsAndAngles() std::vector bonds{ bond1, bond2 }; pickType(interactions).parameters = bonds; - HarmonicAngleType angle1(Degrees(100), 100); - HarmonicAngleType angle2(Degrees(101), 200); - std::vector angles{ angle1, angle2 }; - pickType(interactions).parameters = angles; + HarmonicAngle angle1(Degrees(100), 100); + HarmonicAngle angle2(Degrees(101), 200); + std::vector angles{ angle1, angle2 }; + pickType(interactions).parameters = angles; std::vector> bondIndices{ { 0, 1, 0 }, { 1, 2, 0 }, { 2, 3, 1 } }; pickType(interactions).indices = std::move(bondIndices); - std::vector> angleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 1 } }; - pickType(interactions).indices = std::move(angleIndices); + std::vector> angleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 1 } }; + pickType(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(interactions).parameters[0].equilDistance()); + pickType(interactions).parameters[0].equilConstant()); EXPECT_REAL_EQ_TOL(gmx_params->iparams[2].harmonic.rA, - pickType(interactions).parameters[0].equilDistance() / DEG2RAD, + pickType(interactions).parameters[0].equilConstant() / DEG2RAD, gmx::test::defaultRealTolerance()); EXPECT_EQ(idef->il[F_BONDS].iatoms.size(), 9); diff --git a/api/nblib/listed_forces/tests/helpers.cpp b/api/nblib/listed_forces/tests/helpers.cpp index 87f16ff9f0..22fde45d78 100644 --- a/api/nblib/listed_forces/tests/helpers.cpp +++ b/api/nblib/listed_forces/tests/helpers.cpp @@ -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> bondIndices{ { 0, 1, 0 }, { 0, 6, 0 }, { 11, 12, 0 }, { 18, 19, 0 } }; - std::vector> angleIndices{ + std::vector> angleIndices{ { 0, 1, 2, 0 }, { 0, 6, 7, 0 }, { 11, 12, 13, 0 }, { 17, 19, 18, 0 } }; - pickType(interactions).indices = bondIndices; - pickType(interactions).indices = angleIndices; + pickType(interactions).indices = bondIndices; + pickType(interactions).indices = angleIndices; std::vector splitInteractions = splitListedWork(interactions, largestIndex, nSplits); std::vector> refBondIndices0{ { 0, 1, 0 }, { 0, 6, 0 } }; - std::vector> refAngleIndices0{ { 0, 1, 2, 0 }, { 0, 6, 7, 0 } }; - std::vector> refBondIndices1{ { 11, 12, 0 } }; - std::vector> refAngleIndices1{ { 11, 12, 13, 0 } }; - std::vector> refBondIndices2{ { 18, 19, 0 } }; - std::vector> refAngleIndices2{ { 17, 19, 18, 0 } }; + std::vector> refAngleIndices0{ { 0, 1, 2, 0 }, { 0, 6, 7, 0 } }; + std::vector> refBondIndices1{ { 11, 12, 0 } }; + std::vector> refAngleIndices1{ { 11, 12, 13, 0 } }; + std::vector> refBondIndices2{ { 18, 19, 0 } }; + std::vector> refAngleIndices2{ { 17, 19, 18, 0 } }; EXPECT_EQ(refBondIndices0, pickType(splitInteractions[0]).indices); EXPECT_EQ(refBondIndices1, pickType(splitInteractions[1]).indices); EXPECT_EQ(refBondIndices2, pickType(splitInteractions[2]).indices); - EXPECT_EQ(refAngleIndices0, pickType(splitInteractions[0]).indices); - EXPECT_EQ(refAngleIndices1, pickType(splitInteractions[1]).indices); - EXPECT_EQ(refAngleIndices2, pickType(splitInteractions[2]).indices); + EXPECT_EQ(refAngleIndices0, pickType(splitInteractions[0]).indices); + EXPECT_EQ(refAngleIndices1, pickType(splitInteractions[1]).indices); + EXPECT_EQ(refAngleIndices2, pickType(splitInteractions[2]).indices); } diff --git a/api/nblib/listed_forces/tests/linear_chain_input.hpp b/api/nblib/listed_forces/tests/linear_chain_input.hpp index e00aaeb189..05dc6480d6 100644 --- a/api/nblib/listed_forces/tests/linear_chain_input.hpp +++ b/api/nblib/listed_forces/tests/linear_chain_input.hpp @@ -63,9 +63,9 @@ public: std::vector bonds{ bond1, bond2 }; pickType(interactions).parameters = bonds; - HarmonicAngleType angle(Degrees(179.9), 397.5); - std::vector angles{ angle }; - pickType(interactions).parameters = angles; + HarmonicAngle angle(Degrees(179.9), 397.5); + std::vector angles{ angle }; + pickType(interactions).parameters = angles; std::vector> bondIndices; for (int i = 0; i < nParticles - 1; ++i) @@ -75,12 +75,12 @@ public: } pickType(interactions).indices = bondIndices; - std::vector> angleIndices; + std::vector> angleIndices; for (int i = 0; i < nParticles - 2; ++i) { - angleIndices.push_back(InteractionIndex{ i, i + 1, i + 2, 0 }); + angleIndices.push_back(InteractionIndex{ i, i + 1, i + 2, 0 }); } - pickType(interactions).indices = angleIndices; + pickType(interactions).indices = angleIndices; // initialize coordinates x.resize(nParticles); diff --git a/api/nblib/listed_forces/tests/transformations.cpp b/api/nblib/listed_forces/tests/transformations.cpp index 31aa345587..d6d60bb277 100644 --- a/api/nblib/listed_forces/tests/transformations.cpp +++ b/api/nblib/listed_forces/tests/transformations.cpp @@ -65,8 +65,8 @@ ListedInteractionData unsortedInteractions() std::vector> bondIndices{ { 0, 2, 0 }, { 0, 1, 0 } }; pickType(interactions).indices = std::move(bondIndices); - std::vector> angleIndices{ { 0, 1, 2, 0 }, { 1, 0, 2, 0 } }; - pickType(interactions).indices = std::move(angleIndices); + std::vector> angleIndices{ { 0, 1, 2, 0 }, { 1, 0, 2, 0 } }; + pickType(interactions).indices = std::move(angleIndices); std::vector> dihedralIndices{ { 0, 2, 1, 3, 0 }, { 0, 1, 2, 3, 0 } }; pickType(interactions).indices = std::move(dihedralIndices); @@ -80,12 +80,12 @@ TEST(ListedTransformations, SortInteractionIndices) sortInteractions(interactions); std::vector> refBondIndices{ { 0, 1, 0 }, { 0, 2, 0 } }; - std::vector> refAngleIndices{ { 1, 0, 2, 0 }, { 0, 1, 2, 0 } }; - std::vector> refDihedralIndices{ { 0, 1, 2, 3, 0 }, + std::vector> refAngleIndices{ { 1, 0, 2, 0 }, { 0, 1, 2, 0 } }; + std::vector> refDihedralIndices{ { 0, 1, 2, 3, 0 }, { 0, 2, 1, 3, 0 } }; EXPECT_EQ(pickType(interactions).indices, refBondIndices); - EXPECT_EQ(pickType(interactions).indices, refAngleIndices); + EXPECT_EQ(pickType(interactions).indices, refAngleIndices); EXPECT_EQ(pickType(interactions).indices, refDihedralIndices); } diff --git a/api/nblib/listed_forces/tests/typetests.cpp b/api/nblib/listed_forces/tests/typetests.cpp index cbca8eb3ed..83d3610e75 100644 --- a/api/nblib/listed_forces/tests/typetests.cpp +++ b/api/nblib/listed_forces/tests/typetests.cpp @@ -63,9 +63,8 @@ std::vector> c_HarmonicBondIndices{ { 0, 1, 0 std::vector> c_InputHarmonicBond = { { HarmonicBondType(500, 0.15) } }; // Parameters for harmonic angles -std::vector> c_HarmonicAngleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 0 } }; -std::vector> c_InputHarmonicAngle = { { HarmonicAngleType(Degrees(100), - 50.0) } }; +std::vector> c_HarmonicAngleIndices{ { 0, 1, 2, 0 }, { 1, 2, 3, 0 } }; +std::vector> c_InputHarmonicAngle = { { HarmonicAngle(Degrees(100), 50.0) } }; //! Function types for testing dihedrals. Add new terms at the end. std::vector> 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, - public testing::TestWithParam, std::vector>> + public ListedForcesBase, + public testing::TestWithParam, std::vector>> { - using Base = ListedForcesBase; + using Base = ListedForcesBase; public: HarmonicAngleTest() : diff --git a/api/nblib/samples/methane-water-integration.cpp b/api/nblib/samples/methane-water-integration.cpp index e574fea72e..8012de656b 100644 --- a/api/nblib/samples/methane-water-integration.cpp +++ b/api/nblib/samples/methane-water-integration.cpp @@ -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); diff --git a/api/nblib/tests/molecules.cpp b/api/nblib/tests/molecules.cpp index a63cadcd16..d4fb155d0e 100644 --- a/api/nblib/tests/molecules.cpp +++ b/api/nblib/tests/molecules.cpp @@ -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(interactionData).interactions_.size(), 1); //! angular interactions - EXPECT_EQ(pickType(interactionData).interactions_.size(), 1); + EXPECT_EQ(pickType(interactionData).interactions_.size(), 1); } } // namespace diff --git a/api/nblib/tests/testsystems.cpp b/api/nblib/tests/testsystems.cpp index 1559f73293..db9ca65893 100644 --- a/api/nblib/tests/testsystems.cpp +++ b/api/nblib/tests/testsystems.cpp @@ -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); } diff --git a/api/nblib/tests/topology.cpp b/api/nblib/tests/topology.cpp index ff4d0336d9..b29a33da68 100644 --- a/api/nblib/tests/topology.cpp +++ b/api/nblib/tests/topology.cpp @@ -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(interactionData); auto& cubicBonds = pickType(interactionData); - auto& angleInteractions = pickType(interactionData); + auto& angleInteractions = pickType(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 angleReference{ testAngle, methanolAngle }; - std::vector> angleIndicesReference{ + HarmonicAngle methanolAngle(Degrees(108.52), 397.5); + std::vector angleReference{ testAngle, methanolAngle }; + std::vector> 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);