Routine that gets the self-force variable.
This also take into account run time parameters that specifies when the back-reaction should be turned on and will return zero if it is not yet time to do so.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(self_force), | intent(inout) | :: | this | The routine is called on this self_force object. |
||
real(kind=wp), | intent(out), | dimension(4) | :: | force | On return this 1d array contains the 4 components of the force, . |
subroutine get_force ( this, force )
!! Routine that gets the self-force variable.
!!
!! This also take into account run time parameters that specifies when
!! the back-reaction should be turned on and will return zero if it is
!! not yet time to do so.
use time_info, only : get_current_time
use orbit_base, only : orbit_info
use parameters, only : evolve_orbit, turn_on_force_smoothly, use_chi, &
evolve_after, force_sigma, torder
use numerics, only : time_window
implicit none
class(self_force), intent(inout) :: this
!! The routine is called on this [[self_force]] object.
real(wp), dimension(4), intent(out) :: force
!! On return this 1d array contains the 4 components of the force,
!! \((f_t,f_r,f_{\theta},f_{\phi})\).
real(wp) :: time, chi, f_fac, df_fac_dt, d2f_fac_dt2
f_fac = 0.0_wp
if ( evolve_orbit ) then
if ( use_chi .and. turn_on_force_smoothly ) then
call orbit_info%get_chi ( chi )
if ( chi >= evolve_after ) then
call time_window ( chi-evolve_after, force_sigma, torder, &
f_fac, df_fac_dt, d2f_fac_dt2 )
end if
else if ( use_chi ) then
f_fac = 1.0_wp
end if
if ( ( .not. use_chi ) .and. turn_on_force_smoothly ) then
time = get_current_time ( )
if ( time >= evolve_after ) then
call time_window ( time-evolve_after, force_sigma, torder, &
f_fac, df_fac_dt, d2f_fac_dt2 )
end if
else if ( .not. use_chi ) then
f_fac = 1.0_wp
end if
force = f_fac*this%f
else
force = 0.0_wp
end if
end subroutine get_force