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

Commit

Permalink
Merge branch 'debug' into IntelAdvisor
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 15, 2021
2 parents 5e3ab88 + 0cc2f38 commit b822874
Show file tree
Hide file tree
Showing 15 changed files with 485 additions and 223 deletions.
5 changes: 0 additions & 5 deletions examples/helio_gr_test/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,5 @@
sim.add(name, idval=id, date="2027-04-30")

sim.save("param.swiftest.in")
sim.param['PL_IN'] = "pl.swifter.in"
sim.param['TP_IN'] = "tp.swifter.in"
sim.param['BIN_OUT'] = "bin.swifter.dat"
sim.param['ENC_OUT'] = "enc.swifter.dat"
sim.save("param.swifter.in", codename="Swifter")


27 changes: 0 additions & 27 deletions examples/helio_gr_test/param.swifter.in

This file was deleted.

36 changes: 0 additions & 36 deletions examples/helio_gr_test/pl.swifter.in

This file was deleted.

1 change: 0 additions & 1 deletion examples/helio_gr_test/tp.swifter.in

This file was deleted.

33 changes: 14 additions & 19 deletions examples/symba_gr_test/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
sim.param['TU2S'] = swiftest.YR2S
sim.param['DU2M'] = swiftest.AU2M
sim.param['T0'] = 0.0
sim.param['DT'] = 0.125 * swiftest.JD2S / swiftest.YR2S
sim.param['DT'] = 0.25 * swiftest.JD2S / swiftest.YR2S
sim.param['TSTOP'] = 1000.0
sim.param['ISTEP_OUT'] = 2922
sim.param['ISTEP_DUMP'] = 2922
sim.param['ISTEP_OUT'] = 1461
sim.param['ISTEP_DUMP'] = 1461
sim.param['CHK_QMIN_COORD'] = "HELIO"
sim.param['CHK_QMIN'] = swiftest.RSun / swiftest.AU2M
sim.param['CHK_QMIN_RANGE'] = f"{swiftest.RSun / swiftest.AU2M} 1000.0"
Expand All @@ -29,7 +29,7 @@
sim.param['OUT_TYPE'] = "NETCDF_DOUBLE"
sim.param['RHILL_PRESENT'] = "YES"
sim.param['GR'] = 'YES'
sim.param['GMTINY'] = '1e-7'
sim.param['GMTINY'] = '1e-12'

bodyid = {
"Sun": 0,
Expand All @@ -46,34 +46,29 @@
for name, id in bodyid.items():
sim.add(name, idval=id, date="2027-04-30")

Me_a = sim.ds.isel(id=1)['a'].values
Me_a = sim.ds.sel(id=1)['a'].values
Me_e = sim.ds.sel(id=1)['e'].values
Me_i = sim.ds.sel(id=1)['inc'].values

capom_pl = default_rng().uniform(0.0, 360.0, 1)
omega_pl = default_rng().uniform(0.0, 360.0, 1)
capm_pl = default_rng().uniform(0.0, 360.0, 1)
capom_pl = sim.ds.sel(id=1)['capom'].values
omega_pl = sim.ds.sel(id=1)['omega'].values
capm_pl = sim.ds.sel(id=1)['capm'].values + 1.0

capom_tp = default_rng().uniform(0.0, 360.0, 1)
omega_tp = default_rng().uniform(0.0, 360.0, 1)
capm_tp = default_rng().uniform(0.0, 360.0, 1)
capom_tp = sim.ds.sel(id=1)['capom'].values
omega_tp = sim.ds.sel(id=1)['omega'].values
capm_tp = sim.ds.sel(id=1)['capm'].values - 1.0

GMcb = sim.ds.isel(id=0)['Gmass'].values
GU = swiftest.GC / (sim.param['DU2M']**3 / (sim.param['MU2KG'] * sim.param['TU2S']**2))
dens = 3000.0 / (sim.param['MU2KG'] / sim.param['DU2M']**3) # Assume a bulk density of 3 g/cm^3
GM_pl = 2e-7
GM_pl = sim.ds.sel(id=1)['Gmass'].values * 0.0001
M_pl = GM_pl / GU
R_pl = (3 * M_pl / (4 * np.pi * dens))**(1.0 / 3.0)
Rh_pl = Me_a * (GM_pl / (3 * GMcb))**(1.0/3.0)

sim.addp(np.full(1,9), np.full(1,'Planetesimal'), Me_a, Me_e, Me_i, capom_pl, omega_pl, capm_pl, GMpl=np.full(1, GM_pl), Rpl=np.full(1, R_pl), rhill=Rh_pl)
sim.addp(np.full(1,10), np.full(1,'TestParticle'), Me_a, Me_e, Me_i, capom_tp, omega_tp, capm_tp)
sim.addp([9], ['Planetesimal'], Me_a, Me_e, Me_i, capom_pl, omega_pl, capm_pl, GMpl=GM_pl, Rpl=R_pl, rhill=Rh_pl)
sim.addp([10], ['TestParticle'], Me_a, Me_e, Me_i, capom_tp, omega_tp, capm_tp)

sim.save("param.swiftest.in")
sim.param['PL_IN'] = "pl.swifter.in"
sim.param['TP_IN'] = "tp.swifter.in"
sim.param['BIN_OUT'] = "bin.swifter.dat"
sim.param['ENC_OUT'] = "enc.swifter.dat"
sim.save("param.swifter.in", codename="Swifter")


27 changes: 0 additions & 27 deletions examples/symba_gr_test/param.swifter.in

This file was deleted.

8 changes: 4 additions & 4 deletions examples/symba_gr_test/param.swiftest.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
! VERSION Swiftest parameter input
T0 0.0
TSTOP 1000.0
DT 0.00034223134839151266
ISTEP_OUT 2922
ISTEP_DUMP 2922
DT 0.0006844626967830253
ISTEP_OUT 1461
ISTEP_DUMP 1461
OUT_FORM XVEL
OUT_TYPE NETCDF_DOUBLE
OUT_STAT UNKNOWN
Expand Down Expand Up @@ -33,4 +33,4 @@ ENERGY NO
GR YES
INTERACTION_LOOPS ADAPTIVE
ENCOUNTER_CHECK ADAPTIVE
GMTINY 1e-7
GMTINY 1e-12
36 changes: 0 additions & 36 deletions examples/symba_gr_test/pl.swifter.in

This file was deleted.

6 changes: 5 additions & 1 deletion examples/symba_gr_test/pl.swiftest.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
8
9
Mercury 6.5537098095653139645e-06 0.0014751260185578720416
1.6306381826061645943e-05
0.38709858430953941744 0.20562340108970009189 7.0033025080013837638
Expand Down Expand Up @@ -31,3 +31,7 @@ Neptune 0.0020336100526728302319 0.7749718408665498732
0.000164587904124493665
30.038959912561129073 0.008955570159296157365 1.7711193542961420899
131.82211597488270627 284.47484279411258967 308.45137222693909962
Planetesimal 6.5537098095653142786e-10 6.846928455909899115e-05
9.223333137364179555e-07
0.38709858430953941744 0.20562340108970009189 7.0033025080013837638
48.296118373786072198 29.20442403952453958 339.33948746828792764
Loading

0 comments on commit b822874

Please sign in to comment.