get_force Subroutine

public subroutine get_force(this, force)

Uses

  • proc~~get_force~~UsesGraph proc~get_force get_force module~time_info time_info proc~get_force->module~time_info module~numerics numerics proc~get_force->module~numerics module~orbit_base orbit_base proc~get_force->module~orbit_base module~parameters parameters proc~get_force->module~parameters module~kinds kinds module~time_info->module~kinds module~numerics->module~kinds module~orbit_base->module~kinds module~parameters->module~kinds

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.

Arguments

Type IntentOptional AttributesName
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, .


Calls

proc~~get_force~~CallsGraph proc~get_force get_force proc~time_window time_window proc~get_force->proc~time_window proc~get_current_time get_current_time proc~get_force->proc~get_current_time

Contents

Source Code


Source Code

  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