From ba9f0883f10f96f2d9b73e2f112b18e1369d6c29 Mon Sep 17 00:00:00 2001 From: MintoDA1 <51412913+MintoDA1@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:02:34 -0500 Subject: [PATCH] Decrased the number of fragments made in the example movie script to make it run faster, and rearranged script to make the variable that controls fragment number more obvious. --- examples/Fragmentation/Fragmentation_Movie.py | 50 +++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/examples/Fragmentation/Fragmentation_Movie.py b/examples/Fragmentation/Fragmentation_Movie.py index 4905e05f6..c58ad53c9 100755 --- a/examples/Fragmentation/Fragmentation_Movie.py +++ b/examples/Fragmentation/Fragmentation_Movie.py @@ -14,22 +14,24 @@ Generates and runs a set of Swiftest input files from initial conditions with the SyMBA integrator. All simulation outputs are stored in the subdirectory named after their collisional regime. +**NOTE: You must have ffmpeg installed on your system before running this script. For instance, on MacOS: + +```brew install ffmpeg``` + +on Ubuntu: + +```sudo apt-get install ffmpeg``` + + Inputs _______ -None. +User selects which collisional movie to generate Output ------ -collisions.log : An ASCII file containing the information of any collisional events that occured. -collisions.nc : A NetCDF file containing the collision output. -data.nc : A NetCDF file containing the simulation output. -encounters.nc : A NetCDF file containing the encounter output. -init_cond.nc : A NetCDF file containing the initial conditions for the simulation. -param.00...0.in : A series of parameter input files containing the parameters for the simulation at every output stage. -param.in : An ASCII file containing the inital parameters for the simulation. -param.restart.in : An ASCII file containing the parameters for the simulation at the last output. -swiftest.log : An ASCII file containing the information on the status of the simulation as it runs. -collision.mp4 : A movie file named after the collisional regime depicting the collision. + +Files are stored in directories for each collision type name requested +[COLLISION_TYPE].mp4 : A movie file named after the collisional regime depicting the collision. """ @@ -48,6 +50,22 @@ movie_titles = dict(zip(available_movie_styles, movie_title_list)) num_movie_frames = 1000 + +# ---------------------------------------------------------------------------------------------------------------------- +# To increase the number of bodies generated in each collision type, decrease the value of the corresponding nfrag_reduction number +# ---------------------------------------------------------------------------------------------------------------------- +nfrag_reduction = {"disruption_headon" : 10.0, + "disruption_off_axis" : 10.0, + "supercatastrophic_headon" : 10.0, + "supercatastrophic_off_axis" : 10.0, + "hitandrun_disrupt" : 10.0, + "hitandrun_pure" : 1.0, + "merge" : 1.0, + "merge_spinner" : 1.0, + } + + + # These initial conditions were generated by trial and error names = ["Target","Projectile"] pos_vectors = {"disruption_headon" : [np.array([1.0, -5.0e-05, 0.0]), @@ -124,16 +142,6 @@ "merge_spinner" : 5.0e-3, } -nfrag_reduction = {"disruption_headon" : 1.0, - "disruption_off_axis" : 1.0, - "supercatastrophic_headon" : 1.0, - "supercatastrophic_off_axis" : 10.0, - "hitandrun_disrupt" : 1.0, - "hitandrun_pure" : 1.0, - "merge" : 1.0, - "merge_spinner" : 1.0, - } - density = 3000 * swiftest.AU2M**3 / swiftest.MSun GU = swiftest.GMSun * swiftest.YR2S**2 / swiftest.AU2M**3 body_radius = body_Gmass.copy()