From ac6f97853537bf4a58d54cd4d9f9b0cc48fa6016 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Sun, 22 Apr 2018 14:18:16 +0800
Subject: [PATCH] Pass the fraction of how much the particle positions are
 perturbed.

---
 examples/fof_test/makeIC.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/examples/fof_test/makeIC.py b/examples/fof_test/makeIC.py
index 6ad4db3b3f..98b990be05 100644
--- a/examples/fof_test/makeIC.py
+++ b/examples/fof_test/makeIC.py
@@ -31,6 +31,7 @@ periodic= 1           # 1 For periodic box
 boxSize = 1.
 rho = 1.
 L = int(sys.argv[1])  # Number of particles along one axis
+pert = float(sys.argv[2])  # How much to perturb particle positions
 fileName = "uniformDMBox_%d.hdf5"%L 
 
 #---------------------------------------------------
@@ -87,9 +88,9 @@ ds[()] = ids + 1
 # set seed for random number
 np.random.seed(1234)
 
-x_pert = 1.2 * (np.random.rand(numPart, 1) - 0.5)
-z_pert = 1.2 * (np.random.rand(numPart, 1) - 0.5)
-y_pert = 1.2 * (np.random.rand(numPart, 1) - 0.5)
+x_pert = pert * (np.random.rand(numPart, 1) - 0.5)
+z_pert = pert * (np.random.rand(numPart, 1) - 0.5)
+y_pert = pert * (np.random.rand(numPart, 1) - 0.5)
 
 #x_pert = zeros((numPart, 1))
 #y_pert = zeros((numPart, 1))
-- 
GitLab