Skip to content

Commit 602bac1

Browse files
committed
HarmonicAngle tests
1 parent 0df245a commit 602bac1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/interactions.jl

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,30 @@
407407
atol=1e-9u"kJ * mol^-1",
408408
)
409409

410+
c3a = SVector(1.0, 1.2, 1.2)u"nm"
411+
a1 = HarmonicAngle(k=300.0u"kJ * mol^-1", θ0=0.8)
412+
fs = force(a1, c1, c2, c3a, boundary)
413+
@test isapprox(
414+
fs.f1,
415+
SVector(0.0, -31.1343284689, -31.1343284689)u"kJ * mol^-1 * nm^-1";
416+
atol=1e-9u"kJ * mol^-1 * nm^-1",
417+
)
418+
@test isapprox(
419+
fs.f2,
420+
SVector(-21.9771730369, 14.6514486912, 14.6514486912)u"kJ * mol^-1 * nm^-1";
421+
atol=1e-9u"kJ * mol^-1 * nm^-1",
422+
)
423+
@test isapprox(
424+
fs.f3,
425+
SVector(21.9771730369, 16.4828797777, 16.4828797777)u"kJ * mol^-1 * nm^-1";
426+
atol=1e-9u"kJ * mol^-1 * nm^-1",
427+
)
428+
@test isapprox(
429+
potential_energy(a1, c1, c2, c3a, boundary),
430+
0.2908039228u"kJ * mol^-1";
431+
atol=1e-9u"kJ * mol^-1",
432+
)
433+
410434
boundary_cosine = CubicBoundary(10.0u"nm")
411435
c1_cosine = SVector(1.0, 0.0, 0.0)u"nm"
412436
c2_cosine = SVector(2.0, 0.0, 0.0)u"nm"

0 commit comments

Comments
 (0)