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

Commit

Permalink
Fixed 1pl_1pl SyMBA test example initial conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Sep 28, 2021
1 parent 528f5d9 commit 96091ee
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 42 deletions.

Large diffs are not rendered by default.

Binary file modified examples/symba_swifter_comparison/1pl_1pl_encounter/cb.swiftest.in
Binary file not shown.
25 changes: 19 additions & 6 deletions examples/symba_swifter_comparison/1pl_1pl_encounter/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
swiftest_pl = "pl.swiftest.in"
swiftest_tp = "tp.swiftest.in"
swiftest_cb = "cb.swiftest.in"
swiftest_bin = "bin.swiftest.dat"
swiftest_bin = "bin.swiftest.nc"
swiftest_enc = "enc.swiftest.dat"

MU2KG = swiftest.MSun
Expand All @@ -40,8 +40,8 @@

npl = 2
ntp = 0
plid1 = 2
plid2 = 100
plid1 = 1
plid2 = 2

radius1 = np.double(4.25875607065041e-05)
mass1 = np.double(0.00012002693582795244940133)
Expand All @@ -66,7 +66,7 @@
plfile = open(swifter_pl, 'w')
print(npl+1, f'! Planet input file generated using init_cond.py',file=plfile)

print(1,GMSun,file=plfile)
print(0,GMSun,file=plfile)
print('0.0 0.0 0.0',file=plfile)
print('0.0 0.0 0.0',file=plfile)

Expand Down Expand Up @@ -118,9 +118,21 @@
sys.stdout = sys.__stdout__

#Now make Swiftest files

#Now make Swiftest files
NAMELEN = 32
cbname = "Sun"
pl1name = "BigPlanet"
pl2name = "SmallPlanet"

cbname = cbname.ljust(NAMELEN)
pl1name = pl1name.ljust(NAMELEN)
pl2name = pl2name.ljust(NAMELEN)
cbfile = FortranFile(swiftest_cb, 'w')

Msun = np.double(1.0)
cbfile.write_record(0)
cbfile.write_record(cbname)
cbfile.write_record(np.double(GMSun))
cbfile.write_record(np.double(rmin))
#cbfile.write_record(np.double(swiftest.J2Sun))
Expand All @@ -132,6 +144,7 @@
plfile = FortranFile(swiftest_pl, 'w')
plfile.write_record(npl)
plfile.write_record(np.array([plid1, plid2], dtype=np.int32))
plfile.write_record(np.array([pl1name, pl2name]))
plfile.write_record(np.vstack([p_pl1[0],p_pl2[0]]))
plfile.write_record(np.vstack([p_pl1[1],p_pl2[1]]))
plfile.write_record(np.vstack([p_pl1[2],p_pl2[2]]))
Expand All @@ -157,9 +170,9 @@
print(f'TP_IN {swiftest_tp}')
print(f'IN_TYPE REAL8')
print(f'ISTEP_OUT {iout:d}')
print(f'ISTEP_DUMP {iout:d}')
print(f'ISTEP_DUMP {100*iout:d}')
print(f'BIN_OUT {swiftest_bin}')
print(f'OUT_TYPE REAL8')
print(f'OUT_TYPE NETCDF_DOUBLE')
print(f'OUT_FORM XV')
print(f'OUT_STAT REPLACE')
print(f'CHK_CLOSE yes')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ ENC_OUT enc.swifter.dat
EXTRA_FORCE no
BIG_DISCARD no
RHILL_PRESENT yes
ENERGY yes
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ PL_IN pl.swiftest.in
TP_IN tp.swiftest.in
IN_TYPE REAL8
ISTEP_OUT 1
ISTEP_DUMP 1
BIN_OUT bin.swiftest.dat
OUT_TYPE REAL8
ISTEP_DUMP 100
BIN_OUT bin.swiftest.nc
OUT_TYPE NETCDF_DOUBLE
OUT_FORM XV
OUT_STAT REPLACE
CHK_CLOSE yes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
3 ! Planet input file generated using init_cond.py
1 39.476926408897625196
0 39.476926408897625196
0.0 0.0 0.0
0.0 0.0 0.0
2 0.00012002693582795244940133 0.010044724833237892
1 0.00012002693582795244940133 0.010044724833237892
4.25875607065041e-05
1.0 0.0 0.0
0.0 6.283185307179586 0.0
100 1.2002693582795244601319e-06 0.002164070363255244
2 1.2002693582795244601319e-06 0.002164070363255244
9.17521181499312e-06
1.01 0.0 0.0
0.0 6.252003053624663 0.0
Binary file modified examples/symba_swifter_comparison/1pl_1pl_encounter/pl.swiftest.in
Binary file not shown.

Large diffs are not rendered by default.

0 comments on commit 96091ee

Please sign in to comment.