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(3)

Spatial index of the box

Return Value integer


Called by

proc~~mg_ix_to_ichild~3~~CalledByGraph proc~mg_ix_to_ichild~3 mg_ix_to_ichild proc~find_neighb~3 find_neighb proc~find_neighb~3->proc~mg_ix_to_ichild~3 proc~restrict_set_buffer~3 restrict_set_buffer proc~restrict_set_buffer~3->proc~mg_ix_to_ichild~3 proc~mg_restrict_lvl~3 mg_restrict_lvl proc~mg_restrict_lvl~3->proc~restrict_set_buffer~3 proc~set_neighbs~3 set_neighbs proc~set_neighbs~3->proc~find_neighb~3 proc~mg_restrict~3 mg_restrict proc~mg_restrict~3->proc~mg_restrict_lvl~3 proc~mg_set_neighbors_lvl~3 mg_set_neighbors_lvl proc~mg_set_neighbors_lvl~3->proc~set_neighbs~3 proc~update_coarse~3 update_coarse proc~update_coarse~3->proc~mg_restrict_lvl~3 proc~mg_build_rectangle~3 mg_build_rectangle proc~mg_build_rectangle~3->proc~mg_set_neighbors_lvl~3 proc~mg_copy_to_tree mg_copy_to_tree proc~mg_copy_to_tree->proc~mg_restrict~3 proc~mg_fas_fmg~3 mg_fas_fmg proc~mg_fas_fmg~3->proc~update_coarse~3 proc~mg_fas_vcycle~3 mg_fas_vcycle proc~mg_fas_fmg~3->proc~mg_fas_vcycle~3 proc~mg_fas_vcycle~3->proc~update_coarse~3 proc~mg_tree_from_amrvac mg_tree_from_amrvac proc~mg_tree_from_amrvac->proc~mg_set_neighbors_lvl~3 proc~mg_tree_from_amrvac->proc~mg_build_rectangle~3 proc~diffusion_solve_acoeff~3 diffusion_solve_acoeff proc~diffusion_solve_acoeff~3->proc~mg_fas_fmg~3 proc~diffusion_solve_acoeff~3->proc~mg_fas_vcycle~3 proc~diffusion_solve_vcoeff~3 diffusion_solve_vcoeff proc~diffusion_solve_vcoeff~3->proc~mg_fas_fmg~3 proc~diffusion_solve_vcoeff~3->proc~mg_fas_vcycle~3 proc~diffusion_solve~3 diffusion_solve proc~diffusion_solve~3->proc~mg_fas_fmg~3 proc~diffusion_solve~3->proc~mg_fas_vcycle~3 proc~mg_setup_multigrid mg_setup_multigrid proc~mg_setup_multigrid->proc~mg_tree_from_amrvac proc~mg_update_refinement mg_update_refinement proc~mg_update_refinement->proc~mg_tree_from_amrvac proc~amr_coarsen_refine amr_coarsen_refine proc~amr_coarsen_refine->proc~mg_update_refinement proc~improve_initial_condition improve_initial_condition proc~improve_initial_condition->proc~mg_setup_multigrid proc~main main proc~main->proc~mg_setup_multigrid proc~main->proc~improve_initial_condition proc~resettree_convert resettree_convert proc~main->proc~resettree_convert proc~settree settree proc~main->proc~settree proc~timeintegration timeintegration proc~main->proc~timeintegration proc~resettree resettree proc~resettree->proc~amr_coarsen_refine proc~resettree_convert->proc~amr_coarsen_refine proc~settree->proc~amr_coarsen_refine program~agile agile program~agile->proc~main proc~timeintegration->proc~resettree

Source Code

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