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

Commit

Permalink
Merge branch 'OOPSymba' into OOPrestructure
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 5, 2021
2 parents 3ab3514 + ee7bdec commit 51f192a
Show file tree
Hide file tree
Showing 162 changed files with 17,268 additions and 5,489 deletions.
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
#******************************************************************************

SWIFTEST_MODULES = swiftest_globals.f90 \
lambda_function.f90\
swiftest_classes.f90 \
swiftest_operators.f90 \
whm_classes.f90 \
rmvs_classes.f90 \
helio_classes.f90 \
symba_classes.f90 \
module_nrutil.f90 \
swiftest.f90


Expand Down Expand Up @@ -96,6 +96,11 @@ lib:
ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \
ln -s $(SWIFTEST_HOME)/Makefile .; \
make libdir
cd $(SWIFTEST_HOME)/src/fragmentation; \
rm -f Makefile.Defines Makefile; \
ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \
ln -s $(SWIFTEST_HOME)/Makefile .; \
make libdir
cd $(SWIFTEST_HOME)/src/gr; \
rm -f Makefile.Defines Makefile; \
ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \
Expand Down Expand Up @@ -131,6 +136,11 @@ lib:
ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \
ln -s $(SWIFTEST_HOME)/Makefile .; \
make libdir
cd $(SWIFTEST_HOME)/src/tides; \
rm -f Makefile.Defines Makefile; \
ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \
ln -s $(SWIFTEST_HOME)/Makefile .; \
make libdir
cd $(SWIFTEST_HOME)/src/util; \
rm -f Makefile.Defines Makefile; \
ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \
Expand Down Expand Up @@ -176,13 +186,6 @@ drivers:
ln -s $(SWIFTEST_HOME)/Makefile .; \
make bin

#tools:
# cd $(SWIFTEST_HOME)/src/tool; \
# rm -f Makefile.Defines Makefile; \
# ln -s $(SWIFTEST_HOME)/Makefile.Defines .; \
# ln -s $(SWIFTEST_HOME)/Makefile .; \
# make bin

bin: *.f90
make $(basename $^)

Expand All @@ -191,6 +194,7 @@ clean:
cd $(SWIFTEST_HOME)/src/discard; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/drift; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/eucl; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/fragmentation; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/gr; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/helio; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/io; rm -f Makefile.Defines Makefile *.gc*
Expand All @@ -202,6 +206,7 @@ clean:
cd $(SWIFTEST_HOME)/src/rmvs; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/setup; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/symba; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/tides; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/user; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/util; rm -f Makefile.Defines Makefile *.gc*
cd $(SWIFTEST_HOME)/src/whm; rm -f Makefile.Defines Makefile *.gc*
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Defines
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FORTRAN = ifort
#AR = xiar

#FORTRAN = gfortran
#FFLAGS = -ffree-line-length-none $(GDEBUG) #$(GMEM)
#FFLAGS = -ffree-line-length-none $(GDEBUG) $(GMEM)
AR = ar

# DO NOT include in CFLAGS the "-c" option to compile object only
Expand Down
5 changes: 5 additions & 0 deletions examples/helio_gr_test/cb.swiftest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0
39.476926408897626
0.004650467260962157
4.7535806948127355e-12
-2.2473967953572827e-18
51 changes: 51 additions & 0 deletions examples/helio_gr_test/init_cond.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env python3
import swiftest

sim = swiftest.Simulation()
sim.param['PL_IN'] = "pl.swiftest.in"
sim.param['TP_IN'] = "tp.swiftest.in"
sim.param['CB_IN'] = "cb.swiftest.in"
sim.param['BIN_OUT'] = "bin.swiftest.dat"
sim.param['ENC_OUT'] = "enc.swiftest.dat"

sim.param['MU2KG'] = swiftest.MSun
sim.param['TU2S'] = swiftest.YR2S
sim.param['DU2M'] = swiftest.AU2M
sim.param['T0'] = 0.0
sim.param['DT'] = 0.25 * swiftest.JD2S / swiftest.YR2S
sim.param['TSTOP'] = 1000.0
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"
sim.param['CHK_RMIN'] = swiftest.RSun / swiftest.AU2M
sim.param['CHK_RMAX'] = 1000.0
sim.param['CHK_EJECT'] = 1000.0
sim.param['OUT_FORM'] = "EL"
sim.param['OUT_STAT'] = "UNKNOWN"
sim.param['GR'] = 'YES'

bodyid = {
"Sun": 0,
"Mercury": 1,
"Venus": 2,
"Earth": 3,
"Mars": 4,
"Jupiter": 5,
"Saturn": 6,
"Uranus": 7,
"Neptune": 8,
}

for name, id in bodyid.items():
sim.add(name, idval=id)

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: 27 additions & 0 deletions examples/helio_gr_test/param.swifter.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
! VERSION Swifter parameter file converted from Swiftest
T0 0.0
TSTOP 1000.0
DT 0.0006844626967830253
ISTEP_OUT 1461
ISTEP_DUMP 1461
OUT_FORM EL
OUT_TYPE REAL8
OUT_STAT UNKNOWN
IN_TYPE ASCII
PL_IN pl.swifter.in
TP_IN tp.swifter.in
BIN_OUT bin.swifter.dat
ENC_OUT enc.swifter.dat
CHK_QMIN 0.004650467260962157
CHK_RMIN 0.004650467260962157
CHK_RMAX 1000.0
CHK_EJECT 1000.0
CHK_QMIN_COORD HELIO
CHK_QMIN_RANGE 0.004650467260962157 1000.0
EXTRA_FORCE NO
BIG_DISCARD NO
CHK_CLOSE YES
C 63241.07708426628
J2 4.7535806948127355e-12
J4 -2.2473967953572827e-18
RHILL_PRESENT YES
35 changes: 35 additions & 0 deletions examples/helio_gr_test/param.swiftest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
! VERSION Swiftest parameter input
T0 0.0
TSTOP 1000.0
DT 0.0006844626967830253
ISTEP_OUT 1461
ISTEP_DUMP 1461
OUT_FORM EL
OUT_TYPE REAL8
OUT_STAT UNKNOWN
IN_TYPE ASCII
PL_IN pl.swiftest.in
TP_IN tp.swiftest.in
CB_IN cb.swiftest.in
BIN_OUT bin.swiftest.dat
ENC_OUT enc.swiftest.dat
CHK_QMIN 0.004650467260962157
CHK_RMIN 0.004650467260962157
CHK_RMAX 1000.0
CHK_EJECT 1000.0
CHK_QMIN_COORD HELIO
CHK_QMIN_RANGE 0.004650467260962157 1000.0
MU2KG 1.988409870698051e+30
TU2S 31557600.0
DU2M 149597870700.0
EXTRA_FORCE NO
BIG_DISCARD NO
CHK_CLOSE YES
FRAGMENTATION NO
ROTATION NO
TIDES NO
ENERGY NO
GR YES
YARKOVSKY NO
YORP NO
MTINY 0.0
36 changes: 36 additions & 0 deletions examples/helio_gr_test/pl.swifter.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
9
0 39.476926408897625196
0.0 0.0 0.0
0.0 0.0 0.0
1 6.5537098095653139645e-06 0.0014751234419554511911
1.6306381826061645943e-05
0.13267502226188271353 0.2786606257975073886 0.010601098875389479426
-11.331978934667442676 4.8184460126705647045 1.4332264599878684131
2 9.663313399581537916e-05 0.00675908960945781479
4.0453784346544178454e-05
-0.69398700025820403425 -0.19235393648106968723 0.03740673057980103272
1.9245789988923785786 -7.1528261190002948057 -0.20922405362759749996
3 0.000120026935827952453094 0.010044837538502923644
4.25875607065040958e-05
0.49463573470256239073 -0.8874896493821613497 4.051630875713834232e-05
5.386704768180099809 3.0357508899436080915 -0.00016218409216515533796
4 1.2739802010675941456e-05 0.0072467236860282326973
2.265740805092889601e-05
-1.5655322071100350456 0.56626121192188216824 0.050269397991054412533
-1.5477080637857006753 -4.370087697214287981 -0.05361768768801557225
5 0.037692251088985676735 0.35527094075555771578
0.00046732617030490929307
4.0891378954287338487 -2.9329188614380639066 -0.07930573161132697946
1.575024788882753283 2.3719591091996699917 -0.045089307261129988257
6 0.011285899820091272997 0.43765464106459166412
0.00038925687730393611812
6.3349788609660162564 -7.674600716671800882 -0.11868650931385750502
1.4598618704191345578 1.2948691245181617393 -0.080593167691228835176
7 0.0017236589478267730203 0.46956055286931676728
0.00016953449859497231466
14.832516206189200858 13.032608531076540714 -0.14378102535616668622
-0.9573374666934839659 1.014553546383260322 0.016118112341773867214
8 0.0020336100526728302319 0.7813163071687303693
0.000164587904124493665
29.561664938083289655 -4.6012285192418387325 -0.586585578731106283
0.17051705220469790965 1.1424784769020628332 -0.027423757798549895085
33 changes: 33 additions & 0 deletions examples/helio_gr_test/pl.swiftest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
8
1 6.5537098095653139645e-06
1.6306381826061645943e-05
0.13267502226188271353 0.2786606257975073886 0.010601098875389479426
-11.331978934667442676 4.8184460126705647045 1.4332264599878684131
2 9.663313399581537916e-05
4.0453784346544178454e-05
-0.69398700025820403425 -0.19235393648106968723 0.03740673057980103272
1.9245789988923785786 -7.1528261190002948057 -0.20922405362759749996
3 0.000120026935827952453094
4.25875607065040958e-05
0.49463573470256239073 -0.8874896493821613497 4.051630875713834232e-05
5.386704768180099809 3.0357508899436080915 -0.00016218409216515533796
4 1.2739802010675941456e-05
2.265740805092889601e-05
-1.5655322071100350456 0.56626121192188216824 0.050269397991054412533
-1.5477080637857006753 -4.370087697214287981 -0.05361768768801557225
5 0.037692251088985676735
0.00046732617030490929307
4.0891378954287338487 -2.9329188614380639066 -0.07930573161132697946
1.575024788882753283 2.3719591091996699917 -0.045089307261129988257
6 0.011285899820091272997
0.00038925687730393611812
6.3349788609660162564 -7.674600716671800882 -0.11868650931385750502
1.4598618704191345578 1.2948691245181617393 -0.080593167691228835176
7 0.0017236589478267730203
0.00016953449859497231466
14.832516206189200858 13.032608531076540714 -0.14378102535616668622
-0.9573374666934839659 1.014553546383260322 0.016118112341773867214
8 0.0020336100526728302319
0.000164587904124493665
29.561664938083289655 -4.6012285192418387325 -0.586585578731106283
0.17051705220469790965 1.1424784769020628332 -0.027423757798549895085
192 changes: 192 additions & 0 deletions examples/helio_gr_test/swiftest_relativity.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/helio_gr_test/tp.swifter.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions examples/helio_gr_test/tp.swiftest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
4 changes: 2 additions & 2 deletions examples/helio_swifter_comparison/swiftest_vs_swifter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
"output_type": "stream",
"text": [
"Reading Swiftest file param.swiftest.in\n",
"Reading in time 1.001e+00\n",
"Reading in time 1.000e+00\n",
"Creating Dataset\n",
"Successfully converted 1463 output frames.\n",
"Successfully converted 1462 output frames.\n",
"Swiftest simulation data stored as xarray DataSet .ds\n"
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
{
"data": {
"text/plain": [
"[<matplotlib.lines.Line2D at 0x2acdc3dd7450>,\n",
" <matplotlib.lines.Line2D at 0x2acdc3db7c10>]"
"[<matplotlib.lines.Line2D at 0x2b47a0e74650>,\n",
" <matplotlib.lines.Line2D at 0x2b47a0e71250>]"
]
},
"execution_count": 6,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0
0.00029591220819207774
0.004650467260962157
0.0
0.0
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
sim.param['T0'] = 0.0
sim.param['DT'] = 1.0
sim.param['TSTOP'] = 365.25e1
sim.param['ISTEP_OUT'] = 11
sim.param['ISTEP_DUMP'] = 1
sim.param['ISTEP_OUT'] = 10
sim.param['ISTEP_DUMP'] = 10
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 Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
! VERSION Swifter parameter file converted from Swiftest
T0 0.0
TSTOP 3652.5
DT 1.0
ISTEP_OUT 10
ISTEP_DUMP 10
OUT_FORM XV
OUT_TYPE REAL8
OUT_STAT UNKNOWN
IN_TYPE ASCII
PL_IN pl.swifter.in
TP_IN tp.in
BIN_OUT bin.swifter.dat
ENC_OUT enc.swifter.dat
CHK_QMIN 0.004650467260962157
CHK_RMIN 0.004650467260962157
CHK_RMAX 1000.0
CHK_EJECT 1000.0
CHK_QMIN_COORD HELIO
CHK_QMIN_RANGE 0.004650467260962157 1000.0
EXTRA_FORCE NO
BIG_DISCARD NO
CHK_CLOSE YES
RHILL_PRESENT YES
J2 0.0
J4 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
! VERSION Swiftest parameter input
T0 0.0
TSTOP 3652.5
DT 1.0
ISTEP_OUT 10
ISTEP_DUMP 10
OUT_FORM XV
OUT_TYPE REAL8
OUT_STAT UNKNOWN
IN_TYPE ASCII
PL_IN pl.swiftest.in
TP_IN tp.in
CB_IN cb.swiftest.in
BIN_OUT bin.swiftest.dat
ENC_OUT enc.swiftest.dat
CHK_QMIN 0.004650467260962157
CHK_RMIN 0.004650467260962157
CHK_RMAX 1000.0
CHK_EJECT 1000.0
CHK_QMIN_COORD HELIO
CHK_QMIN_RANGE 0.004650467260962157 1000.0
MU2KG 1.988409870698051e+30
TU2S 86400
DU2M 149597870700.0
EXTRA_FORCE NO
BIG_DISCARD NO
CHK_CLOSE YES
RHILL_PRESENT YES
FRAGMENTATION NO
ROTATION NO
TIDES NO
ENERGY NO
GR NO
YARKOVSKY NO
YORP NO
MTINY 0.0
Loading

0 comments on commit 51f192a

Please sign in to comment.