-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from becnealon/master
Splitting/merging
- Loading branch information
Showing
12 changed files
with
540 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
!--------------------------------------------------------------------------! | ||
! The Phantom Smoothed Particle Hydrodynamics code, by Daniel Price et al. ! | ||
! Copyright (c) 2007-2020 The Authors (see AUTHORS) ! | ||
! See LICENCE file for usage and distribution conditions ! | ||
! http://phantomsph.bitbucket.io/ ! | ||
!--------------------------------------------------------------------------! | ||
!+ | ||
! MODULE: moddump | ||
! | ||
! DESCRIPTION: | ||
! merges particles; input simulation with npart, get npart/nchild back | ||
! | ||
! REFERENCES: Vacondio et al. 2013 | ||
! | ||
! OWNER: Rebecca Nealon | ||
! | ||
! $Id$ | ||
! | ||
! RUNTIME PARAMETERS: None | ||
! | ||
! DEPENDENCIES: io, splitpart | ||
!+ | ||
!-------------------------------------------------------------------------- | ||
module moddump | ||
implicit none | ||
integer, parameter :: nchild = 2 | ||
|
||
contains | ||
|
||
subroutine modify_dump(npart,npartoftype,massoftype,xyzh,vxyzu) | ||
use splitpart, only:merge_all_particles | ||
use part, only:igas,kill_particle,delete_dead_or_accreted_particles | ||
use part, only:isdead_or_accreted,copy_particle | ||
use io, only:fatal,error | ||
integer, intent(inout) :: npart | ||
integer, intent(inout) :: npartoftype(:) | ||
real, intent(inout) :: massoftype(:) | ||
real, intent(inout) :: xyzh(:,:),vxyzu(:,:) | ||
integer :: i,nactive | ||
|
||
!-- how many active particles | ||
nactive = 0 | ||
do i = 1,npart | ||
if (.not.isdead_or_accreted(xyzh(4,i))) then | ||
nactive = nactive + 1 | ||
else | ||
call kill_particle(i,npartoftype) | ||
endif | ||
enddo | ||
|
||
if (nactive < npart) then | ||
call delete_dead_or_accreted_particles(npart,npartoftype) | ||
print*,' discarding inactive particles' | ||
endif | ||
|
||
! Merge 'em! | ||
call merge_all_particles(npart,npartoftype,massoftype,xyzh,vxyzu, & | ||
nchild,nactive) | ||
|
||
print*,' new npart = ',npart | ||
|
||
end subroutine modify_dump | ||
|
||
end module moddump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.