Skip to content

Commit

Permalink
removed broken configure_ghost_boxes function
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed Mar 29, 2024
1 parent db8b90b commit d122fc1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 25 deletions.
4 changes: 3 additions & 1 deletion docs/boundaryconditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion ipython_examples/SaturnsRings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@
"metadata": {},
"outputs": [],
"source": [
"sim.configure_ghostboxes(2,2,0)"
"sim.N_ghost_x = 2\n",
"sim.N_ghost_y = 2"
]
},
{
Expand Down
19 changes: 0 additions & 19 deletions rebound/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
3 changes: 2 additions & 1 deletion rebound/tests/test_shearingsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 0 additions & 3 deletions rebound/tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d122fc1

Please sign in to comment.