diff --git a/docs/boundaryconditions.md b/docs/boundaryconditions.md index 6dda515a9..be09901bf 100644 --- a/docs/boundaryconditions.md +++ b/docs/boundaryconditions.md @@ -71,7 +71,9 @@ The following code sets up two rings of ghost boxes in the x and y directions. === "python" ```python - sim.configure_ghostboxes(2, 2, 0) + sim.N_ghost_x = 2 + sim.N_ghost_y = 2 + sim.N_ghost_z = 0 ``` See [Rein & Liu](https://ui.adsabs.harvard.edu/abs/2012A%26A...537A.128R/abstract) for details on the ghost box implementation. diff --git a/ipython_examples/SaturnsRings.ipynb b/ipython_examples/SaturnsRings.ipynb index 3cbc644e3..275f2aeee 100644 --- a/ipython_examples/SaturnsRings.ipynb +++ b/ipython_examples/SaturnsRings.ipynb @@ -151,7 +151,8 @@ "metadata": {}, "outputs": [], "source": [ - "sim.configure_ghostboxes(2,2,0)" + "sim.N_ghost_x = 2\n", + "sim.N_ghost_y = 2" ] }, { diff --git a/rebound/simulation.py b/rebound/simulation.py index 434aec5ce..d194829da 100644 --- a/rebound/simulation.py +++ b/rebound/simulation.py @@ -1225,25 +1225,6 @@ def configure_box(self, boxsize, N_root_x=1, N_root_y=1, N_root_z=1): clibrebound.reb_simulation_configure_box(byref(self), c_double(boxsize), c_int(N_root_x), c_int(N_root_y), c_int(N_root_z)) return - def configure_ghostboxes(self, N_ghost_x=0, N_ghost_y=0, N_ghost_z=0): - """ - Initialize the ghost boxes. - - This function only needs to be called it boundary conditions other than "none" or - "open" are used. In such a case the number of ghostboxes must be known and is set - with this function. - - Parameters - ---------- - N_ghost_x, N_ghost_y, N_ghost_z : int - The number of ghost boxes in each direction. All values default to 0 (no ghost boxes). - """ - clibrebound.N_ghost_x = c_int(N_ghost_x) - clibrebound.N_ghost_y = c_int(N_ghost_y) - clibrebound.N_ghost_z = c_int(N_ghost_z) - return - - # Output to file (Simulationarchive) def save_to_file(self, filename, interval=None, walltime=None, step=None, delete_file=False): """ diff --git a/rebound/tests/test_shearingsheet.py b/rebound/tests/test_shearingsheet.py index eb40478c5..76e27dbb2 100644 --- a/rebound/tests/test_shearingsheet.py +++ b/rebound/tests/test_shearingsheet.py @@ -16,7 +16,8 @@ def test_saturnsrings(self): sim.softening = 0.2 # [m] boxsize = 50. # [m] sim.configure_box(boxsize) - sim.configure_ghostboxes(2,2,0) + sim.N_ghost_x = 2 + sim.N_ghost_y = 2 sim.integrator = "sei" sim.boundary = "shear" sim.gravity = "tree" diff --git a/rebound/tests/test_simulation.py b/rebound/tests/test_simulation.py index ea5495be7..65c479f91 100644 --- a/rebound/tests/test_simulation.py +++ b/rebound/tests/test_simulation.py @@ -70,9 +70,6 @@ def test_removehash(self): with self.assertRaises(RuntimeError): self.sim.remove(hash=-99334) - def test_configure_ghostboxes(self): - self.sim.configure_ghostboxes(1,1,1) - def test_step(self): self.sim.step() self.assertNotEqual(self.sim.t, 1.246)