From eb7bf33ffacb075e2097ea2279d839566383d05c Mon Sep 17 00:00:00 2001 From: Carlisle Wishard Date: Fri, 2 Dec 2022 11:08:45 -0500 Subject: [PATCH 1/2] updated output_reader.py to reflect new IO syntax --- examples/Basic_Simulation/output_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/Basic_Simulation/output_reader.py b/examples/Basic_Simulation/output_reader.py index 539038291..b171eb402 100644 --- a/examples/Basic_Simulation/output_reader.py +++ b/examples/Basic_Simulation/output_reader.py @@ -29,7 +29,7 @@ import matplotlib.pyplot as plt # Read in the simulation output and store it as an Xarray dataset -ds = swiftest.Simulation(param_file="param.in").ds +ds = swiftest.Simulation(param_file="simdata/param.in", read_old_output_file=True).data # Plot of the data and save the output plot colors = ['white' if x == 'Massive Body' else 'black' for x in ds['particle_type']] From 3742cc8c730e8429166c257f6458c82f57337b42 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 2 Dec 2022 11:06:12 -0500 Subject: [PATCH 2/2] Fixed problem where encounter checks were using heliocentric instead of barycentric velocities --- src/symba/symba_encounter_check.f90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/symba/symba_encounter_check.f90 b/src/symba/symba_encounter_check.f90 index 035d7fd3c..48672142e 100644 --- a/src/symba/symba_encounter_check.f90 +++ b/src/symba/symba_encounter_check.f90 @@ -43,10 +43,10 @@ module function symba_encounter_check_pl(self, param, system, dt, irec) result(l call pl%set_renc(irec) if (nplt == 0) then - call encounter_check_all_plpl(param, npl, pl%xh, pl%vh, pl%renc, dt, nenc, index1, index2, lvdotr) + call encounter_check_all_plpl(param, npl, pl%xh, pl%vb, pl%renc, dt, nenc, index1, index2, lvdotr) else - call encounter_check_all_plplm(param, nplm, nplt, pl%xh(:,1:nplm), pl%vh(:,1:nplm), pl%xh(:,nplm+1:npl), & - pl%vh(:,nplm+1:npl), pl%renc(1:nplm), pl%renc(nplm+1:npl), dt, nenc, index1, index2, lvdotr) + call encounter_check_all_plplm(param, nplm, nplt, pl%xh(:,1:nplm), pl%vb(:,1:nplm), pl%xh(:,nplm+1:npl), & + pl%vb(:,nplm+1:npl), pl%renc(1:nplm), pl%renc(nplm+1:npl), dt, nenc, index1, index2, lvdotr) end if lany_encounter = nenc > 0_I8B @@ -136,7 +136,7 @@ module function symba_encounter_check(self, param, system, dt, irec) result(lany i = self%index1(k) j = self%index2(k) xr(:) = pl%xh(:,j) - pl%xh(:,i) - vr(:) = pl%vh(:,j) - pl%vh(:,i) + vr(:) = pl%vb(:,j) - pl%vb(:,i) rcrit12 = pl%renc(i) + pl%renc(j) call encounter_check_one(xr(1), xr(2), xr(3), vr(1), vr(2), vr(3), rcrit12, dt, lencounter(lidx), self%lvdotr(k)) if (lencounter(lidx)) then @@ -151,7 +151,7 @@ module function symba_encounter_check(self, param, system, dt, irec) result(lany i = self%index1(k) j = self%index2(k) xr(:) = tp%xh(:,j) - pl%xh(:,i) - vr(:) = tp%vh(:,j) - pl%vh(:,i) + vr(:) = tp%vb(:,j) - pl%vb(:,i) call encounter_check_one(xr(1), xr(2), xr(3), vr(1), vr(2), vr(3), pl%renc(i), dt, & lencounter(lidx), self%lvdotr(k)) if (lencounter(lidx)) then @@ -213,7 +213,7 @@ module function symba_encounter_check_tp(self, param, system, dt, irec) result(l associate(tp => self, ntp => self%nbody, pl => system%pl, npl => system%pl%nbody) call pl%set_renc(irec) - call encounter_check_all_pltp(param, npl, ntp, pl%xh, pl%vh, tp%xh, tp%vh, pl%renc, dt, nenc, index1, index2, lvdotr) + call encounter_check_all_pltp(param, npl, ntp, pl%xh, pl%vb, tp%xh, tp%vb, pl%renc, dt, nenc, index1, index2, lvdotr) lany_encounter = nenc > 0 if (lany_encounter) then