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

Commit

Permalink
Fixed bug inolving passing a mask array from inside the tp object to …
Browse files Browse the repository at this point in the history
…spill
  • Loading branch information
daminton committed Aug 5, 2021
1 parent 9413e61 commit 883f152
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 199 deletions.
2 changes: 1 addition & 1 deletion examples/helio_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/helio_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/helio_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.0014751244276585862212
1.6306381826061645943e-05
0.33206272695596028566 0.07436707001147663254 -0.02438290851908785084
-4.2340114788918336805 10.486553514018327622 1.2453138107251555947
2 9.663313399581537916e-05 0.006759104275397271956
-0.28963231309350817577 0.18505777632553971346 0.041690199036696552748
-7.636449781071190374 -8.230711833761744002 0.027897889786567415562
2 9.663313399581537916e-05 0.006759070712609563929
4.0453784346544178454e-05
-0.7188115337296047125 -0.0118554711069603201795 0.041316403191083782287
0.07826338813583945357 -7.419533988988633545 -0.10634201014368884618
3 0.000120026935827952453094 0.010044787321379672528
-0.56924731086399205093 -0.4448853077740749229 0.026742834854114529153
4.4970878201205087762 -5.8559309604734073535 -0.33987302067212196325
3 0.000120026935827952453094 0.01004490423927810557
4.25875607065040958e-05
0.35677088372527121507 -0.95189300879814897627 4.4027442504036787155e-05
5.7819217550992820422 2.18192814489641851 -0.00012230072278352209966
4 1.2739802010675941456e-05 0.007246743835971885302
0.68557554005930954055 -0.74774392436574432796 3.3215781231472978855e-05
4.529549698952863699 4.223187462606770848 -0.00021705351084307017903
4 1.2739802010675941456e-05 0.0072466832516755644343
2.265740805092889601e-05
-1.5233712071242269115 0.6723825347339112968 0.051459143378398922164
-1.8728417739956807141 -4.239719661832373223 -0.042909557750301418264
5 0.037692251088985676735 0.35527126534549128905
-1.6149058006556089584 0.39555322375610602048 0.047903023702369727788
-1.0254865811345536522 -4.5279792592715677134 -0.0697376753600697812
5 0.037692251088985676735 0.35527077279847234866
0.00046732617030490929307
4.049944927347420176 -2.9910878677758190314 -0.078187280837353656526
1.6060801375519682711 2.349356876761497338 -0.045690062807172619064
6 0.011285899820091272997 0.4376527512949726007
4.1485722284141921534 -2.8413405904412840641 -0.081015809697524809874
1.5260372589993542462 2.4062964793298095964 -0.044136376192527556195
6 0.011285899820091272997 0.43765804755160246957
0.00038925687730393611812
6.298929503477405767 -7.706413024510769816 -0.11669919842191249504
1.4661378456572359413 1.2872251175075805794 -0.08070991686100478242
7 0.0017236589478267730203 0.4695362423191493196
6.3907469739591356017 -7.624741463389934637 -0.12177209989682470648
1.450023133321789527 1.3067045786330910449 -0.08040773079473842075
7 0.0017236589478267730203 0.46959835521706382437
0.00016953449859497231466
14.856082147529010129 13.007589275314199284 -0.14417795763685259391
-0.9554310497290159123 1.0161753499437922057 0.016099529164307530124
8 0.0020336100526728302319 0.7812870996943599397
14.795764797253550427 13.071447820107550797 -0.14316267052797140846
-0.9602974676407360823 1.012024061970291078 0.016146735322636888151
8 0.0020336100526728302319 0.7813622435281695686
0.000164587904124493665
29.55744967800954015 -4.629377558152945049 -0.58590957207831262377
0.17162147939801157335 1.1422848961108499101 -0.027445465472921385952
29.568167916428858888 -4.5574316836467883007 -0.58763608457780613925
0.16879901777383137264 1.1427778220120381962 -0.027390131426610687076
48 changes: 24 additions & 24 deletions examples/helio_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.0014751244276585862212
1.6306381826061645943e-05
0.33206272695596028566 0.07436707001147663254 -0.02438290851908785084
-4.2340114788918336805 10.486553514018327622 1.2453138107251555947
2 9.663313399581537916e-05
-0.28963231309350817577 0.18505777632553971346 0.041690199036696552748
-7.636449781071190374 -8.230711833761744002 0.027897889786567415562
2 9.663313399581537916e-05 0.006759070712609563929
4.0453784346544178454e-05
-0.7188115337296047125 -0.0118554711069603201795 0.041316403191083782287
0.07826338813583945357 -7.419533988988633545 -0.10634201014368884618
3 0.000120026935827952453094
-0.56924731086399205093 -0.4448853077740749229 0.026742834854114529153
4.4970878201205087762 -5.8559309604734073535 -0.33987302067212196325
3 0.000120026935827952453094 0.01004490423927810557
4.25875607065040958e-05
0.35677088372527121507 -0.95189300879814897627 4.4027442504036787155e-05
5.7819217550992820422 2.18192814489641851 -0.00012230072278352209966
4 1.2739802010675941456e-05
0.68557554005930954055 -0.74774392436574432796 3.3215781231472978855e-05
4.529549698952863699 4.223187462606770848 -0.00021705351084307017903
4 1.2739802010675941456e-05 0.0072466832516755644343
2.265740805092889601e-05
-1.5233712071242269115 0.6723825347339112968 0.051459143378398922164
-1.8728417739956807141 -4.239719661832373223 -0.042909557750301418264
5 0.037692251088985676735
-1.6149058006556089584 0.39555322375610602048 0.047903023702369727788
-1.0254865811345536522 -4.5279792592715677134 -0.0697376753600697812
5 0.037692251088985676735 0.35527077279847234866
0.00046732617030490929307
4.049944927347420176 -2.9910878677758190314 -0.078187280837353656526
1.6060801375519682711 2.349356876761497338 -0.045690062807172619064
6 0.011285899820091272997
4.1485722284141921534 -2.8413405904412840641 -0.081015809697524809874
1.5260372589993542462 2.4062964793298095964 -0.044136376192527556195
6 0.011285899820091272997 0.43765804755160246957
0.00038925687730393611812
6.298929503477405767 -7.706413024510769816 -0.11669919842191249504
1.4661378456572359413 1.2872251175075805794 -0.08070991686100478242
7 0.0017236589478267730203
6.3907469739591356017 -7.624741463389934637 -0.12177209989682470648
1.450023133321789527 1.3067045786330910449 -0.08040773079473842075
7 0.0017236589478267730203 0.46959835521706382437
0.00016953449859497231466
14.856082147529010129 13.007589275314199284 -0.14417795763685259391
-0.9554310497290159123 1.0161753499437922057 0.016099529164307530124
8 0.0020336100526728302319
14.795764797253550427 13.071447820107550797 -0.14316267052797140846
-0.9602974676407360823 1.012024061970291078 0.016146735322636888151
8 0.0020336100526728302319 0.7813622435281695686
0.000164587904124493665
29.55744967800954015 -4.629377558152945049 -0.58590957207831262377
0.17162147939801157335 1.1422848961108499101 -0.027445465472921385952
29.568167916428858888 -4.5574316836467883007 -0.58763608457780613925
0.16879901777383137264 1.1427778220120381962 -0.027390131426610687076
99 changes: 30 additions & 69 deletions examples/helio_swifter_comparison/swiftest_vs_swifter.ipynb

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions examples/helio_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.1229161119197987873 1.8522237100026059942 -0.33259854925516180169
-2.5472645182622320396 2.6008026042341226758 0.5514976560945522932
102
3.0206599411327550442 -1.0715345879373190385 0.4820489106686373093
0.64736314289225124926 2.5354787229381968757 -1.8109825958052419904
3.054386355288102095 -0.9095218820160763107 0.36697667872479622364
0.4222440438063146342 2.6085624551380790432 -1.8425471496071408667
103
-0.47156753362343428737 -3.1411451968218520037 0.73253063903937232215
3.067486522793096946 -0.061867034122113133084 -0.11064022385054755856
-0.27747800994574201017 -3.1378821872210798105 0.72389993067619795575
3.09473043735936102 0.16643076629286349722 -0.16359842504957606916
104
-2.0454358521790818592 -0.83017357434175576003 0.27369621627497042748
1.8825682786003801814 -3.9015333153827542793 -0.112405737336568095776
-1.9125286108430290533 -1.0693208643153691018 0.26467515987932982435
2.3353854076771408592 -3.6840315362407642648 -0.17400766828131512544
16 changes: 8 additions & 8 deletions examples/helio_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.1229161119197987873 1.8522237100026059942 -0.33259854925516180169
-2.5472645182622320396 2.6008026042341226758 0.5514976560945522932
102
3.0206599411327550442 -1.0715345879373190385 0.4820489106686373093
0.64736314289225124926 2.5354787229381968757 -1.8109825958052419904
3.054386355288102095 -0.9095218820160763107 0.36697667872479622364
0.4222440438063146342 2.6085624551380790432 -1.8425471496071408667
103
-0.47156753362343428737 -3.1411451968218520037 0.73253063903937232215
3.067486522793096946 -0.061867034122113133084 -0.11064022385054755856
-0.27747800994574201017 -3.1378821872210798105 0.72389993067619795575
3.09473043735936102 0.16643076629286349722 -0.16359842504957606916
104
-2.0454358521790818592 -0.83017357434175576003 0.27369621627497042748
1.8825682786003801814 -3.9015333153827542793 -0.112405737336568095776
-1.9125286108430290533 -1.0693208643153691018 0.26467515987932982435
2.3353854076771408592 -3.6840315362407642648 -0.17400766828131512544
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.0014751242768086609319
1 6.5537098095653139645e-06 0.0014751244276585862212
1.6306381826061645943e-05
-0.21794225400065470044 0.24570059548519398995 0.040069659678364698274
-9.768342370075118952 -6.4098488749322373205 0.37225116289830816995
2 9.663313399581537916e-05 0.0067590742435367571566
-0.28963231309350817577 0.18505777632553971346 0.041690199036696552748
-7.636449781071190374 -8.230711833761744002 0.027897889786567415562
2 9.663313399581537916e-05 0.006759070712609563929
4.0453784346544178454e-05
-0.60413504586259936247 -0.39527613440541492507 0.029436881824798030033
3.992938767473374092 -6.2169034295501688922 -0.3157349287333398891
3 0.000120026935827952453094 0.010044891628501106769
-0.56924731086399205093 -0.4448853077740749229 0.026742834854114529153
4.4970878201205087762 -5.8559309604734073535 -0.33987302067212196325
3 0.000120026935827952453094 0.01004490423927810557
4.25875607065040958e-05
0.6475137988388671717 -0.78146344078682306034 3.4954277703126252982e-05
4.7364737841481480227 3.9858178826605781494 -0.000206181980282845843
4 1.2739802010675941456e-05 0.0072466933032545104062
0.68557554005930954055 -0.74774392436574432796 3.3215781231472978855e-05
4.529549698952863699 4.223187462606770848 -0.00021705351084307017903
4 1.2739802010675941456e-05 0.0072466832516755644343
2.265740805092889601e-05
-1.6060166552595489531 0.43262604649099911658 0.048461907252935247647
-1.1388942318608360441 -4.4988235352611598648 -0.066344559364066134143
5 0.037692251088985676735 0.3552707368190505097
-1.6149058006556089584 0.39555322375610602048 0.047903023702369727788
-1.0254865811345536522 -4.5279792592715677134 -0.0697376753600697812
5 0.037692251088985676735 0.35527077279847234866
0.00046732617030490929307
4.1359946230316175786 -2.8610749953481979801 -0.08065244615734604161
1.536603427793050461 2.399023353553466048 -0.044342472584791124157
6 0.011285899820091272997 0.4376572328164372643
4.1485722284141921534 -2.8413405904412840641 -0.081015809697524809874
1.5260372589993542462 2.4062964793298095964 -0.044136376192527556195
6 0.011285899820091272997 0.43765804755160246957
0.00038925687730393611812
6.3788284394924916754 -7.635463758938534795 -0.121111501730720202974
1.4521392831727842248 1.3041738917825064364 -0.08044788317293871613
7 0.0017236589478267730203 0.46959013246222981483
6.3907469739591356017 -7.624741463389934637 -0.12177209989682470648
1.450023133321789527 1.3067045786330910449 -0.08040773079473842075
7 0.0017236589478267730203 0.46959835521706382437
0.00016953449859497231466
14.803649648126269156 13.063133279359290029 -0.14329526741228329478
-0.9596636872292902537 1.0125665712568530355 0.016140607193432704789
8 0.0020336100526728302319 0.78135207839715916734
14.795764797253550427 13.071447820107550797 -0.14316267052797140846
-0.9602974676407360823 1.012024061970291078 0.016146735322636888151
8 0.0020336100526728302319 0.7813622435281695686
0.000164587904124493665
29.566779964594630314 -4.5668176855665958414 -0.58741108465859714904
0.16916723445783939828 1.142713652049310879 -0.027397346380668001207
29.568167916428858888 -4.5574316836467883007 -0.58763608457780613925
0.16879901777383137264 1.1427778220120381962 -0.027390131426610687076
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 0.0014751242768086609319
1 6.5537098095653139645e-06 0.0014751244276585862212
1.6306381826061645943e-05
-0.21794225400065470044 0.24570059548519398995 0.040069659678364698274
-9.768342370075118952 -6.4098488749322373205 0.37225116289830816995
2 9.663313399581537916e-05 0.0067590742435367571566
-0.28963231309350817577 0.18505777632553971346 0.041690199036696552748
-7.636449781071190374 -8.230711833761744002 0.027897889786567415562
2 9.663313399581537916e-05 0.006759070712609563929
4.0453784346544178454e-05
-0.60413504586259936247 -0.39527613440541492507 0.029436881824798030033
3.992938767473374092 -6.2169034295501688922 -0.3157349287333398891
3 0.000120026935827952453094 0.010044891628501106769
-0.56924731086399205093 -0.4448853077740749229 0.026742834854114529153
4.4970878201205087762 -5.8559309604734073535 -0.33987302067212196325
3 0.000120026935827952453094 0.01004490423927810557
4.25875607065040958e-05
0.6475137988388671717 -0.78146344078682306034 3.4954277703126252982e-05
4.7364737841481480227 3.9858178826605781494 -0.000206181980282845843
4 1.2739802010675941456e-05 0.0072466933032545104062
0.68557554005930954055 -0.74774392436574432796 3.3215781231472978855e-05
4.529549698952863699 4.223187462606770848 -0.00021705351084307017903
4 1.2739802010675941456e-05 0.0072466832516755644343
2.265740805092889601e-05
-1.6060166552595489531 0.43262604649099911658 0.048461907252935247647
-1.1388942318608360441 -4.4988235352611598648 -0.066344559364066134143
5 0.037692251088985676735 0.3552707368190505097
-1.6149058006556089584 0.39555322375610602048 0.047903023702369727788
-1.0254865811345536522 -4.5279792592715677134 -0.0697376753600697812
5 0.037692251088985676735 0.35527077279847234866
0.00046732617030490929307
4.1359946230316175786 -2.8610749953481979801 -0.08065244615734604161
1.536603427793050461 2.399023353553466048 -0.044342472584791124157
6 0.011285899820091272997 0.4376572328164372643
4.1485722284141921534 -2.8413405904412840641 -0.081015809697524809874
1.5260372589993542462 2.4062964793298095964 -0.044136376192527556195
6 0.011285899820091272997 0.43765804755160246957
0.00038925687730393611812
6.3788284394924916754 -7.635463758938534795 -0.121111501730720202974
1.4521392831727842248 1.3041738917825064364 -0.08044788317293871613
7 0.0017236589478267730203 0.46959013246222981483
6.3907469739591356017 -7.624741463389934637 -0.12177209989682470648
1.450023133321789527 1.3067045786330910449 -0.08040773079473842075
7 0.0017236589478267730203 0.46959835521706382437
0.00016953449859497231466
14.803649648126269156 13.063133279359290029 -0.14329526741228329478
-0.9596636872292902537 1.0125665712568530355 0.016140607193432704789
8 0.0020336100526728302319 0.78135207839715916734
14.795764797253550427 13.071447820107550797 -0.14316267052797140846
-0.9602974676407360823 1.012024061970291078 0.016146735322636888151
8 0.0020336100526728302319 0.7813622435281695686
0.000164587904124493665
29.566779964594630314 -4.5668176855665958414 -0.58741108465859714904
0.16916723445783939828 1.142713652049310879 -0.027397346380668001207
29.568167916428858888 -4.5574316836467883007 -0.58763608457780613925
0.16879901777383137264 1.1427778220120381962 -0.027390131426610687076
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.1437140623725170485 1.8307543455088179929 -0.33710883085786358393
-2.5169991736250634084 2.6269266483088493027 0.54674712095669365287
2.1229161119197987873 1.8522237100026059942 -0.33259854925516180169
-2.5472645182622320396 2.6008026042341226758 0.5514976560945522932
102
3.0507953356624089025 -0.9309107058567914761 0.38209550228666327998
0.45214249601424874418 2.5995875558304815747 -1.8388641770977671949
3.054386355288102095 -0.9095218820160763107 0.36697667872479622364
0.4222440438063146342 2.6085624551380790432 -1.8425471496071408667
103
-0.30288545144121659103 -3.139125526168093927 0.7252151132548391166
3.0919425994019995516 0.13633790246363267858 -0.15665049243950410883
-0.27747800994574201017 -3.1378821872210798105 0.72389993067619795575
3.09473043735936102 0.16643076629286349722 -0.16359842504957606916
104
-1.9314729940131600827 -1.0389307897540689396 0.26607157142831372454
2.2775049779995786108 -3.7157836040053666307 -0.16601542341215017115
-1.9125286108430290533 -1.0693208643153691018 0.26467515987932982435
2.3353854076771408592 -3.6840315362407642648 -0.17400766828131512544
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.1437140623725170485 1.8307543455088179929 -0.33710883085786358393
-2.5169991736250634084 2.6269266483088493027 0.54674712095669365287
2.1229161119197987873 1.8522237100026059942 -0.33259854925516180169
-2.5472645182622320396 2.6008026042341226758 0.5514976560945522932
102
3.0507953356624089025 -0.9309107058567914761 0.38209550228666327998
0.45214249601424874418 2.5995875558304815747 -1.8388641770977671949
3.054386355288102095 -0.9095218820160763107 0.36697667872479622364
0.4222440438063146342 2.6085624551380790432 -1.8425471496071408667
103
-0.30288545144121659103 -3.139125526168093927 0.7252151132548391166
3.0919425994019995516 0.13633790246363267858 -0.15665049243950410883
-0.27747800994574201017 -3.1378821872210798105 0.72389993067619795575
3.09473043735936102 0.16643076629286349722 -0.16359842504957606916
104
-1.9314729940131600827 -1.0389307897540689396 0.26607157142831372454
2.2775049779995786108 -3.7157836040053666307 -0.16601542341215017115
-1.9125286108430290533 -1.0693208643153691018 0.26467515987932982435
2.3353854076771408592 -3.6840315362407642648 -0.17400766828131512544
7 changes: 6 additions & 1 deletion src/discard/discard.f90
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ module subroutine discard_tp(self, system, param)
class(swiftest_tp), intent(inout) :: self !! Swiftest test particle object
class(swiftest_nbody_system), intent(inout) :: system !! Swiftest nbody system object
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameter
! Internals
logical, dimension(:), allocatable :: ldiscard

associate(tp => self, ntp => self%nbody, cb => system%cb, pl => system%pl, npl => system%pl%nbody)
if ((ntp == 0) .or. (npl ==0)) return
Expand All @@ -70,7 +72,10 @@ module subroutine discard_tp(self, system, param)
if ((param%rmin >= 0.0_DP) .or. (param%rmax >= 0.0_DP) .or. (param%rmaxu >= 0.0_DP)) call discard_cb_tp(tp, system, param)
if (param%qmin >= 0.0_DP) call discard_peri_tp(tp, system, param)
if (param%lclose) call discard_pl_tp(tp, system, param)
if (any(tp%ldiscard)) call tp%spill(system%tp_discards, tp%ldiscard, ldestructive=.true.)
if (any(tp%ldiscard)) then
allocate(ldiscard, source=tp%ldiscard)
call tp%spill(system%tp_discards, ldiscard, ldestructive=.true.)
end if
end associate

return
Expand Down

0 comments on commit 883f152

Please sign in to comment.