diff --git a/examples/Basic_Simulation/initial_conditions.py b/examples/Basic_Simulation/initial_conditions.py index 693e61f33..1b9dd123b 100644 --- a/examples/Basic_Simulation/initial_conditions.py +++ b/examples/Basic_Simulation/initial_conditions.py @@ -1,5 +1,5 @@ """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Basic_Simulation/output_reader.py b/examples/Basic_Simulation/output_reader.py index 37942000a..278ed3abd 100644 --- a/examples/Basic_Simulation/output_reader.py +++ b/examples/Basic_Simulation/output_reader.py @@ -1,5 +1,5 @@ """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Chambers2013/init_cond.py b/examples/Chambers2013/init_cond.py index 4418b5349..91a301886 100755 --- a/examples/Chambers2013/init_cond.py +++ b/examples/Chambers2013/init_cond.py @@ -1,3 +1,14 @@ +""" + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + This file is part of Swiftest. + Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + You should have received a copy of the GNU General Public License along with Swiftest. + If not, see: https://www.gnu.org/licenses. +""" + #!/usr/bin/env python3 import swiftest import numpy as np diff --git a/examples/Chambers2013/scattermovie.py b/examples/Chambers2013/scattermovie.py index 09b29072a..c9bcfded1 100755 --- a/examples/Chambers2013/scattermovie.py +++ b/examples/Chambers2013/scattermovie.py @@ -1,3 +1,14 @@ +""" + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + This file is part of Swiftest. + Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + You should have received a copy of the GNU General Public License along with Swiftest. + If not, see: https://www.gnu.org/licenses. +""" + #!/usr/bin/env python3 import swiftest import numpy as np diff --git a/examples/Fragmentation/Fragmentation_Movie.py b/examples/Fragmentation/Fragmentation_Movie.py index 89494d56f..fd8976bbc 100755 --- a/examples/Fragmentation/Fragmentation_Movie.py +++ b/examples/Fragmentation/Fragmentation_Movie.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -152,12 +152,12 @@ def encounter_combiner(sim): ds = xr.combine_nested([data,enc],concat_dim='time').sortby("time").interpolate_na(dim="time") # Rename the merged Target body so that their data can be combined - tname=[n for n in ds['name'].data if "Target" in n] - nottname=[n for n in ds['name'].data if "Target" not in n] + tname=[n for n in ds['name'].data if names[0] in n] + nottname=[n for n in ds['name'].data if names[0] not in n] dslist = [] for n in tname: dsnew = ds.sel(name=n) - dsnew['name'] = "Target" + dsnew['name'] = names[0] dslist.append(dsnew) newds = xr.merge(dslist,compat="no_conflicts") @@ -165,7 +165,7 @@ def encounter_combiner(sim): # Interpolate in time to make a smooth, constant time step dataset # Add a bit of padding to the time, otherwise there are some issues with the interpolation in the last few frames. - smooth_time = np.linspace(start=tgood.isel(time=0), stop=ds.time[-1], num=int(1.2*num_movie_frames)) + smooth_time = np.linspace(start=ds.time[0], stop=ds.time[-1], num=int(1.2*num_movie_frames)) ds = ds.interp(time=smooth_time) ds['rotangle'] = xr.zeros_like(ds['rot']) ds['rot'] = ds['rot'].fillna(0.0) @@ -183,7 +183,7 @@ class AnimatedScatter(object): """An animated scatter plot using matplotlib.animations.FuncAnimation.""" def __init__(self, sim, animfile, title, style, nskip=1): - + self.sim = sim self.ds = encounter_combiner(sim) self.npl = len(self.ds['name']) - 1 self.title = title @@ -206,8 +206,8 @@ def setup_plot(self): # Calculate the distance along the y-axis between the colliding bodies at the start of the simulation. # This will be used to scale the axis limits on the movie. - rhy1 = self.ds['rh'].sel(name="Target",space='y').isel(time=0).values[()] - rhy2 = self.ds['rh'].sel(name="Projectile",space='y').isel(time=0).values[()] + rhy1 = self.sim.data['rh'].sel(name=names[0],space='y').isel(time=0).values[()] + rhy2 = self.sim.data['rh'].sel(name=names[1],space='y').isel(time=0).values[()] scale_frame = abs(rhy1) + abs(rhy2) if "hitandrun" in style: diff --git a/examples/Fragmentation/Multibody_Movie.py b/examples/Fragmentation/Multibody_Movie.py index 6751573b3..7127c980c 100755 --- a/examples/Fragmentation/Multibody_Movie.py +++ b/examples/Fragmentation/Multibody_Movie.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Fragmentation/swiftest_fragmentation.py b/examples/Fragmentation/swiftest_fragmentation.py index 417c01577..f48ccfc86 100644 --- a/examples/Fragmentation/swiftest_fragmentation.py +++ b/examples/Fragmentation/swiftest_fragmentation.py @@ -1,5 +1,5 @@ """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/cb.in b/examples/Swifter_Swiftest/cb.in index 29c8a7fca..5e69f346c 100644 --- a/examples/Swifter_Swiftest/cb.in +++ b/examples/Swifter_Swiftest/cb.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/param.swifter.in b/examples/Swifter_Swiftest/param.swifter.in index 7c906f850..11353ab11 100644 --- a/examples/Swifter_Swiftest/param.swifter.in +++ b/examples/Swifter_Swiftest/param.swifter.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/param.swiftest.in b/examples/Swifter_Swiftest/param.swiftest.in index 36e38c8cd..3ed2d35c8 100644 --- a/examples/Swifter_Swiftest/param.swiftest.in +++ b/examples/Swifter_Swiftest/param.swiftest.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/pl.swifter.in b/examples/Swifter_Swiftest/pl.swifter.in index 83b4ef030..b06654c41 100644 --- a/examples/Swifter_Swiftest/pl.swifter.in +++ b/examples/Swifter_Swiftest/pl.swifter.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/pl.swiftest.in b/examples/Swifter_Swiftest/pl.swiftest.in index f53409e78..fc40a2ab3 100644 --- a/examples/Swifter_Swiftest/pl.swiftest.in +++ b/examples/Swifter_Swiftest/pl.swiftest.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/swifter_start.in b/examples/Swifter_Swiftest/swifter_start.in index 408a4b920..7997921b6 100644 --- a/examples/Swifter_Swiftest/swifter_start.in +++ b/examples/Swifter_Swiftest/swifter_start.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/swifter_swiftest_comp.py b/examples/Swifter_Swiftest/swifter_swiftest_comp.py index cf7bc70ce..79ec247cf 100644 --- a/examples/Swifter_Swiftest/swifter_swiftest_comp.py +++ b/examples/Swifter_Swiftest/swifter_swiftest_comp.py @@ -1,5 +1,5 @@ """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/tp.swifter.in b/examples/Swifter_Swiftest/tp.swifter.in index 9f1b4e335..be1d95e8b 100644 --- a/examples/Swifter_Swiftest/tp.swifter.in +++ b/examples/Swifter_Swiftest/tp.swifter.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/Swifter_Swiftest/tp.swiftest.in b/examples/Swifter_Swiftest/tp.swiftest.in index e8349c408..a09e98094 100644 --- a/examples/Swifter_Swiftest/tp.swiftest.in +++ b/examples/Swifter_Swiftest/tp.swiftest.in @@ -1,4 +1,4 @@ -!! Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh !! This file is part of Swiftest. !! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License !! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/helio_gr_test/helio_gr_test.py b/examples/helio_gr_test/helio_gr_test.py index 64ad2e388..a416fbdd1 100644 --- a/examples/helio_gr_test/helio_gr_test.py +++ b/examples/helio_gr_test/helio_gr_test.py @@ -1,5 +1,5 @@ """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/examples/helio_neptune_pluto/param.in b/examples/helio_neptune_pluto/param.in index 27c0f31b2..50736acc7 100644 --- a/examples/helio_neptune_pluto/param.in +++ b/examples/helio_neptune_pluto/param.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + ! VERSION Swiftest parameter input from file param.in T0 0.0 TSTOP 100000.0 diff --git a/examples/symba_swifter_comparison/1pl_1pl_collision/param.swiftest.in b/examples/symba_swifter_comparison/1pl_1pl_collision/param.swiftest.in index 879746295..aa2702302 100644 --- a/examples/symba_swifter_comparison/1pl_1pl_collision/param.swiftest.in +++ b/examples/symba_swifter_comparison/1pl_1pl_collision/param.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + ! VERSION Swiftest parameter input T0 0.0 TSTOP 1.0 diff --git a/examples/symba_swifter_comparison/1pl_1pl_collision/pl.swiftest.in b/examples/symba_swifter_comparison/1pl_1pl_collision/pl.swiftest.in index 07f149a7b..f0513d13d 100644 --- a/examples/symba_swifter_comparison/1pl_1pl_collision/pl.swiftest.in +++ b/examples/symba_swifter_comparison/1pl_1pl_collision/pl.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 2 Mercury 6.553709809565314146e-06 0.0014751274547839194341 1.6306381826061645943e-05 diff --git a/examples/symba_swifter_comparison/1pl_1pl_collision/sun_MsunAUYR.in b/examples/symba_swifter_comparison/1pl_1pl_collision/sun_MsunAUYR.in index b2cb85c35..5e69f346c 100644 --- a/examples/symba_swifter_comparison/1pl_1pl_collision/sun_MsunAUYR.in +++ b/examples/symba_swifter_comparison/1pl_1pl_collision/sun_MsunAUYR.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + Sun 39.476926408897626 0.004650467260962157 diff --git a/examples/symba_swifter_comparison/1pl_1pl_collision/tp.swiftest.in b/examples/symba_swifter_comparison/1pl_1pl_collision/tp.swiftest.in index 573541ac9..78a4f20a6 100644 --- a/examples/symba_swifter_comparison/1pl_1pl_collision/tp.swiftest.in +++ b/examples/symba_swifter_comparison/1pl_1pl_collision/tp.swiftest.in @@ -1 +1,10 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 0 diff --git a/examples/symba_swifter_comparison/1pl_1tp_collision/param.swiftest.in b/examples/symba_swifter_comparison/1pl_1tp_collision/param.swiftest.in index a1e9e3d0a..b705f5c90 100644 --- a/examples/symba_swifter_comparison/1pl_1tp_collision/param.swiftest.in +++ b/examples/symba_swifter_comparison/1pl_1tp_collision/param.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + ! VERSION Swiftest parameter input T0 0.0 TSTOP 1.0 diff --git a/examples/symba_swifter_comparison/1pl_1tp_collision/pl.swiftest.in b/examples/symba_swifter_comparison/1pl_1tp_collision/pl.swiftest.in index 08e5b2d23..d148361af 100644 --- a/examples/symba_swifter_comparison/1pl_1tp_collision/pl.swiftest.in +++ b/examples/symba_swifter_comparison/1pl_1tp_collision/pl.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 1 Mercury 6.553709809565314146e-06 0.0014751274547839194341 1.6306381826061645943e-05 diff --git a/examples/symba_swifter_comparison/1pl_1tp_collision/sun_MsunAUYR.in b/examples/symba_swifter_comparison/1pl_1tp_collision/sun_MsunAUYR.in index b2cb85c35..5e69f346c 100644 --- a/examples/symba_swifter_comparison/1pl_1tp_collision/sun_MsunAUYR.in +++ b/examples/symba_swifter_comparison/1pl_1tp_collision/sun_MsunAUYR.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + Sun 39.476926408897626 0.004650467260962157 diff --git a/examples/symba_swifter_comparison/1pl_1tp_collision/tp.swiftest.in b/examples/symba_swifter_comparison/1pl_1tp_collision/tp.swiftest.in index 2d110f0b6..e7d899da2 100644 --- a/examples/symba_swifter_comparison/1pl_1tp_collision/tp.swiftest.in +++ b/examples/symba_swifter_comparison/1pl_1tp_collision/tp.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 1 Test_Particle 0.38710350131956905 0.20558985105084426 7.0037441475892 diff --git a/examples/symba_swifter_comparison/8pl/cb.in b/examples/symba_swifter_comparison/8pl/cb.in index e3318aec0..64008ecae 100644 --- a/examples/symba_swifter_comparison/8pl/cb.in +++ b/examples/symba_swifter_comparison/8pl/cb.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + Sun 0.00029591220819207774 0.004650467260962157 diff --git a/examples/symba_swifter_comparison/8pl/cb.swiftest.in b/examples/symba_swifter_comparison/8pl/cb.swiftest.in index e3318aec0..64008ecae 100644 --- a/examples/symba_swifter_comparison/8pl/cb.swiftest.in +++ b/examples/symba_swifter_comparison/8pl/cb.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + Sun 0.00029591220819207774 0.004650467260962157 diff --git a/examples/symba_swifter_comparison/8pl/init_cond.py b/examples/symba_swifter_comparison/8pl/init_cond.py index 23b65080f..b66768453 100755 --- a/examples/symba_swifter_comparison/8pl/init_cond.py +++ b/examples/symba_swifter_comparison/8pl/init_cond.py @@ -1,3 +1,14 @@ +""" + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + This file is part of Swiftest. + Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + You should have received a copy of the GNU General Public License along with Swiftest. + If not, see: https://www.gnu.org/licenses. +""" + #!/usr/bin/env python3 import numpy as np import swiftest diff --git a/examples/symba_swifter_comparison/8pl/param.swifter.in b/examples/symba_swifter_comparison/8pl/param.swifter.in index 177630caf..245db92a1 100644 --- a/examples/symba_swifter_comparison/8pl/param.swifter.in +++ b/examples/symba_swifter_comparison/8pl/param.swifter.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + ! VERSION Swifter parameter file converted from Swiftest T0 0.0 TSTOP 365 diff --git a/examples/symba_swifter_comparison/8pl/param.swiftest.in b/examples/symba_swifter_comparison/8pl/param.swiftest.in index 7f4d21c9b..0037eb800 100644 --- a/examples/symba_swifter_comparison/8pl/param.swiftest.in +++ b/examples/symba_swifter_comparison/8pl/param.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + ! VERSION Swiftest parameter input T0 0.0 TSTOP 365 diff --git a/examples/symba_swifter_comparison/8pl/pl.in b/examples/symba_swifter_comparison/8pl/pl.in index 574290966..29d7ae207 100644 --- a/examples/symba_swifter_comparison/8pl/pl.in +++ b/examples/symba_swifter_comparison/8pl/pl.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 8 Mercury 4.9125474498983623693e-11 0.0014751322421091943544 1.6306381826061645943e-05 diff --git a/examples/symba_swifter_comparison/8pl/pl.swifter.in b/examples/symba_swifter_comparison/8pl/pl.swifter.in index b4b8dfe4d..4fa02f2e8 100644 --- a/examples/symba_swifter_comparison/8pl/pl.swifter.in +++ b/examples/symba_swifter_comparison/8pl/pl.swifter.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 9 0 0.00029591220819207774 0.0 0.0 0.0 diff --git a/examples/symba_swifter_comparison/8pl/pl.swiftest.in b/examples/symba_swifter_comparison/8pl/pl.swiftest.in index 574290966..29d7ae207 100644 --- a/examples/symba_swifter_comparison/8pl/pl.swiftest.in +++ b/examples/symba_swifter_comparison/8pl/pl.swiftest.in @@ -1,3 +1,12 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 8 Mercury 4.9125474498983623693e-11 0.0014751322421091943544 1.6306381826061645943e-05 diff --git a/examples/symba_swifter_comparison/8pl/tp.in b/examples/symba_swifter_comparison/8pl/tp.in index 573541ac9..78a4f20a6 100644 --- a/examples/symba_swifter_comparison/8pl/tp.in +++ b/examples/symba_swifter_comparison/8pl/tp.in @@ -1 +1,10 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 0 diff --git a/examples/symba_swifter_comparison/8pl/tp.swifter.in b/examples/symba_swifter_comparison/8pl/tp.swifter.in index 573541ac9..78a4f20a6 100644 --- a/examples/symba_swifter_comparison/8pl/tp.swifter.in +++ b/examples/symba_swifter_comparison/8pl/tp.swifter.in @@ -1 +1,10 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 0 diff --git a/examples/symba_swifter_comparison/8pl/tp.swiftest.in b/examples/symba_swifter_comparison/8pl/tp.swiftest.in index 573541ac9..78a4f20a6 100644 --- a/examples/symba_swifter_comparison/8pl/tp.swiftest.in +++ b/examples/symba_swifter_comparison/8pl/tp.swiftest.in @@ -1 +1,10 @@ +!! Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh +!! This file is part of Swiftest. +!! Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License +!! as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. +!! Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +!! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +!! You should have received a copy of the GNU General Public License along with Swiftest. +!! If not, see: https://www.gnu.org/licenses. + 0 diff --git a/examples/whm_gr_test/whm_gr_test.py b/examples/whm_gr_test/whm_gr_test.py index ee66558d2..e3feb9aaf 100644 --- a/examples/whm_gr_test/whm_gr_test.py +++ b/examples/whm_gr_test/whm_gr_test.py @@ -1,5 +1,5 @@ """ - Copyright 2022 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh + Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh This file is part of Swiftest. Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/src/collision/collision_resolve.f90 b/src/collision/collision_resolve.f90 index bafbf7de8..bc6bf302f 100644 --- a/src/collision/collision_resolve.f90 +++ b/src/collision/collision_resolve.f90 @@ -33,8 +33,8 @@ module subroutine collision_resolve_consolidate_impactors(self, nbody_system, pa integer(I4B), dimension(2) :: nchild integer(I4B) :: i, j, nimpactors, idx_child real(DP), dimension(2) :: volume, density - real(DP) :: mchild, volchild - real(DP), dimension(NDIM) :: xc, vc, xcom, vcom, xchild, vchild, xcrossv + real(DP) :: mchild, volchild, b, r_dot_vunit, rrel_mag, vrel_mag, rlim, dt + real(DP), dimension(NDIM) :: xc, vc, xcom, vcom, xchild, vchild, xcrossv, rrel, vrel, vrel_unit real(DP), dimension(NDIM,2) :: mxc, vcc select type(nbody_system) @@ -141,6 +141,19 @@ module subroutine collision_resolve_consolidate_impactors(self, nbody_system, pa end do lflag = .true. + ! Shift the impactors so that they are not overlapping + + rlim = sum(impactors%radius(1:2)) + vrel = impactors%vb(:,2) - impactors%vb(:,1) + rrel = impactors%rb(:,2) - impactors%rb(:,1) + vrel_mag = .mag. vrel + rrel_mag = .mag. rrel + vrel_unit = .unit. vrel + r_dot_vunit = dot_product(rrel,vrel_unit) + b = sqrt(rrel_mag**2 - r_dot_vunit**2) + dt = (sqrt(rlim**2 - b**2) + r_dot_vunit)/vrel_mag + impactors%rb(:,1:2) = impactors%rb(:,1:2) - dt * impactors%vb(:,1:2) + xcom(:) = (impactors%mass(1) * impactors%rb(:, 1) + impactors%mass(2) * impactors%rb(:, 2)) / sum(impactors%mass(:)) vcom(:) = (impactors%mass(1) * impactors%vb(:, 1) + impactors%mass(2) * impactors%vb(:, 2)) / sum(impactors%mass(:)) mxc(:, 1) = impactors%mass(1) * (impactors%rb(:, 1) - xcom(:))