This is pure refactoring.
HarmonicAngleType -> HarmonicAngle
EquilDistance -> EquilConstant
{
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
*
{
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>;
/*! \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>;
/*! \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>;
/*! \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>;
/*! \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)
{
}
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)
/*! \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)
*
* 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 }
{
}
{
}
- [[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_;
};
};
template<>
-struct ListedIndex<HarmonicAngleType> : std::integral_constant<int, F_ANGLES>
+struct ListedIndex<HarmonicAngle> : std::integral_constant<int, F_ANGLES>
{
};
{
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);
}
}
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>;
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);
}
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);
}
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);
}
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);
}
//! 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);
}
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;
// 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 } };
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);
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;
}
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);
{
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]
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);
}
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)
}
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);
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);
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);
}
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) }*/ };
::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() :
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);
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);
//! 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
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);
}
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);
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);
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);