Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.itap.purdue.edu:MintonGroup/swiftest
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Sep 17, 2023
2 parents 511d0fb + 4192711 commit 976b915
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_swiftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ def test05_gr(self):
integrators= ["whm","helio","rmvs","symba"]

# Initialize the simulation object as a variable. Define the directory in which the output will be placed.
sim = swiftest.Simulation(tstop=1000.0, dt=0.005, tstep_out=10.0, dump_cadence=0,general_relativity=True)
tstep_out = 10.0
sim = swiftest.Simulation(tstop=1000.0, dt=0.005, tstep_out=tstep_out, dump_cadence=0,general_relativity=True)
sim.add_solar_system_body(["Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune"])

# Get the start and end date of the simulation so we can compare with the real solar system.
Expand All @@ -250,9 +251,9 @@ def test05_gr(self):
for i in integrators:
sim.run(integrator=i)
varpi_sim = sim.data['varpi'].sel(name="Mercury")
dvarpi_gr = np.diff(varpi_sim) / sim.param['tstep_out']
dvarpi_gr = np.diff(varpi_sim) / tstep_out
dvarpi_err = np.mean(dvarpi_obs - dvarpi_gr) / dvarpi_obs_mean
self.assertLess(np.abs(dvarpi_err),msg=f'Mercury precession rate error of of {dvarpi_err:.2e} "/{sim.TU_name} higher than threshold value of {dvarpi_limit:.2e} "/{sim.TU_name}')
self.assertLess(np.abs(dvarpi_err),dvarpi_limit,msg=f'Mercury precession rate error of of {dvarpi_err:.2e} "/{sim.TU_name} higher than threshold value of {dvarpi_limit:.2e} "/{sim.TU_name}')

return

Expand Down

0 comments on commit 976b915

Please sign in to comment.