mg_get_child_offset Function

public pure function mg_get_child_offset(mg, id) result(ix_offset)

Get the offset of a box with respect to its parent (e.g. in 2d, there can be a child at offset 0,0, one at n_cell/2,0, one at 0,n_cell/2 and one at n_cell/2, n_cell/2) n_cell / 2

Arguments

Type IntentOptional Attributes Name
type(mg_t), intent(in) :: mg
integer, intent(in) :: id

Return Value integer, (2)


Called by

proc~~mg_get_child_offset~~CalledByGraph proc~mg_get_child_offset mg_get_child_offset proc~buffer_for_fine_nb buffer_for_fine_nb proc~buffer_for_fine_nb->proc~mg_get_child_offset proc~fill_refinement_bnd fill_refinement_bnd proc~fill_refinement_bnd->proc~mg_get_child_offset proc~prolong_onto prolong_onto proc~prolong_onto->proc~mg_get_child_offset proc~prolong_set_buffer prolong_set_buffer proc~prolong_set_buffer->proc~mg_get_child_offset proc~restrict_onto restrict_onto proc~restrict_onto->proc~mg_get_child_offset proc~buffer_refinement_boundaries buffer_refinement_boundaries proc~buffer_refinement_boundaries->proc~buffer_for_fine_nb proc~mg_prolong mg_prolong proc~mg_prolong->proc~prolong_onto proc~mg_prolong->proc~prolong_set_buffer proc~mg_restrict_lvl mg_restrict_lvl proc~mg_restrict_lvl->proc~restrict_onto proc~set_ghost_cells set_ghost_cells proc~set_ghost_cells->proc~fill_refinement_bnd proc~correct_children correct_children proc~correct_children->proc~mg_prolong proc~mg_fill_ghost_cells_lvl mg_fill_ghost_cells_lvl proc~mg_fill_ghost_cells_lvl->proc~buffer_refinement_boundaries proc~mg_fill_ghost_cells_lvl->proc~set_ghost_cells proc~mg_ghost_cell_buffer_size mg_ghost_cell_buffer_size proc~mg_ghost_cell_buffer_size->proc~buffer_refinement_boundaries proc~mg_ghost_cell_buffer_size->proc~set_ghost_cells proc~mg_restrict mg_restrict proc~mg_restrict->proc~mg_restrict_lvl proc~update_coarse update_coarse proc~update_coarse->proc~mg_restrict_lvl proc~update_coarse->proc~mg_fill_ghost_cells_lvl proc~mg_allocate_storage mg_allocate_storage proc~mg_allocate_storage->proc~mg_ghost_cell_buffer_size proc~mg_fas_fmg mg_fas_fmg proc~mg_fas_fmg->proc~correct_children proc~mg_fas_fmg->proc~mg_fill_ghost_cells_lvl proc~mg_fas_fmg->proc~update_coarse proc~mg_fas_vcycle mg_fas_vcycle proc~mg_fas_fmg->proc~mg_fas_vcycle proc~mg_fas_vcycle->proc~correct_children proc~mg_fas_vcycle->proc~mg_fill_ghost_cells_lvl proc~mg_fas_vcycle->proc~update_coarse proc~smooth_boxes smooth_boxes proc~mg_fas_vcycle->proc~smooth_boxes proc~mg_fill_ghost_cells mg_fill_ghost_cells proc~mg_fill_ghost_cells->proc~mg_fill_ghost_cells_lvl proc~smooth_boxes->proc~mg_fill_ghost_cells_lvl proc~diffusion_solve diffusion_solve proc~diffusion_solve->proc~mg_fas_fmg proc~diffusion_solve->proc~mg_fas_vcycle proc~diffusion_solve_acoeff diffusion_solve_acoeff proc~diffusion_solve_acoeff->proc~mg_fas_fmg proc~diffusion_solve_acoeff->proc~mg_fas_vcycle proc~diffusion_solve_vcoeff diffusion_solve_vcoeff proc~diffusion_solve_vcoeff->proc~mg_fas_fmg proc~diffusion_solve_vcoeff->proc~mg_fas_vcycle

Source Code

  pure function mg_get_child_offset(mg, id) result(ix_offset)
    type(mg_t), intent(in) :: mg
    integer, intent(in)    :: id
    integer                :: ix_offset(2)

    if (mg%boxes(id)%lvl <= mg%first_normal_lvl) then
       ix_offset(:) = 0
    else
       ix_offset = iand(mg%boxes(id)%ix-1, 1) * ishft(mg%box_size, -1)
       !* n_cell / 2
    end if
  end function mg_get_child_offset