Skip to content

Commit

Permalink
Adding -expand_z option
Browse files Browse the repository at this point in the history
  • Loading branch information
cpinte committed Aug 6, 2024
1 parent 34ad801 commit 6b12bb5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
8 changes: 8 additions & 0 deletions src/init_mcfost.f90
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ subroutine set_default_variables()
lrandomize_gap = .false.
lrandomize_outside_gap = .false.
lcentre_on_sink = .false.
lexpand_z = .false.
lwrite_column_density = .false.
lwrite_mol_column_density = .false.
lwrite_velocity = .false.
Expand Down Expand Up @@ -1385,6 +1386,12 @@ subroutine initialisation_mcfost()
call get_command_argument(i_arg,s)
read(s,*) gap_factor
i_arg = i_arg + 1
case("-expand_z","-expand-z","-ez")
i_arg = i_arg + 1
lexpand_z = .true.
call get_command_argument(i_arg,s)
read(s,*) expand_z_factor
i_arg = i_arg + 1
case("-cd","-column_density")
i_arg = i_arg + 1
lwrite_column_density = .true.
Expand Down Expand Up @@ -2047,6 +2054,7 @@ subroutine display_help()
write(*,*) " : -no_vz : force the vertical velocities to be 0"
write(*,*) " : -vphi_Kep : force the azimuthal velocities to be Keplerian"
write(*,*) " : -centre_on_sink <number> : centre the model on the sink particle"
write(*,*) " : -expand_z <factor> : multipky all z values by factor"
write(*,*) " : -SPH_amin <size> [mum] : force the grain size that follow the gas"
write(*,*) " : -SPH_amax <size> [mum] : force the grain size that follow the dust"
write(*,*) " (only works with 1 grain size dump)"
Expand Down
2 changes: 1 addition & 1 deletion src/mcfost_env.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module mcfost_env
implicit none

real, parameter :: mcfost_version = 4.1
character(8), parameter :: mcfost_release = "4.1.05"
character(8), parameter :: mcfost_release = "4.1.06"
real, parameter :: required_utils_version = 4.0

!character(len=128) :: web_server = "https://ipag.osug.fr/public/pintec/"
Expand Down
21 changes: 20 additions & 1 deletion src/mess_up_SPH.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module mess_up_SPH
implicit none

! mask is set to 1 for hide particle == opacity set to 0, and set to 2 to delete particle before tesselation
public :: mask_Hill_sphere, randomize_azimuth, randomize_gap, mask_inside_rsph, mask_outside_rsph, mask_above_theta
public :: mask_Hill_sphere, randomize_azimuth, randomize_gap, mask_inside_rsph, mask_outside_rsph, mask_above_theta, expand_z

private

Expand Down Expand Up @@ -242,6 +242,25 @@ end subroutine randomize_azimuth

!*********************************************************

subroutine expand_z(np, xyzh, vxyzu, factor)

integer, intent(in) :: np
real(kind=dp), dimension(:,:), intent(inout) :: xyzh, vxyzu
real(kind=dp) :: factor

integer :: i

do i=1, np
xyzh(3,i) = xyzh(3,i) * factor
vxyzu(3,i) = vxyzu(3,i) * factor
enddo

return

end subroutine expand_z

!*********************************************************

subroutine randomize_gap(np, nptmass, xyzh, vxyzu, xyzmh_ptmass ,udist, factor, inside)
! Randomly rotate all the particles inside or outside cylinder
! a width +/- factor * r_Hill of the planet
Expand Down
4 changes: 2 additions & 2 deletions src/parameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ module parametres
! Phantom
logical :: ldudt_implicit, lscale_length_units, lscale_mass_units, lignore_dust
logical :: ldelete_Hill_sphere, lrandomize_Voronoi, lrandomize_azimuth, lrandomize_gap, lrandomize_outside_gap, lcentre_on_sink
logical :: ldelete_inside_rsph, ldelete_outside_rsph, ldelete_above_theta
logical :: ldelete_inside_rsph, ldelete_outside_rsph, ldelete_above_theta, lexpand_z
real(kind=dp) :: ufac_implicit,scale_length_units_factor,scale_mass_units_factor,correct_density_factor_elongated_cells
real(kind=dp) :: SPH_amin, SPH_amax, fluffyness, gap_factor, rsph_min, rsph_max
real(kind=dp) :: SPH_amin, SPH_amax, fluffyness, gap_factor, rsph_min, rsph_max, expand_z_factor
logical :: lupdate_velocities, lno_vr, lno_vz, lvphi_Kep, lfluffy, lnot_random_Voronoi, lignore_sink
integer :: isink_centre

Expand Down
2 changes: 2 additions & 0 deletions src/read_phantom.f90
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ subroutine modify_dump(np, nptmass, xyzh, vxyzu, xyzmh_ptmass, ulength, mask)
enddo
endif

if (lexpand_z) call expand_z(np, xyzh, vxyzu, expand_z_factor)

return

end subroutine modify_dump
Expand Down

0 comments on commit 6b12bb5

Please sign in to comment.