commit a46a20781d6ca83220f5e8d12c6c59bf25dd3928
parent 6fa9e47d206927bea7ac220ba5c999a84eb0be81
Author: Anders Damsgaard <andersd@riseup.net>
Date: Mon, 19 Feb 2018 20:09:31 -0500
Add test with regular square packing
Diffstat:
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/test/contact-search-and-geometry.jl b/test/contact-search-and-geometry.jl
@@ -1,4 +1,6 @@
#!/usr/bin/env julia
+using Compat.Test
+import Granular
# Check the contact search and geometry of a two-particle interaction
@@ -265,3 +267,21 @@ Granular.interact!(sim)
for i=1:9
@test sim.grains[i].n_contacts == 0
end
+
+sim = Granular.createSimulation()
+nx = 16; ny = 15
+Granular.regularPacking!(sim, [nx, ny], 1., 1., padding_factor=0,
+ tiling="square")
+for grain in sim.grains
+ grain.contact_radius *= 1.00001
+end
+Granular.findContacts!(sim)
+#Granular.plotGrains(sim)
+for j=2:(ny-1)
+ for i=2:(nx-1)
+ idx = (j - 1)*nx + i
+ @test sim.grains[idx].n_contacts == 4
+ end
+end
+
+