mg_ix_to_ichild Function

public function mg_ix_to_ichild(ix)

Compute the child index for a box with spatial index ix. With child index we mean the index in the children(:) array of its parent.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ix(1)

Spatial index of the box

Return Value integer


Called by

proc~~mg_ix_to_ichild~2~~CalledByGraph proc~mg_ix_to_ichild~2 mg_ix_to_ichild proc~find_neighb~2 find_neighb proc~find_neighb~2->proc~mg_ix_to_ichild~2 proc~restrict_set_buffer~2 restrict_set_buffer proc~restrict_set_buffer~2->proc~mg_ix_to_ichild~2 proc~mg_restrict_lvl~2 mg_restrict_lvl proc~mg_restrict_lvl~2->proc~restrict_set_buffer~2 proc~set_neighbs~2 set_neighbs proc~set_neighbs~2->proc~find_neighb~2 proc~mg_restrict~2 mg_restrict proc~mg_restrict~2->proc~mg_restrict_lvl~2 proc~mg_set_neighbors_lvl~2 mg_set_neighbors_lvl proc~mg_set_neighbors_lvl~2->proc~set_neighbs~2 proc~update_coarse~2 update_coarse proc~update_coarse~2->proc~mg_restrict_lvl~2 proc~mg_build_rectangle~2 mg_build_rectangle proc~mg_build_rectangle~2->proc~mg_set_neighbors_lvl~2 proc~mg_fas_fmg~2 mg_fas_fmg proc~mg_fas_fmg~2->proc~update_coarse~2 proc~mg_fas_vcycle~2 mg_fas_vcycle proc~mg_fas_fmg~2->proc~mg_fas_vcycle~2 proc~mg_fas_vcycle~2->proc~update_coarse~2 proc~diffusion_solve_acoeff~2 diffusion_solve_acoeff proc~diffusion_solve_acoeff~2->proc~mg_fas_fmg~2 proc~diffusion_solve_acoeff~2->proc~mg_fas_vcycle~2 proc~diffusion_solve_vcoeff~2 diffusion_solve_vcoeff proc~diffusion_solve_vcoeff~2->proc~mg_fas_fmg~2 proc~diffusion_solve_vcoeff~2->proc~mg_fas_vcycle~2 proc~diffusion_solve~2 diffusion_solve proc~diffusion_solve~2->proc~mg_fas_fmg~2 proc~diffusion_solve~2->proc~mg_fas_vcycle~2

Source Code

  integer function mg_ix_to_ichild(ix)
    integer, intent(in) :: ix(1)
    !< Spatial index of the box
    ! The index can range from 1 (all ix odd) and 2**$D (all ix even)
    mg_ix_to_ichild = 2 - iand(ix(1), 1)
  end function mg_ix_to_ichild