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

Commit

Permalink
Cleaned up WHM initial conditions generator script
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jul 28, 2021
1 parent bc943d3 commit 7694a02
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 70 deletions.
5 changes: 0 additions & 5 deletions examples/whm_swifter_comparison/init_cond.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/usr/bin/env python3
import swiftest
import numpy as np
import sys
from astroquery.jplhorizons import Horizons
import astropy.constants as const
from scipy.io import FortranFile

sim = swiftest.Simulation()

Expand Down
2 changes: 1 addition & 1 deletion examples/whm_swifter_comparison/param.swifter.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ CHK_QMIN_RANGE 0.004650467260962157 1000.0
EXTRA_FORCE NO
BIG_DISCARD NO
CHK_CLOSE YES
RHILL_PRESENT YES
J2 4.7535806948127355e-12
J4 -2.2473967953572827e-18
RHILL_PRESENT YES
1 change: 1 addition & 0 deletions examples/whm_swifter_comparison/param.swiftest.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ DU2M 149597870700.0
EXTRA_FORCE NO
BIG_DISCARD NO
CHK_CLOSE YES
RHILL_PRESENT YES
FRAGMENTATION NO
ROTATION NO
TIDES NO
Expand Down
48 changes: 24 additions & 24 deletions examples/whm_swifter_comparison/pl.swifter.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
0 39.476926408897625196
0.0 0.0 0.0
0.0 0.0 0.0
1 6.5537098095653139645e-06 0.0014751243077781048702
1 6.5537098095653139645e-06 0.0014751238438755500459
1.6306381826061645943e-05
0.33206272695596028566 0.07436707001147663254 -0.02438290851908785084
-4.2340114788918336805 10.486553514018327622 1.2453138107251555947
2 9.663313399581537916e-05 0.006759104275397271956
-0.065841771551149230746 0.30388831943526661838 0.030872485461978960153
-12.104810966946379345 -1.8005812017180330847 0.9632304211885714761
2 9.663313399581537916e-05 0.006759080797928606587
4.0453784346544178454e-05
-0.7188115337296047125 -0.0118554711069603201795 0.041316403191083782287
0.07826338813583945357 -7.419533988988633545 -0.10634201014368884618
3 0.000120026935827952453094 0.010044787321379672528
-0.65269716062695148917 -0.3065765656441301057 0.033456491497379246824
3.0899533953493179043 -6.72112303206047562 -0.2705477431358893059
3 0.000120026935827952453094 0.010044868190633438806
4.25875607065040958e-05
0.35677088372527121507 -0.95189300879814897627 4.4027442504036787155e-05
5.7819217550992820422 2.18192814489641851 -0.00012230072278352209966
4 1.2739802010675941456e-05 0.007246743835971885302
0.58046286084934750615 -0.8332000042504307258 3.7646553415201541957e-05
5.053802748240266633 3.568560918001247615 -0.0001869334511378976778
4 1.2739802010675941456e-05 0.0072467082986392815006
2.265740805092889601e-05
-1.5233712071242269115 0.6723825347339112968 0.051459143378398922164
-1.8728417739956807141 -4.239719661832373223 -0.042909557750301418264
5 0.037692251088985676735 0.35527126534549128905
-1.5891417403740180081 0.4938480736359250889 0.049330990309104823244
-1.3261523862597792352 -4.4445327547884994806 -0.060612990482397517785
5 0.037692251088985676735 0.3552707649709459117
0.00046732617030490929307
4.049944927347420176 -2.9910878677758190314 -0.078187280837353656526
1.6060801375519682711 2.349356876761497338 -0.045690062807172619064
6 0.011285899820091272997 0.4376527512949726007
4.1148395833578952363 -2.8938323061728068453 -0.080043092204059404504
1.5541304908644199467 2.386798324664287883 -0.044683660603562371893
6 0.011285899820091272997 0.43765596788571493287
0.00038925687730393611812
6.298929503477405767 -7.706413024510769816 -0.11669919842191249504
1.4661378456572359413 1.2872251175075805794 -0.08070991686100478242
7 0.0017236589478267730203 0.4695362423191493196
6.3589256477393849565 -7.653288021415167286 -0.12000977499446359442
1.4556566113591374531 1.2999494788820976765 -0.08051428750367411639
7 0.0017236589478267730203 0.46957663585116591335
0.00016953449859497231466
14.856082147529010129 13.007589275314199284 -0.14417795763685259391
-0.9554310497290159123 1.0161753499437922057 0.016099529164307530124
8 0.0020336100526728302319 0.7812870996943599397
14.816779495279050138 13.049265812461410263 -0.14351615042000470668
-0.9586068527340353378 1.013470229424341294 0.01613039934499510156
8 0.0020336100526728302319 0.7813355837717117843
0.000164587904124493665
29.55744967800954015 -4.629377558152945049 -0.58590957207831262377
0.17162147939801157335 1.1422848961108499101 -0.027445465472921385952
29.564459991843019537 -4.5824598513731222837 -0.5870359532621901577
0.1697807691732287658 1.1426067858222827636 -0.027409347819614317105
48 changes: 24 additions & 24 deletions examples/whm_swifter_comparison/pl.swiftest.in
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
8
1 6.5537098095653139645e-06
1 6.5537098095653139645e-06 0.0014751238438755500459
1.6306381826061645943e-05
0.33206272695596028566 0.07436707001147663254 -0.02438290851908785084
-4.2340114788918336805 10.486553514018327622 1.2453138107251555947
2 9.663313399581537916e-05
-0.065841771551149230746 0.30388831943526661838 0.030872485461978960153
-12.104810966946379345 -1.8005812017180330847 0.9632304211885714761
2 9.663313399581537916e-05 0.006759080797928606587
4.0453784346544178454e-05
-0.7188115337296047125 -0.0118554711069603201795 0.041316403191083782287
0.07826338813583945357 -7.419533988988633545 -0.10634201014368884618
3 0.000120026935827952453094
-0.65269716062695148917 -0.3065765656441301057 0.033456491497379246824
3.0899533953493179043 -6.72112303206047562 -0.2705477431358893059
3 0.000120026935827952453094 0.010044868190633438806
4.25875607065040958e-05
0.35677088372527121507 -0.95189300879814897627 4.4027442504036787155e-05
5.7819217550992820422 2.18192814489641851 -0.00012230072278352209966
4 1.2739802010675941456e-05
0.58046286084934750615 -0.8332000042504307258 3.7646553415201541957e-05
5.053802748240266633 3.568560918001247615 -0.0001869334511378976778
4 1.2739802010675941456e-05 0.0072467082986392815006
2.265740805092889601e-05
-1.5233712071242269115 0.6723825347339112968 0.051459143378398922164
-1.8728417739956807141 -4.239719661832373223 -0.042909557750301418264
5 0.037692251088985676735
-1.5891417403740180081 0.4938480736359250889 0.049330990309104823244
-1.3261523862597792352 -4.4445327547884994806 -0.060612990482397517785
5 0.037692251088985676735 0.3552707649709459117
0.00046732617030490929307
4.049944927347420176 -2.9910878677758190314 -0.078187280837353656526
1.6060801375519682711 2.349356876761497338 -0.045690062807172619064
6 0.011285899820091272997
4.1148395833578952363 -2.8938323061728068453 -0.080043092204059404504
1.5541304908644199467 2.386798324664287883 -0.044683660603562371893
6 0.011285899820091272997 0.43765596788571493287
0.00038925687730393611812
6.298929503477405767 -7.706413024510769816 -0.11669919842191249504
1.4661378456572359413 1.2872251175075805794 -0.08070991686100478242
7 0.0017236589478267730203
6.3589256477393849565 -7.653288021415167286 -0.12000977499446359442
1.4556566113591374531 1.2999494788820976765 -0.08051428750367411639
7 0.0017236589478267730203 0.46957663585116591335
0.00016953449859497231466
14.856082147529010129 13.007589275314199284 -0.14417795763685259391
-0.9554310497290159123 1.0161753499437922057 0.016099529164307530124
8 0.0020336100526728302319
14.816779495279050138 13.049265812461410263 -0.14351615042000470668
-0.9586068527340353378 1.013470229424341294 0.01613039934499510156
8 0.0020336100526728302319 0.7813355837717117843
0.000164587904124493665
29.55744967800954015 -4.629377558152945049 -0.58590957207831262377
0.17162147939801157335 1.1422848961108499101 -0.027445465472921385952
29.564459991843019537 -4.5824598513731222837 -0.5870359532621901577
0.1697807691732287658 1.1426067858222827636 -0.027409347819614317105
16 changes: 8 additions & 8 deletions examples/whm_swifter_comparison/tp.swifter.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
4
101
2.2759060918449769417 1.6823262546111898974 -0.3661544509052930274
-2.3097811686367798667 2.7916683305060454227 0.51377483806222698173
2.1778219831071528034 1.7945000787160070299 -0.344538568144980073
-2.4660672364316131263 2.6696516059587804457 0.5387135399929646282
102
3.0206599411327550442 -1.0715345879373190385 0.4820489106686373093
0.64736314289225124926 2.5354787229381968757 -1.8109825958052419904
3.0442667013982411817 -0.9663926835590784803 0.40722457070173800897
0.50161667633754136036 2.5842510880432738114 -1.8324318157740491254
103
-0.47156753362343428737 -3.1411451968218520037 0.73253063903937232215
3.067486522793096946 -0.061867034122113133084 -0.11064022385054755856
-0.34517723265404320898 -3.1406497314215879868 0.72728042419722227496
3.0867794854837949715 0.086392107735322389756 -0.14509697121440676101
104
-2.0454358521790818592 -0.83017357434175576003 0.27369621627497042748
1.8825682786003801814 -3.9015333153827542793 -0.112405737336568095776
-1.9619853530057589364 -0.98771442784664698067 0.2682528168870427776
2.180176917968356245 -3.7664581464574479557 -0.15265740558307136673
16 changes: 8 additions & 8 deletions examples/whm_swifter_comparison/tp.swiftest.in
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
4
101
2.2759060918449769417 1.6823262546111898974 -0.3661544509052930274
-2.3097811686367798667 2.7916683305060454227 0.51377483806222698173
2.1778219831071528034 1.7945000787160070299 -0.344538568144980073
-2.4660672364316131263 2.6696516059587804457 0.5387135399929646282
102
3.0206599411327550442 -1.0715345879373190385 0.4820489106686373093
0.64736314289225124926 2.5354787229381968757 -1.8109825958052419904
3.0442667013982411817 -0.9663926835590784803 0.40722457070173800897
0.50161667633754136036 2.5842510880432738114 -1.8324318157740491254
103
-0.47156753362343428737 -3.1411451968218520037 0.73253063903937232215
3.067486522793096946 -0.061867034122113133084 -0.11064022385054755856
-0.34517723265404320898 -3.1406497314215879868 0.72728042419722227496
3.0867794854837949715 0.086392107735322389756 -0.14509697121440676101
104
-2.0454358521790818592 -0.83017357434175576003 0.27369621627497042748
1.8825682786003801814 -3.9015333153827542793 -0.112405737336568095776
-1.9619853530057589364 -0.98771442784664698067 0.2682528168870427776
2.180176917968356245 -3.7664581464574479557 -0.15265740558307136673
1 change: 1 addition & 0 deletions src/whm/whm_setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module subroutine whm_setup_initialize_system(self, param)
! First we need to make sure that the massive bodies are sorted by heliocentric distance before computing jacobies
call util_set_ir3h(self%pl)
call self%pl%sort("ir3h", ascending=.false.)

! Make sure that the discard list gets allocated initially
call self%tp_discards%setup(self%tp%nbody)
call self%pl%set_mu(self%cb)
Expand Down

0 comments on commit 7694a02

Please sign in to comment.