scalar_schw_implementation Submodule

The implementation of the interfaces defined in scalar_schw.


Uses

  • module~~scalar_schw_implementation~~UsesGraph module~scalar_schw_implementation scalar_schw_implementation module~scalar_schw scalar_schw module~scalar_schw_implementation->module~scalar_schw module~scalar_schw_eff scalar_schw_eff module~scalar_schw->module~scalar_schw_eff module~orbit_base orbit_base module~scalar_schw->module~orbit_base module~kinds kinds module~scalar_schw->module~kinds module~time_dependent_coordinate time_dependent_coordinate module~scalar_schw->module~time_dependent_coordinate module~grid_function grid_function module~scalar_schw->module~grid_function module~dg_structures DG_structures module~scalar_schw->module~dg_structures module~pde_equations pde_equations module~scalar_schw->module~pde_equations iso_c_binding iso_c_binding module~scalar_schw->iso_c_binding module~scalar_schw_eff->module~kinds module~scalar_schw_eff->iso_c_binding module~effective_source effective_source module~scalar_schw_eff->module~effective_source module~orbit_base->module~kinds module~time_dependent_coordinate->module~kinds module~time_dependent_coordinate->module~grid_function module~grid_function->module~kinds module~element element module~grid_function->module~element module~dg_structures->module~kinds module~pde_equations->module~kinds module~pde_equations->module~grid_function module~equations equations module~pde_equations->module~equations module~element->module~kinds module~equations->module~kinds module~effective_source->module~kinds module~effective_source->module~grid_function module~effective_source->iso_c_binding module~world_tube world_tube module~effective_source->module~world_tube module~world_tube->module~kinds module~world_tube->module~grid_function

Contents


Functions

function count_digits(l)

Utility routine to count the number of digits in an integer. Used to construct filenames.

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: l

The integer to count the number of digits in.

Return Value integer(kind=ip)

function construct_filename(l, m)

Construct unique filenames using a base name and the mode numbers l and m for reading in external inital data. The base name is constructed based on the run time parameters input_directory and input_basename.

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: l

The -mode of this mode.

integer(kind=ip), intent(in) :: m

The -mode of this mode.

Return Value character(len=1024)

The return value is the concatenation of the input_directory and input_basename and the mode information.

function flux(u, C11, C02)

Calculate a flux from the derivative data and the equation coefficient.

Arguments

Type IntentOptional AttributesName
complex(kind=wp), intent(in), dimension(2):: u

The input state vector .

real(kind=wp), intent(in) :: C11

The coefficient of the second radial derivative term, .

real(kind=wp), intent(in) :: C02

The coefficient of the mixed second derivative term, .

Return Value complex(kind=wp), dimension(2)

On return the flux.

function n_of_l(l)

Calculate the number of m-modes for a given value of l. For the scalar charge in orbit around a Schwarzschild black hole we only need to evolve modes with even due to symmetries.

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: l

The -value.

Return Value integer(kind=ip)

The return value is the number of -modes that is evolved for this .

function nmodes_of_l(lmin, lmax)

Calculate the total number of modes from lmin to lmax.

Read more…

Arguments

Type IntentOptional AttributesName
integer(kind=ip), intent(in) :: lmin

The minimum value of to include in the sum, .

integer(kind=ip), intent(in) :: lmax

The maximum value of to include in the sum. .

Return Value integer(kind=ip)

The return value is to total number of -modes from all modes from to .

function linear_extrapolate(x, y)

Utility function for linear extrapolation of data to the horizon and Scri+.

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in), dimension(3):: x

A 1d array of size (3) of reals that contains the 3 coordinate locations involved in the extrapolation. The first element is the coordinate where the extrapolation is needed, that last two elements are the locations where data is known.

complex(kind=wp), intent(in), dimension(2:3):: y

A 1d array of size(2) that contains the known data.

Return Value complex(kind=wp)

The return value is the extrapolated data at the required location.


Subroutines

subroutine set_lm_mode_info(this, lmin, lmax)

Loop over all mode and store it's corresponding and m-values. This should maybe made into a type bound procedure.

Read more…

Arguments

Type IntentOptional AttributesName
type(scal_schw), intent(inout) :: this

The mode information will be set for this scal_schw object.

integer(kind=ip), intent(in) :: lmin

The mininum -value.

integer(kind=ip), intent(in) :: lmax

The mininum -value.

subroutine get_elem_flux(rho, pi, nmodes, mode, r, effs, time_dc, e_lambda, e_s, e_sinv, e_coeffs, r_elem, rho_flux, pi_flux)

Calculate the characteristic fluxes for all elements for a single mode.

Read more…

Arguments

Type IntentOptional AttributesName
type(cgf), intent(in) :: rho

A complex grid function containing the time derivative variable, .

type(cgf), intent(in) :: pi

A complex grid function containing the radial derivative variable, .

integer(kind=ip), intent(in) :: nmodes

The total number of modes.

integer(kind=ip), intent(in) :: mode

The mode for which the flux is calculated.

type(rgf), intent(in) :: r

A real grid function that contains the Scharzschild radial coordinate.

type(scal_schw_eff), intent(inout) :: effs

The effective source object. Needed to add and subtract the derivatives of the singular field when calculating fluxes at the world-tube boundary.

type(tdc) :: time_dc

The time dependent coordinate object. Needed to transform the derivatives of the field when calculating fluxes at the boundary of the time dependent coordinate region.

type(rgfb), intent(in), dimension(:):: e_lambda

A 1d array of size (2) of real boundary grid functions that contains the characteristic speeds at the element boundary.

type(rgfb), intent(in), dimension(:,:):: e_s

A 2d array of size (2,2) of real boundary grid functions that contains the matrix used to convert from characteristic to evolved variables.

type(rgfb), intent(in), dimension(:,:):: e_sinv

A 2d array of size (2,2) of real boundary grid functions that contains the matrix used to convert from evolved to characteristic variables.

type(rgf), intent(in), dimension(:):: e_coeffs

A 1d array of real grid functions that contains the coefficients for the wave equation.

type(ref_element), intent(in) :: r_elem

The reference element.

type(cgf), intent(inout) :: rho_flux

On output contains the component of the characteristic flux.

type(cgf), intent(inout) :: pi_flux

On output contains the component of the characteristic flux.


Module Procedures

module procedure scal_schw_init module subroutine scal_schw_init(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout), target:: this

The equation that is being initialized.

module procedure scal_schw_rhs module subroutine scal_schw_rhs(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The equation for which the RHS is calculated.

module procedure scal_schw_save_globals_1 module subroutine scal_schw_save_globals_1(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The routine is called on this equation.

module procedure scal_schw_save_globals_2 module subroutine scal_schw_save_globals_2(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The routine is called on this equation.

module procedure scal_schw_load_globals module subroutine scal_schw_load_globals(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The routine is called on this equation.

module procedure scal_schw_flux module subroutine scal_schw_flux(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The routine is called on this equation.

module procedure read_all_modes module subroutine read_all_modes(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The routine is called on this equation.

module procedure output_coords module subroutine output_coords(this)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The routine is called on this equation.

module procedure tortoise_to_hyperboloidal module subroutine tortoise_to_hyperboloidal(this, elem, node, inner, dpsidt, dpsidr)

Arguments

Type IntentOptional AttributesName
class(scal_schw), intent(inout) :: this

The routine is called on this equation.

integer(kind=ip), intent(in) :: elem

The index of the element where the transformation is calculated.

integer(kind=ip), intent(in) :: node

The index of the node within that element where the transformation is calculated.

logical, intent(in) :: inner

If .true. use the transformation for the inner region. If .false. use the transformation for the outer region.

complex(kind=wp), intent(inout) :: dpsidt

On input holds the time derivative in Tortoise coordinates. On output holds the time derivative in hyperboloidal coordinates.

complex(kind=wp), intent(inout) :: dpsidr

On input holds the radial derivative in Tortoise coordinates. On output holds the radial derivative in hyperboloidal coordinates.

module procedure convert_var_name module function convert_var_name(var_name, mode)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: var_name

The input variable name.

integer(kind=ip), intent(in) :: mode

the mode number.

Return Value character(len=len(var_name)+5)

The return value is the converted variable name.