Skip to content

Commit 2af7e78

Browse files
committed
export reset function
1 parent 4165c68 commit 2af7e78

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/FastMultipole.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ for file in ["containers", "complex", "derivatives", "element", "tree", "direct"
1717
include(file*".jl")
1818
end
1919

20-
export fmm!, direct!, Tree, SortWrapper, ProbeSystem
20+
export fmm!, direct!, Tree, SortWrapper, ProbeSystem, reset!
2121

2222
end # module

src/probe.jl

+15
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,18 @@ buffer_element(probe_system::ProbeSystem) = probe_system.position[1], get_scalar
7676
B2M!(system::ProbeSystem, args...) = nothing
7777

7878
direct!(target_system, target_index, source_system::ProbeSystem, source_index) = nothing
79+
80+
function reset!(values::Vector{TV}) where TV
81+
for i in eachindex(values)
82+
values[i] = zero(TV)
83+
end
84+
end
85+
86+
reset!(::Nothing) = nothing
87+
88+
function reset!(probes::ProbeSystem)
89+
reset!(probes.scalar_potential)
90+
reset!(probes.vector_potential)
91+
reset!(probes.velocity)
92+
reset!(probes.velocity_gradient)
93+
end

0 commit comments

Comments
 (0)