Skip to content

Commit 703d16a

Browse files
authored
fix test module (#38)
1 parent ce4a8d2 commit 703d16a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/testing/fdtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ end
9999

100100

101101
function _fdtest_forces(sys::AbstractSystem, calc, verbose, rattle, h0; kwargs...)
102-
X0, bb0 = _rattle(position(sys, :), bounding_box(sys), rattle)
102+
X0, bb0 = _rattle(position(sys, :), cell_vectors(sys), rattle)
103103

104104
uE = energy_unit(calc)
105105
uL = length_unit(calc)
@@ -131,7 +131,7 @@ end
131131

132132

133133
function _fdtest_virial(sys::AbstractSystem, calc, verbose, rattle, h0; kwargs...)
134-
X0, C0 = _rattle(position(sys, :), bounding_box(sys), rattle)
134+
X0, C0 = _rattle(position(sys, :), cell_vectors(sys), rattle)
135135

136136
# reference deformation is just the identity. Note, this is NOT a
137137
# matrix of cell vectors, but a deformation of cell vectors, i.e. unitless!

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ using Unitful
1010
@testset "Calculators" begin include("test_calculators.jl") end
1111
@testset "PairPotentials" begin include("test_pairpotential.jl") end
1212
@testset "i-PI driver and server" begin include("test_ipi.jl") end
13-
# @testset "FD Tests" begin include("test_fdtests.jl") end
13+
@testset "FD Tests" begin include("test_fdtests.jl") end
1414
end

test/test_fdtests.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ module DemoPairCalc
6262
end
6363
6464
potential_energy(sys, calc::AbstractPot; kwargs...) =
65-
_energy(_ustripvecvec(position(sys))) * uE
65+
_energy(_ustripvecvec(position(sys, :))) * uE
6666
6767
forces(sys, calc::AbstractPot; kwargs...) =
68-
_forces(_ustripvecvec(position(sys))) * uE / uL
68+
_forces(_ustripvecvec(position(sys, :))) * uE / uL
6969
7070
virial(sys, calc::AbstractPot; kwargs...) =
71-
_virial(_ustripvecvec(position(sys))) * uE
71+
_virial(_ustripvecvec(position(sys, :))) * uE
7272
7373
forces(sys, calc::PotFerr; kwargs...) =
74-
0.9 * _forces(_ustripvecvec(position(sys))) * uE / uL
74+
0.9 * _forces(_ustripvecvec(position(sys, :))) * uE / uL
7575
7676
virial(sys, calc::PotVerr; kwargs...) =
77-
0.9 * _virial(_ustripvecvec(position(sys))) * uE
77+
0.9 * _virial(_ustripvecvec(position(sys, :))) * uE
7878
7979
8080
function random_system(Nat, pbc=:periodic)

0 commit comments

Comments
 (0)