Skip to content

Commit

Permalink
Bonded interactions refactoring: add some missing interface tests
Browse files Browse the repository at this point in the history
  • Loading branch information
biermanncarl committed Oct 7, 2021
1 parent ce0c3c3 commit 23cda43
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/script_interface/interactions/BondedInteraction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ class QuarticBond : public BondedInteraction {

public:
QuarticBond() {
// m_bonded_ia =
// std::make_shared<::Bonded_IA_Parameters>(CoreBondedInteraction());
add_parameters({
{"k0", AutoParameter::read_only, [this]() { return get_struct().k0; }},
{"k1", AutoParameter::read_only, [this]() { return get_struct().k1; }},
Expand Down
18 changes: 18 additions & 0 deletions testsuite/python/interactions_bonded_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,24 @@ def test_tabulated_dihedral(self):
ParticleProperties.generateTestForBondParams(
0, espressomd.interactions.TabulatedDihedral, params)(self)

@utx.skipIfMissingFeatures(["BOND_CONSTRAINT"])
def test_rigid_bond(self):
params = {"r": 1.2, "ptol": 1E-3, "vtol": 1E-3}
ParticleProperties.generateTestForBondParams(
2, espressomd.interactions.RigidBond, params)(self)

@utx.skipIfMissingFeatures(["ELECTROSTATICS"])
def test_bonded_coulomb(self):
params = {"prefactor": 2.46}
ParticleProperties.generateTestForBondParams(
0, espressomd.interactions.BondedCoulomb, params)(self)

@utx.skipIfMissingFeatures(["ELECTROSTATICS"])
def test_bonded_coulomb_sr(self):
params = {"q1q2": 3.46}
ParticleProperties.generateTestForBondParams(
0, espressomd.interactions.BondedCoulombSRBond, params)(self)


if __name__ == "__main__":
ut.main()

0 comments on commit 23cda43

Please sign in to comment.