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

Commit

Permalink
Browse files Browse the repository at this point in the history
Lots of updates to the fragmentation model. Fragments are not initialized in two groups. The first two along the pre-impact distance vector, and the second in a ring orthogonal to that.
  • Loading branch information
daminton committed May 7, 2021
1 parent 27248be commit 4aafa35
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 151 deletions.
54 changes: 28 additions & 26 deletions examples/symba_energy_momentum/collision_movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,8 @@
ymin = -20.0
ymax = 20.0

case = 'supercat_head'

if case == 'supercat_off':
animfile = 'movies/supercat_off_axis.mp4'
titletext = "Supercatastrophic - Off Axis"
configfile = 'param.supercatastrophic_off_axis.in'
elif case == 'supercat_head':
animfile = 'movies/supercat_headon.mp4'
titletext = "Supercatastrophic - Head on"
configfile = 'param.supercatastrophic_headon.in'
elif case == 'disruption_off':
animfile = 'movies/disruption_off_axis.mp4'
titletext = "Disruption - Off Axis"
configfile = 'param.disruption_off_axis.in'
elif case == 'disruption_head':
animfile = 'movies/disruption_headon.mp4'
titletext = "Disruption- Head on"
configfile = 'param.disruption_headon.in'
else:
print(f'{case} is an unknown case')
exit(-1)
cases = ['supercat_head', 'supercat_off', 'disruption_head', 'disruption_off']
#cases = ['disruption_head']

def scale_sim(ds, config):

Expand Down Expand Up @@ -245,8 +226,29 @@ def data_stream(self, frame=0):
frame += 1
yield t, name, mass, radius, npl, np.c_[x, y, vx, vy], radmarker, origin

config = swio.read_swiftest_config(configfile)
ds = swio.swiftest2xr(config)
print('Making animation')
anim = AnimatedScatter(ds,config)
print('Animation finished')
for case in cases:
if case == 'supercat_off':
animfile = 'movies/supercat_off_axis.mp4'
titletext = "Supercatastrophic - Off Axis"
configfile = 'param.supercatastrophic_off_axis.in'
elif case == 'supercat_head':
animfile = 'movies/supercat_headon.mp4'
titletext = "Supercatastrophic - Head on"
configfile = 'param.supercatastrophic_headon.in'
elif case == 'disruption_off':
animfile = 'movies/disruption_off_axis.mp4'
titletext = "Disruption - Off Axis"
configfile = 'param.disruption_off_axis.in'
elif case == 'disruption_head':
animfile = 'movies/disruption_headon.mp4'
titletext = "Disruption- Head on"
configfile = 'param.disruption_headon.in'
else:
print(f'{case} is an unknown case')
exit(-1)
config = swio.read_swiftest_config(configfile)
ds = swio.swiftest2xr(config)
print('Making animation')
anim = AnimatedScatter(ds,config)
print('Animation finished')
plt.close(fig='all')
2 changes: 1 addition & 1 deletion examples/symba_energy_momentum/disruption_off_axis.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
3 7e-10 0.0004
3.25e-06
1.0 4.20E-05 0.0
0.80 -6.28 0.0
-0.80 -6.28 0.0
0.4 0.4 0.4 !Ip
0.0 0.0 0.0 !rot
2 changes: 1 addition & 1 deletion src/symba/symba_casedisruption.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function symba_casedisruption (symba_plA, family, nmergeadd, mergeadd_list, x, v
logical :: lmerge

! Collisional fragments will be uniformly distributed around the pre-impact barycenter
nfrag = 10 ! This value is set for testing. This needs to be updated such that it is calculated or set by the user
nfrag = 12 ! This value is set for testing. This needs to be updated such that it is calculated or set by the user
allocate(m_frag(nfrag))
allocate(rad_frag(nfrag))
allocate(xb_frag(NDIM, nfrag))
Expand Down
2 changes: 1 addition & 1 deletion src/symba/symba_casehitandrun.f90
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function symba_casehitandrun(symba_plA, family, nmergeadd, mergeadd_list, id, x,
nfrag = 0
lpure = .true.
else ! Imperfect hit and run, so we'll keep the largest body and destroy the other
nfrag = 10
nfrag = 12
lpure = .false.
allocate(m_frag(nfrag))
allocate(id_frag(nfrag))
Expand Down
2 changes: 1 addition & 1 deletion src/symba/symba_casesupercatastrophic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function symba_casesupercatastrophic (symba_plA, family, nmergeadd, mergeadd_lis
logical :: lmerge

! Collisional fragments will be uniformly distributed around the pre-impact barycenter
nfrag = 10 ! This value is set for testing. This needs to be updated such that it is calculated or set by the user
nfrag = 12 ! This value is set for testing. This needs to be updated such that it is calculated or set by the user
allocate(m_frag(nfrag))
allocate(rad_frag(nfrag))
allocate(xb_frag(NDIM, nfrag))
Expand Down
Loading

0 comments on commit 4aafa35

Please sign in to comment.