Skip to content

Commit

Permalink
add interface for retrieving the computing box
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Feb 17, 2023
1 parent db74372 commit 08bc269
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/PeriodicSystems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,27 @@ end
@test a == 0
end

#
# This interface is needed to generate random particle coordinates in ComplexMixtures.jl
#
"""
get_computing_box(sys::AbstractPeriodicSystem)
$(INTERNAL)
Retrieves the computing box of the system. The computing box is large enough to
contain all coordinates of the particles, plus the cutoff.
"""
get_computing_box(sys::AbstractPeriodicSystem) = sys._box.computing_box
@testitem "get_computing_box" begin
using StaticArrays
using CellListMap.PeriodicSystems
x = rand(SVector{3,Float64}, 1000)
sys = PeriodicSystem(xpositions=x, unitcell=[1, 1, 1], cutoff=0.1, output=0.0)
@test PeriodicSystems.get_computing_box(sys) == ([-0.1, -0.1, -0.1], [1.1, 1.1, 1.1])
end

"""
UpdatePeriodicSystem!
Expand Down

0 comments on commit 08bc269

Please sign in to comment.