From b96a2f9f2aa78add7e83333a813231698bf92d08 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Fri, 3 Oct 2014 14:22:23 +0000
Subject: [PATCH] Updated the unit test case testing the interaction of one
 cell with its 26 neighbours.

---
 examples/plot_sorted_all.py | 20 +++++++++++---------
 examples/test_bh_sorted.c   |  2 ++
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/examples/plot_sorted_all.py b/examples/plot_sorted_all.py
index 077f5ea..5424e84 100644
--- a/examples/plot_sorted_all.py
+++ b/examples/plot_sorted_all.py
@@ -113,30 +113,32 @@ figure(frameon=True)
 
 subplot(311, title="Acceleration along X")
 #plot(id[abs(errx_s) > 0.001], e_errx_s , 'ro')
-plot(pos_x, accx_u - accx_s, 'bx')
-#plot(pos_x, accx_s , 'ro')
+plot(pos_x, accx_u, 'bx')
+plot(pos_x, accx_s , 'ro')
 #text( 0., 0.1, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14)
-ylim(-70, 70)
+ylim(-15000, 15000)
 grid()
 
 subplot(312, title="Acceleration along Y")
 #plot(id[abs(erry_s) > 0.001], e_erry_s , 'ro')
-plot(pos_y, accy_u - accy_s, 'bx')
-#plot(pos_y, accy_s , 'ro')
+plot(pos_y, accy_u , 'bx')
+plot(pos_y, accy_s , 'ro')
 #text( 0., 0.1, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14)
-ylim(-70, 70) 
+#ylim(-70, 70)
+ylim(-15000, 15000)
 grid()
 
 subplot(313, title="Acceleration along Z")
 #plot(id[abs(errz_s) > 0.001], e_errz_s , 'ro', label="Sorted")
-plot(pos_z, accz_u - accz_s , 'bx', label="Unsorted")
-#plot(pos_z, accz_s , 'ro', label="Sorted")
+plot(pos_z, accz_u , 'bx', label="Unsorted")
+plot(pos_z, accz_s , 'ro', label="Sorted")
 
 #text( 0., 0.1, "axis=( %d %d %d )"%(axis[orientation*3 + 0], axis[orientation*3 + 1], axis[orientation*3 + 2]) , ha='center', backgroundcolor='w', fontsize=14)
 
 legend(loc="upper right")
 
-ylim(-70, 70)
+#ylim(-70, 70)
+ylim(-15000, 15000)
 grid()
 
 savefig("accelerations_absolute_all.png")
diff --git a/examples/test_bh_sorted.c b/examples/test_bh_sorted.c
index f3560c7..aa44203 100644
--- a/examples/test_bh_sorted.c
+++ b/examples/test_bh_sorted.c
@@ -2337,6 +2337,7 @@ void test_all_direct_neighbours(int N_parts) {
   /* Do the interactions without sorting */
   for (j = 0; j < 26 ; ++j)
     iact_pair_direct_unsorted(&cells[26], &cells[j]);
+  iact_self_direct(&cells[26]);
 
   message("Unsorted interactions done ");
 
@@ -2353,6 +2354,7 @@ void test_all_direct_neighbours(int N_parts) {
   /* Do the interactions with sorting */
   for (j = 0; j < 26 ; ++j) 
     iact_pair_direct_sorted(&cells[26], &cells[j]);
+  iact_self_direct(&cells[26]);
 
   message("Sorted interactions done ");
 
-- 
GitLab