This repository was archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Swifter vs Swiftest comparison for RMVS
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
!solar_impact | ||
!Swifter_Swiftest | ||
!swiftest_performance | ||
!rmvs_swifter_comparison |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* | ||
!.gitignore | ||
!1pl_1tp_encounter |
3 changes: 3 additions & 0 deletions
3
examples/rmvs_swifter_comparison/1pl_1tp_encounter/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* | ||
!.gitignore | ||
!init_cond.py |
38 changes: 38 additions & 0 deletions
38
examples/rmvs_swifter_comparison/1pl_1tp_encounter/init_cond.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
import numpy as np | ||
import swiftest | ||
|
||
# Simple initial conditions of a circular planet with one test particle in a close encounter state | ||
# Simulation start, stop, and output cadence times | ||
t_0 = 0 # simulation start time | ||
deltaT = 0.25 * swiftest.JD2S / swiftest.YR2S # simulation step size | ||
end_sim = 0.15 | ||
t_print = deltaT #output interval to print results | ||
|
||
iout = int(np.ceil(t_print / deltaT)) | ||
|
||
radius = np.double(4.25875607065041e-05) | ||
Gmass = np.double(0.00012002693582795244940133) | ||
apl = np.longdouble(1.0) | ||
atp = np.longdouble(1.01) | ||
vpl = np.longdouble(2 * np.pi) | ||
vtp = np.longdouble(2 * np.pi / np.sqrt(atp)) | ||
|
||
p_pl = np.array([apl, 0.0, 0.0], dtype=np.double) | ||
v_pl = np.array([0.0, vpl, 0.0], dtype=np.double) | ||
|
||
p_tp = np.array([atp, 0.0, 0.0], dtype=np.double) | ||
v_tp = np.array([0.0, vtp, 0.0], dtype=np.double) | ||
|
||
rhill = np.double(apl * 0.0100447248332378922085) | ||
|
||
sim = swiftest.Simulation(simdir="swiftest_sim",init_cond_format="XV", general_relativity=False, integrator="RMVS") | ||
sim.clean() | ||
sim.add_solar_system_body(["Sun"]) | ||
sim.add_body(name=["Planet"], rh=[p_pl], vh=[v_pl], Gmass=[Gmass], radius=[radius], rhill=[rhill]) | ||
sim.add_body(name=["TestParticle"], rh=[p_tp], vh=[v_tp]) | ||
sim.set_parameter(tstart=t_0, tstop=end_sim, dt=deltaT, istep_out=iout, dump_cadence=0) | ||
sim.save() | ||
|
||
sim.set_parameter(simdir="swifter_sim",codename="Swifter",init_cond_file_type="ASCII",output_format="XV",output_file_type="REAL8") | ||
sim.save() |