Skip to content

Commit

Permalink
add test for naive
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrogantGao committed Feb 7, 2024
1 parent d4931d6 commit 97b58fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions test/energy_naive.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@testset "test energy naive" begin

@info "testing the energy naive"

n_atoms = 100
L = 100.0
boundary = ExTinyMD.Q2dBoundary(L, L, L)
Expand All @@ -23,14 +26,5 @@
FastSpecSoG_neighbor = CellList3D(info, FastSpecSoG_interaction.r_c, boundary, 1)
energy_sog = energy_naive(FastSpecSoG_interaction, FastSpecSoG_neighbor, info, atoms)

# coords = [p_info.position for p_info in info.particle_info]
# charge = [atoms[p_info.id].charge for p_info in info.particle_info]
# N_real = 200
# N_img = 0
# sys_q2d = SysQ2D((0.0, 0.0), (L, L, L), N_real, N_img, ϵ = 1.0)
# ref_pos, ref_charge = SysQ2DInit(sys_q2d, coords, charge)
# energy_icm = Energy_Q2D(sys_q2d, coords, charge, ref_pos, ref_charge)

@show abs(energy_ewald - energy_sog)
@test abs(energy_ewald - energy_sog) < 1e-4
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using ExTinyMD, EwaldSummations

@testset "FastSpecSoG.jl" begin
include("U_series.jl")
# include("energy_naive.jl")
include("energy_naive.jl")
include("energy_mid.jl")
include("energy_long.jl")
end

0 comments on commit 97b58fd

Please sign in to comment.