diff --git a/examples/Fragmentation/Fragmentation_Movie.py b/examples/Fragmentation/Fragmentation_Movie.py index b909fac0c..a4a925772 100644 --- a/examples/Fragmentation/Fragmentation_Movie.py +++ b/examples/Fragmentation/Fragmentation_Movie.py @@ -180,6 +180,6 @@ def data_stream(self, frame=0): minimum_fragment_gmass = 0.2 * body_Gmass[style][1] # Make the minimum fragment mass a fraction of the smallest body gmtiny = 0.99 * body_Gmass[style][1] # Make GMTINY just smaller than the smallest original body. This will prevent runaway collisional cascades sim.set_parameter(fragmentation = True, gmtiny=gmtiny, minimum_fragment_gmass=minimum_fragment_gmass, verbose=False) - sim.run(dt=1e-4, tstop=1.0e-2, tstep_out=1e-2, dump_cadence=0) + sim.run(dt=1e-3, tstop=1.0e-2, tstep_out=1e-2, dump_cadence=0) - anim = AnimatedScatter(sim,movie_filename,movie_titles[style],nskip=1) + anim = AnimatedScatter(sim,movie_filename,movie_titles[style],nskip=10) diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index 6cd75a521..727e47d07 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -306,7 +306,7 @@ def __init__(self,read_param: bool = False, read_old_output_file: bool = False, self.param = {} self.data = xr.Dataset() self.ic = xr.Dataset() - + self.enc = xr.Dataset() self.simdir = Path(simdir) if self.simdir.exists(): @@ -2670,17 +2670,28 @@ def read_output_file(self,read_init_cond : bool = True): # Make a temporary copy of the parameter dictionary so we can supply the absolute path of the binary file # This is done to handle cases where the method is called from a different working directory than the simulation # results + + # EXPERIMENTAL + read_encounter = True param_tmp = self.param.copy() param_tmp['BIN_OUT'] = os.path.join(self.simdir, self.param['BIN_OUT']) if self.codename == "Swiftest": self.data = io.swiftest2xr(param_tmp, verbose=self.verbose) if self.verbose: print('Swiftest simulation data stored as xarray DataSet .data') if read_init_cond: + if self.verbose: + print("Reading initial conditions file as .ic") if "NETCDF" in self.param['IN_TYPE']: - param_tmp['BIN_OUT'] = os.path.join(self.simdir, self.param['NC_IN']) + param_tmp['BIN_OUT'] = self.simdir / self.param['NC_IN'] + self.ic = io.swiftest2xr(param_tmp, verbose=self.verbose) else: self.ic = self.data.isel(time=0) + if read_encounter: + param_tmp['BIN_OUT'] = self.simdir / "encounter.nc" + if self.verbose: + print("Reading encounter history file as .enc") + self.enc = io.swiftest2xr(param_tmp, verbose=self.verbose) elif self.codename == "Swifter": self.data = io.swifter2xr(param_tmp, verbose=self.verbose)