Skip to content

Commit

Permalink
fix #15
Browse files Browse the repository at this point in the history
  • Loading branch information
tjjarvinen committed Jun 12, 2024
1 parent 1ec3ea0 commit 49bf3da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/submodules/AtomsCalculatorsTesting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ function test_forces(sys, calculator; force_eltype=nothing, rtol=1e8, kwargs...)
@test typeof(f_matrix) <: AbstractMatrix
@test eltype(f_matrix) <: Number
@test size(f_matrix) == (3, length(f))
@test all( AtomsCalculators.forces(sys, calculator; dummy_kword659234=1, kwargs...) .≈ f )
f_dummy = AtomsCalculators.forces(sys, calculator; dummy_kword659234=1, kwargs...)
@test all( f_dummy .- f ) do Δf # f_dummy ≈ f
isapprox( ustrip.( zero(ftype) ), ustrip.(Δf); rtol=rtol)
end
f_cpu_array = Array(f) # Allow GPU output
@test dimension(f_cpu_array[1][1]) == dimension(u"N")
@test length(f_cpu_array[1]) == (length position)(sys,1)
Expand Down

0 comments on commit 49bf3da

Please sign in to comment.