MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Data Types | Functions/Subroutines | Variables
m_octree_mg_3d Module Reference

Data Types

type  mg_lvl_t
 Lists of blocks per refinement level. More...
 
type  mg_box_t
 Box data structure. More...
 
type  mg_buf_t
 Buffer type (one is used for each pair of communicating processes) More...
 
type  mg_comm_t
 
type  mg_bc_t
 
type  mg_timer_t
 
type  mg_t
 
interface  mg_subr_bc
 To fill ghost cells near physical boundaries. More...
 

Functions/Subroutines

elemental logical function, public mg_has_children (box)
 Return .true. if a box has children. More...
 
integer function, public 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. More...
 
pure integer function, dimension(3), public mg_get_child_offset (mg, id)
 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) More...
 
pure integer function, public mg_highest_uniform_lvl (mg)
 
integer(i8) function, public mg_number_of_unknowns (mg)
 Determine total number of unknowns (on leaves) More...
 
subroutine, public mg_get_face_coords (box, nb, nc, x)
 Get coordinates at the face of a box. More...
 
integer function, public mg_add_timer (mg, name)
 
subroutine, public mg_timer_start (timer)
 
subroutine, public mg_timer_end (timer)
 
subroutine, public mg_timers_show (mg)
 
subroutine, public mg_deallocate_storage (mg)
 Deallocate all allocatable arrays. More...
 
subroutine, public mg_allocate_storage (mg)
 Allocate communication buffers and local boxes for a tree that has already been created. More...
 
subroutine, public diffusion_solve (mg, dt, diffusion_coeff, order, max_res)
 Solve a diffusion equation implicitly, assuming a constant diffusion coefficient. The solution at time t should be stored in mg_iphi, which is on output replaced by the solution at time t+dt. More...
 
subroutine, public diffusion_solve_vcoeff (mg, dt, order, max_res)
 Solve a diffusion equation implicitly, assuming a variable diffusion coefficient which has been stored in mg_iveps (also on coarse grids). The solution at time t should be stored in mg_iphi, which is on output replaced by the solution at time t+dt. More...
 
subroutine, public diffusion_solve_acoeff (mg, dt, order, max_res)
 Solve a diffusion equation implicitly, assuming anisotropic diffusion coefficient which has been stored in mg_iveps1, mg_iveps2, mg_iveps3 (also on coarse grids). The solution at time t should be stored in mg_iphi, which is on output replaced by the solution at time t+dt. More...
 
subroutine, public laplacian_set_methods (mg)
 
subroutine, public vhelmholtz_set_methods (mg)
 
subroutine, public vhelmholtz_set_lambda (lambda)
 
subroutine, public mg_build_rectangle (mg, domain_size, box_size, dx, r_min, periodic, n_finer)
 
subroutine, public mg_set_neighbors_lvl (mg, lvl)
 
subroutine, public mg_set_next_level_ids (mg, lvl)
 
subroutine, public mg_set_leaves_parents (boxes, level)
 Create a list of leaves and a list of parents for a level. More...
 
subroutine, public mg_set_refinement_boundaries (boxes, level)
 Create a list of refinement boundaries (from the coarse side) More...
 
subroutine, public mg_add_children (mg, id)
 
subroutine, public mg_load_balance_simple (mg)
 Load balance all boxes in the multigrid tree, by simply distributing the load per grid level. This method will only work well for uniform grids. More...
 
subroutine, public mg_load_balance (mg)
 Load balance all boxes in the multigrid tree. Compared to mg_load_balance_simple, this method does a better job of setting the ranks of parent boxes. More...
 
subroutine, public mg_load_balance_parents (mg)
 Load balance the parents (non-leafs). Assign them to the rank that has most children. More...
 
subroutine, public vlaplacian_set_methods (mg)
 
subroutine, public mg_comm_init (mg, comm)
 Prolong from a parent to a child with index offset dix. This method could sometimes work better than the default prolongation, which does not take the variation in epsilon into account. More...
 
subroutine, public sort_and_transfer_buffers (mg, dsize)
 
subroutine sort_sendbuf (gc, dsize)
 Sort send buffers according to the idbuf array. More...
 
subroutine, public mg_ghost_cell_buffer_size (mg, n_send, n_recv, dsize)
 Specify minimum buffer size (per process) for communication. More...
 
subroutine, public mg_phi_bc_store (mg)
 Store boundary conditions for the solution variable, this can speed up calculations if the same boundary conditions are re-used. More...
 
subroutine, public mg_fill_ghost_cells (mg, iv)
 Fill ghost cells at all grid levels. More...
 
subroutine, public mg_fill_ghost_cells_lvl (mg, lvl, iv)
 Fill ghost cells at a grid level. More...
 
subroutine, public mg_prolong_buffer_size (mg, n_send, n_recv, dsize)
 Specify minimum buffer size (per process) for communication. More...
 
subroutine, public mg_prolong (mg, lvl, iv, iv_to, method, add)
 Prolong variable iv from lvl to variable iv_to at lvl+1. More...
 
subroutine, public mg_prolong_sparse (mg, p_id, dix, nc, iv, fine)
 Prolong from a parent to a child with index offset dix. More...
 
subroutine, public helmholtz_set_methods (mg)
 
subroutine, public helmholtz_set_lambda (lambda)
 
subroutine, public mg_set_methods (mg)
 
subroutine, public mg_fas_fmg (mg, have_guess, max_res)
 Perform FAS-FMG cycle (full approximation scheme, full multigrid). More...
 
subroutine, public mg_fas_vcycle (mg, highest_lvl, max_res, standalone)
 Perform FAS V-cycle (full approximation scheme). More...
 
subroutine subtract_mean (mg, iv, include_ghostcells)
 
real(dp) function get_sum (mg, iv)
 
subroutine, public mg_apply_op (mg, i_out, op)
 Apply operator to the tree and store in variable i_out. More...
 
subroutine, public mg_restrict_buffer_size (mg, n_send, n_recv, dsize)
 Specify minimum buffer size (per process) for communication. More...
 
subroutine, public mg_restrict (mg, iv)
 Restrict all levels. More...
 
subroutine, public mg_restrict_lvl (mg, iv, lvl)
 Restrict from lvl to lvl-1. More...
 
subroutine, public ahelmholtz_set_methods (mg)
 
subroutine, public ahelmholtz_set_lambda (lambda)
 

Variables

integer, parameter, public dp = kind(0.0d0)
 Type of reals. More...
 
integer, parameter, public i8 = selected_int_kind(18)
 Type for 64-bit integers. More...
 
integer, parameter, public mg_laplacian = 1
 Indicates a standard Laplacian. More...
 
integer, parameter, public mg_vlaplacian = 2
 Indicates a variable-coefficient Laplacian. More...
 
integer, parameter, public mg_helmholtz = 3
 Indicates a constant-coefficient Helmholtz equation. More...
 
integer, parameter, public mg_vhelmholtz = 4
 Indicates a variable-coefficient Helmholtz equation. More...
 
integer, parameter, public mg_ahelmholtz = 5
 Indicates a anisotropic-coefficient Helmholtz equation. More...
 
integer, parameter, public mg_cartesian = 1
 Cartesian coordinate system. More...
 
integer, parameter, public mg_cylindrical = 2
 Cylindrical coordinate system. More...
 
integer, parameter, public mg_spherical = 3
 Spherical coordinate system. More...
 
integer, parameter, public mg_smoother_gs = 1
 
integer, parameter, public mg_smoother_gsrb = 2
 
integer, parameter, public mg_smoother_jacobi = 3
 
integer, parameter, public mg_ndim = 3
 Problem dimension. More...
 
integer, parameter, public mg_num_vars = 4
 Number of predefined multigrid variables. More...
 
integer, parameter, public mg_max_num_vars = 10
 Maximum number of variables. More...
 
integer, parameter, public mg_iphi = 1
 Index of solution. More...
 
integer, parameter, public mg_irhs = 2
 Index of right-hand side. More...
 
integer, parameter, public mg_iold = 3
 Index of previous solution (used for correction) More...
 
integer, parameter, public mg_ires = 4
 Index of residual. More...
 
integer, parameter, public mg_iveps = 5
 Index of the variable coefficient (at cell centers) More...
 
integer, parameter, public mg_iveps1 = 5
 Indexes of anisotropic variable coefficients. More...
 
integer, parameter, public mg_iveps2 = 6
 
integer, parameter, public mg_iveps3 = 7
 
integer, parameter, public mg_lvl_lo = -20
 Minimum allowed grid level. More...
 
integer, parameter, public mg_lvl_hi = 20
 Maximum allowed grid level. More...
 
integer, parameter, public mg_bc_dirichlet = -10
 Value to indicate a Dirichlet boundary condition. More...
 
integer, parameter, public mg_bc_neumann = -11
 Value to indicate a Neumann boundary condition. More...
 
integer, parameter, public mg_bc_continuous = -12
 Value to indicate a continuous boundary condition. More...
 
integer, parameter, public mg_no_box = 0
 Special value that indicates there is no box. More...
 
integer, parameter, public mg_physical_boundary = -1
 Special value that indicates there is a physical boundary. More...
 
integer, parameter, public mg_max_timers = 20
 Maximum number of timers to use. More...
 
integer, parameter, public mg_num_children = 8
 
integer, dimension(3, 8), parameter, public mg_child_dix = reshape( [0,0,0, 1,0,0, 0,1,0, 1,1,0, 0,0,1, 1,0,1, 0,1,1, 1,1,1], [3,8])
 
integer, dimension(8, 3), parameter, public mg_child_rev = reshape( [2,1,4,3,6,5,8,7, 3,4,1,2,7,8,5,6, 5,6,7,8,1,2,3,4], [8,3])
 
integer, dimension(4, 6), parameter, public mg_child_adj_nb = reshape( [1,3,5,7, 2,4,6,8, 1,2,5,6, 3,4,7,8, 1,2,3,4, 5,6,7,8], [4,6])
 
logical, dimension(3, 8), parameter, public mg_child_low = reshape([ .true., .true., .true., .false., .true., .true., .true., .false., .true., .false., .false., .true., .true., .true., .false., .false., .true., .false., .true., .false., .false., .false., .false., .false.], [3, 8])
 
integer, parameter, public mg_num_neighbors = 6
 
integer, parameter, public mg_neighb_lowx = 1
 
integer, parameter, public mg_neighb_highx = 2
 
integer, parameter, public mg_neighb_lowy = 3
 
integer, parameter, public mg_neighb_highy = 4
 
integer, parameter, public mg_neighb_lowz = 5
 
integer, parameter, public mg_neighb_highz = 6
 
integer, dimension(3, 6), parameter, public mg_neighb_dix = reshape( [-1,0,0, 1,0,0, 0,-1,0, 0,1,0, 0,0,-1, 0,0,1], [3,6])
 
logical, dimension(6), parameter, public mg_neighb_low = [.true., .false., .true., .false., .true., .false.]
 
integer, dimension(6), parameter, public mg_neighb_high_pm = [-1, 1, -1, 1, -1, 1]
 
integer, dimension(6), parameter, public mg_neighb_rev = [2, 1, 4, 3, 6, 5]
 
integer, dimension(6), parameter, public mg_neighb_dim = [1, 1, 2, 2, 3, 3]
 
real(dp), public, protected vhelmholtz_lambda = 0.0_dp
 Module for implicitly solving diffusion equations. More...
 
real(dp), public, protected helmholtz_lambda = 0.0_dp
 Module for load balancing a tree (that already has been constructed). The load balancing determines which ranks (MPI processes) allocated physical storage for boxes. The tree structure itself is present on all processes. More...
 
real(dp), public, protected ahelmholtz_lambda = 0.0_dp
 Module which contains multigrid procedures for a Helmholtz operator of the form: div(D grad(phi)) - lambda*phi = f, where D has a smooth spatial variation and a component in each spatial direction. More...
 

Function/Subroutine Documentation

◆ ahelmholtz_set_lambda()

subroutine, public m_octree_mg_3d::ahelmholtz_set_lambda ( real(dp), intent(in)  lambda)

Definition at line 3822 of file m_octree_mg_3d.t.

◆ ahelmholtz_set_methods()

subroutine, public m_octree_mg_3d::ahelmholtz_set_methods ( type(mg_t), intent(inout)  mg)

Definition at line 3786 of file m_octree_mg_3d.t.

◆ diffusion_solve()

subroutine, public m_octree_mg_3d::diffusion_solve ( type(mg_t), intent(inout)  mg,
real(dp), intent(in)  dt,
real(dp), intent(in)  diffusion_coeff,
integer, intent(in)  order,
real(dp), intent(in)  max_res 
)

Solve a diffusion equation implicitly, assuming a constant diffusion coefficient. The solution at time t should be stored in mg_iphi, which is on output replaced by the solution at time t+dt.

Definition at line 731 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ diffusion_solve_acoeff()

subroutine, public m_octree_mg_3d::diffusion_solve_acoeff ( type(mg_t), intent(inout)  mg,
real(dp), intent(in)  dt,
integer, intent(in)  order,
real(dp), intent(in)  max_res 
)

Solve a diffusion equation implicitly, assuming anisotropic diffusion coefficient which has been stored in mg_iveps1, mg_iveps2, mg_iveps3 (also on coarse grids). The solution at time t should be stored in mg_iphi, which is on output replaced by the solution at time t+dt.

Definition at line 827 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ diffusion_solve_vcoeff()

subroutine, public m_octree_mg_3d::diffusion_solve_vcoeff ( type(mg_t), intent(inout)  mg,
real(dp), intent(in)  dt,
integer, intent(in)  order,
real(dp), intent(in)  max_res 
)

Solve a diffusion equation implicitly, assuming a variable diffusion coefficient which has been stored in mg_iveps (also on coarse grids). The solution at time t should be stored in mg_iphi, which is on output replaced by the solution at time t+dt.

Definition at line 778 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ get_sum()

real(dp) function m_octree_mg_3d::get_sum ( type(mg_t), intent(in)  mg,
integer, intent(in)  iv 
)

Definition at line 3230 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ helmholtz_set_lambda()

subroutine, public m_octree_mg_3d::helmholtz_set_lambda ( real(dp), intent(in)  lambda)

Definition at line 2902 of file m_octree_mg_3d.t.

◆ helmholtz_set_methods()

subroutine, public m_octree_mg_3d::helmholtz_set_methods ( type(mg_t), intent(inout)  mg)

Definition at line 2881 of file m_octree_mg_3d.t.

◆ laplacian_set_methods()

subroutine, public m_octree_mg_3d::laplacian_set_methods ( type(mg_t), intent(inout)  mg)

Definition at line 889 of file m_octree_mg_3d.t.

◆ mg_add_children()

subroutine, public m_octree_mg_3d::mg_add_children ( type(mg_t), intent(inout)  mg,
integer, intent(in)  id 
)
Parameters
[in]idId of box that gets children

Definition at line 1469 of file m_octree_mg_3d.t.

◆ mg_add_timer()

integer function, public m_octree_mg_3d::mg_add_timer ( type(mg_t), intent(inout)  mg,
character(len=*), intent(in)  name 
)

Definition at line 596 of file m_octree_mg_3d.t.

◆ mg_allocate_storage()

subroutine, public m_octree_mg_3d::mg_allocate_storage ( type(mg_t), intent(inout)  mg)

Allocate communication buffers and local boxes for a tree that has already been created.

Definition at line 678 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_apply_op()

subroutine, public m_octree_mg_3d::mg_apply_op ( type(mg_t), intent(inout)  mg,
integer, intent(in)  i_out,
procedure(mg_box_op), optional  op 
)

Apply operator to the tree and store in variable i_out.

Definition at line 3391 of file m_octree_mg_3d.t.

◆ mg_build_rectangle()

subroutine, public m_octree_mg_3d::mg_build_rectangle ( type(mg_t), intent(inout)  mg,
integer, dimension(3), intent(in)  domain_size,
integer, intent(in)  box_size,
real(dp), dimension(3), intent(in)  dx,
real(dp), dimension(3), intent(in)  r_min,
logical, dimension(3), intent(in)  periodic,
integer, intent(in)  n_finer 
)

Definition at line 1155 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_comm_init()

subroutine, public m_octree_mg_3d::mg_comm_init ( type(mg_t), intent(inout)  mg,
integer, intent(in), optional  comm 
)

Prolong from a parent to a child with index offset dix. This method could sometimes work better than the default prolongation, which does not take the variation in epsilon into account.

Initialize MPI if needed, and store MPI information

Parameters
[in]commMPI communicator (default: MPI_COMM_WORLD)

Definition at line 1982 of file m_octree_mg_3d.t.

◆ mg_deallocate_storage()

subroutine, public m_octree_mg_3d::mg_deallocate_storage ( type(mg_t), intent(inout)  mg)

Deallocate all allocatable arrays.

Definition at line 641 of file m_octree_mg_3d.t.

◆ mg_fas_fmg()

subroutine, public m_octree_mg_3d::mg_fas_fmg ( type(mg_t), intent(inout)  mg,
logical, intent(in)  have_guess,
real(dp), intent(out), optional  max_res 
)

Perform FAS-FMG cycle (full approximation scheme, full multigrid).

Parameters
[in]have_guessIf false, start from phi = 0
[out]max_resStore max(abs(residual))

Definition at line 3036 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_fas_vcycle()

subroutine, public m_octree_mg_3d::mg_fas_vcycle ( type(mg_t), intent(inout)  mg,
integer, intent(in), optional  highest_lvl,
real(dp), intent(out), optional  max_res,
logical, intent(in), optional  standalone 
)

Perform FAS V-cycle (full approximation scheme).

Parameters
[in]highest_lvlMaximum level for V-cycle
[out]max_resStore max(abs(residual))
[in]standaloneWhether the V-cycle is called by itself (default: true)

Definition at line 3102 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_fill_ghost_cells()

subroutine, public m_octree_mg_3d::mg_fill_ghost_cells ( type(mg_t mg,
integer, intent(in)  iv 
)

Fill ghost cells at all grid levels.

Parameters
[in]ivIndex of variable

Definition at line 2158 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_fill_ghost_cells_lvl()

subroutine, public m_octree_mg_3d::mg_fill_ghost_cells_lvl ( type(mg_t mg,
integer, intent(in)  lvl,
integer, intent(in)  iv 
)

Fill ghost cells at a grid level.

Parameters
[in]ivIndex of variable

Definition at line 2169 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_get_child_offset()

pure integer function, dimension(3), public m_octree_mg_3d::mg_get_child_offset ( type(mg_t), intent(in)  mg,
integer, intent(in)  id 
)

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)

Definition at line 529 of file m_octree_mg_3d.t.

◆ mg_get_face_coords()

subroutine, public m_octree_mg_3d::mg_get_face_coords ( type(mg_box_t), intent(in)  box,
integer, intent(in)  nb,
integer, intent(in)  nc,
real(dp), dimension(nc, nc, 3), intent(out)  x 
)

Get coordinates at the face of a box.

Definition at line 568 of file m_octree_mg_3d.t.

◆ mg_ghost_cell_buffer_size()

subroutine, public m_octree_mg_3d::mg_ghost_cell_buffer_size ( type(mg_t), intent(inout)  mg,
integer, dimension(0:mg%n_cpu-1), intent(out)  n_send,
integer, dimension(0:mg%n_cpu-1), intent(out)  n_recv,
integer, intent(out)  dsize 
)

Specify minimum buffer size (per process) for communication.

Definition at line 2061 of file m_octree_mg_3d.t.

◆ mg_has_children()

elemental logical function, public m_octree_mg_3d::mg_has_children ( type(mg_box_t), intent(in)  box)

Return .true. if a box has children.

Definition at line 509 of file m_octree_mg_3d.t.

◆ mg_highest_uniform_lvl()

pure integer function, public m_octree_mg_3d::mg_highest_uniform_lvl ( type(mg_t), intent(in)  mg)

Definition at line 542 of file m_octree_mg_3d.t.

◆ mg_ix_to_ichild()

integer function, public m_octree_mg_3d::mg_ix_to_ichild ( integer, dimension(3), intent(in)  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.

Parameters
[in]ixSpatial index of the box

Definition at line 519 of file m_octree_mg_3d.t.

◆ mg_load_balance()

subroutine, public m_octree_mg_3d::mg_load_balance ( type(mg_t), intent(inout)  mg)

Load balance all boxes in the multigrid tree. Compared to mg_load_balance_simple, this method does a better job of setting the ranks of parent boxes.

Note that in a typical application the load balancing of the leaves is already determined, then mg_load_balance_parents can be used.

Definition at line 1590 of file m_octree_mg_3d.t.

◆ mg_load_balance_parents()

subroutine, public m_octree_mg_3d::mg_load_balance_parents ( type(mg_t), intent(inout)  mg)

Load balance the parents (non-leafs). Assign them to the rank that has most children.

Definition at line 1659 of file m_octree_mg_3d.t.

◆ mg_load_balance_simple()

subroutine, public m_octree_mg_3d::mg_load_balance_simple ( type(mg_t), intent(inout)  mg)

Load balance all boxes in the multigrid tree, by simply distributing the load per grid level. This method will only work well for uniform grids.

Note that in a typical application the load balancing of the leaves is already determined, then mg_load_balance_parents can be used.

Definition at line 1541 of file m_octree_mg_3d.t.

◆ mg_number_of_unknowns()

integer(i8) function, public m_octree_mg_3d::mg_number_of_unknowns ( type(mg_t), intent(in)  mg)

Determine total number of unknowns (on leaves)

Definition at line 555 of file m_octree_mg_3d.t.

◆ mg_phi_bc_store()

subroutine, public m_octree_mg_3d::mg_phi_bc_store ( type(mg_t), intent(inout)  mg)

Store boundary conditions for the solution variable, this can speed up calculations if the same boundary conditions are re-used.

Definition at line 2110 of file m_octree_mg_3d.t.

◆ mg_prolong()

subroutine, public m_octree_mg_3d::mg_prolong ( type(mg_t), intent(inout)  mg,
integer, intent(in)  lvl,
integer, intent(in)  iv,
integer, intent(in)  iv_to,
procedure(mg_box_prolong)  method,
logical, intent(in)  add 
)

Prolong variable iv from lvl to variable iv_to at lvl+1.

Parameters
[in]lvlLevel to prolong from
[in]ivSource variable
[in]iv_toTarget variable
methodProlongation method
[in]addIf true, add to current values

Definition at line 2728 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_prolong_buffer_size()

subroutine, public m_octree_mg_3d::mg_prolong_buffer_size ( type(mg_t), intent(inout)  mg,
integer, dimension(0:mg%n_cpu-1), intent(out)  n_send,
integer, dimension(0:mg%n_cpu-1), intent(out)  n_recv,
integer, intent(out)  dsize 
)

Specify minimum buffer size (per process) for communication.

Definition at line 2693 of file m_octree_mg_3d.t.

◆ mg_prolong_sparse()

subroutine, public m_octree_mg_3d::mg_prolong_sparse ( type(mg_t), intent(inout)  mg,
integer, intent(in)  p_id,
integer, dimension(3), intent(in)  dix,
integer, intent(in)  nc,
integer, intent(in)  iv,
real(dp), dimension(nc, nc, nc), intent(out)  fine 
)

Prolong from a parent to a child with index offset dix.

Parameters
[in]p_idId of parent
[in]dixOffset of child in parent grid
[in]ncChild grid size
[in]ivProlong from this variable
[out]fineProlonged values

Definition at line 2835 of file m_octree_mg_3d.t.

◆ mg_restrict()

subroutine, public m_octree_mg_3d::mg_restrict ( type(mg_t), intent(inout)  mg,
integer, intent(in)  iv 
)

Restrict all levels.

Definition at line 3469 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_restrict_buffer_size()

subroutine, public m_octree_mg_3d::mg_restrict_buffer_size ( type(mg_t), intent(inout)  mg,
integer, dimension(0:mg%n_cpu-1), intent(out)  n_send,
integer, dimension(0:mg%n_cpu-1), intent(out)  n_recv,
integer, intent(out)  dsize 
)

Specify minimum buffer size (per process) for communication.

Definition at line 3413 of file m_octree_mg_3d.t.

◆ mg_restrict_lvl()

subroutine, public m_octree_mg_3d::mg_restrict_lvl ( type(mg_t), intent(inout)  mg,
integer, intent(in)  iv,
integer, intent(in)  lvl 
)

Restrict from lvl to lvl-1.

Definition at line 3480 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_set_leaves_parents()

subroutine, public m_octree_mg_3d::mg_set_leaves_parents ( type(mg_box_t), dimension(:), intent(in)  boxes,
type(mg_lvl_t), intent(inout)  level 
)

Create a list of leaves and a list of parents for a level.

Parameters
[in]boxesList of boxes
[in,out]levelLevel type which contains the indices of boxes

Definition at line 1397 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_set_methods()

subroutine, public m_octree_mg_3d::mg_set_methods ( type(mg_t), intent(inout)  mg)

Definition at line 2983 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_set_neighbors_lvl()

subroutine, public m_octree_mg_3d::mg_set_neighbors_lvl ( type(mg_t), intent(inout)  mg,
integer, intent(in)  lvl 
)

Definition at line 1315 of file m_octree_mg_3d.t.

◆ mg_set_next_level_ids()

subroutine, public m_octree_mg_3d::mg_set_next_level_ids ( type(mg_t), intent(inout)  mg,
integer, intent(in)  lvl 
)

Definition at line 1326 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_set_refinement_boundaries()

subroutine, public m_octree_mg_3d::mg_set_refinement_boundaries ( type(mg_box_t), dimension(:), intent(in)  boxes,
type(mg_lvl_t), intent(inout)  level 
)

Create a list of refinement boundaries (from the coarse side)

Definition at line 1435 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ mg_timer_end()

subroutine, public m_octree_mg_3d::mg_timer_end ( type(mg_timer_t), intent(inout)  timer)

Definition at line 611 of file m_octree_mg_3d.t.

◆ mg_timer_start()

subroutine, public m_octree_mg_3d::mg_timer_start ( type(mg_timer_t), intent(inout)  timer)

Definition at line 605 of file m_octree_mg_3d.t.

◆ mg_timers_show()

subroutine, public m_octree_mg_3d::mg_timers_show ( type(mg_t), intent(in)  mg)

Definition at line 617 of file m_octree_mg_3d.t.

◆ sort_and_transfer_buffers()

subroutine, public m_octree_mg_3d::sort_and_transfer_buffers ( type(mg_t), intent(inout)  mg,
integer, intent(in)  dsize 
)

Definition at line 2005 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ sort_sendbuf()

subroutine m_octree_mg_3d::sort_sendbuf ( type(mg_buf_t), intent(inout)  gc,
integer, intent(in)  dsize 
)

Sort send buffers according to the idbuf array.

Parameters
[in]dsizeSize of send buffer elements

Definition at line 2037 of file m_octree_mg_3d.t.

◆ subtract_mean()

subroutine m_octree_mg_3d::subtract_mean ( type(mg_t), intent(inout)  mg,
integer, intent(in)  iv,
logical, intent(in)  include_ghostcells 
)

Definition at line 3197 of file m_octree_mg_3d.t.

Here is the call graph for this function:

◆ vhelmholtz_set_lambda()

subroutine, public m_octree_mg_3d::vhelmholtz_set_lambda ( real(dp), intent(in)  lambda)

Definition at line 1058 of file m_octree_mg_3d.t.

◆ vhelmholtz_set_methods()

subroutine, public m_octree_mg_3d::vhelmholtz_set_methods ( type(mg_t), intent(inout)  mg)

Definition at line 1026 of file m_octree_mg_3d.t.

◆ vlaplacian_set_methods()

subroutine, public m_octree_mg_3d::vlaplacian_set_methods ( type(mg_t), intent(inout)  mg)

Definition at line 1758 of file m_octree_mg_3d.t.

Variable Documentation

◆ ahelmholtz_lambda

real(dp), public, protected m_octree_mg_3d::ahelmholtz_lambda = 0.0_dp

Module which contains multigrid procedures for a Helmholtz operator of the form: div(D grad(phi)) - lambda*phi = f, where D has a smooth spatial variation and a component in each spatial direction.

The lambda used for the Helmholtz equation (should be >= 0)

Definition at line 500 of file m_octree_mg_3d.t.

◆ dp

integer, parameter, public m_octree_mg_3d::dp = kind(0.0d0)

Type of reals.

Definition at line 30 of file m_octree_mg_3d.t.

◆ helmholtz_lambda

real(dp), public, protected m_octree_mg_3d::helmholtz_lambda = 0.0_dp

Module for load balancing a tree (that already has been constructed). The load balancing determines which ranks (MPI processes) allocated physical storage for boxes. The tree structure itself is present on all processes.

Module which contains multigrid procedures for a variable-coefficient Laplacian operator, assuming the variation is smooth Module which contains multigrid procedures for a Helmholtz operator of the form: laplacian(phi) - lambda*phi = f The lambda used for the Helmholtz equation (should be >= 0)

Definition at line 455 of file m_octree_mg_3d.t.

◆ i8

integer, parameter, public m_octree_mg_3d::i8 = selected_int_kind(18)

Type for 64-bit integers.

Definition at line 33 of file m_octree_mg_3d.t.

◆ mg_ahelmholtz

integer, parameter, public m_octree_mg_3d::mg_ahelmholtz = 5

Indicates a anisotropic-coefficient Helmholtz equation.

Definition at line 48 of file m_octree_mg_3d.t.

◆ mg_bc_continuous

integer, parameter, public m_octree_mg_3d::mg_bc_continuous = -12

Value to indicate a continuous boundary condition.

Definition at line 97 of file m_octree_mg_3d.t.

◆ mg_bc_dirichlet

integer, parameter, public m_octree_mg_3d::mg_bc_dirichlet = -10

Value to indicate a Dirichlet boundary condition.

Definition at line 91 of file m_octree_mg_3d.t.

◆ mg_bc_neumann

integer, parameter, public m_octree_mg_3d::mg_bc_neumann = -11

Value to indicate a Neumann boundary condition.

Definition at line 94 of file m_octree_mg_3d.t.

◆ mg_cartesian

integer, parameter, public m_octree_mg_3d::mg_cartesian = 1

Cartesian coordinate system.

Definition at line 51 of file m_octree_mg_3d.t.

◆ mg_child_adj_nb

integer, dimension(4, 6), parameter, public m_octree_mg_3d::mg_child_adj_nb = reshape( [1,3,5,7, 2,4,6,8, 1,2,5,6, 3,4,7,8, 1,2,3,4, 5,6,7,8], [4,6])

Definition at line 118 of file m_octree_mg_3d.t.

◆ mg_child_dix

integer, dimension(3, 8), parameter, public m_octree_mg_3d::mg_child_dix = reshape( [0,0,0, 1,0,0, 0,1,0, 1,1,0, 0,0,1, 1,0,1, 0,1,1, 1,1,1], [3,8])

Definition at line 111 of file m_octree_mg_3d.t.

◆ mg_child_low

logical, dimension(3, 8), parameter, public m_octree_mg_3d::mg_child_low = reshape([ .true., .true., .true., .false., .true., .true., .true., .false., .true., .false., .false., .true., .true., .true., .false., .false., .true., .false., .true., .false., .false., .false., .false., .false.], [3, 8])

Definition at line 121 of file m_octree_mg_3d.t.

◆ mg_child_rev

integer, dimension(8, 3), parameter, public m_octree_mg_3d::mg_child_rev = reshape( [2,1,4,3,6,5,8,7, 3,4,1,2,7,8,5,6, 5,6,7,8,1,2,3,4], [8,3])

Definition at line 115 of file m_octree_mg_3d.t.

◆ mg_cylindrical

integer, parameter, public m_octree_mg_3d::mg_cylindrical = 2

Cylindrical coordinate system.

Definition at line 53 of file m_octree_mg_3d.t.

◆ mg_helmholtz

integer, parameter, public m_octree_mg_3d::mg_helmholtz = 3

Indicates a constant-coefficient Helmholtz equation.

Definition at line 42 of file m_octree_mg_3d.t.

◆ mg_iold

integer, parameter, public m_octree_mg_3d::mg_iold = 3

Index of previous solution (used for correction)

Definition at line 73 of file m_octree_mg_3d.t.

◆ mg_iphi

integer, parameter, public m_octree_mg_3d::mg_iphi = 1

Index of solution.

Definition at line 69 of file m_octree_mg_3d.t.

◆ mg_ires

integer, parameter, public m_octree_mg_3d::mg_ires = 4

Index of residual.

Definition at line 75 of file m_octree_mg_3d.t.

◆ mg_irhs

integer, parameter, public m_octree_mg_3d::mg_irhs = 2

Index of right-hand side.

Definition at line 71 of file m_octree_mg_3d.t.

◆ mg_iveps

integer, parameter, public m_octree_mg_3d::mg_iveps = 5

Index of the variable coefficient (at cell centers)

Definition at line 78 of file m_octree_mg_3d.t.

◆ mg_iveps1

integer, parameter, public m_octree_mg_3d::mg_iveps1 = 5

Indexes of anisotropic variable coefficients.

Definition at line 81 of file m_octree_mg_3d.t.

◆ mg_iveps2

integer, parameter, public m_octree_mg_3d::mg_iveps2 = 6

Definition at line 82 of file m_octree_mg_3d.t.

◆ mg_iveps3

integer, parameter, public m_octree_mg_3d::mg_iveps3 = 7

Definition at line 83 of file m_octree_mg_3d.t.

◆ mg_laplacian

integer, parameter, public m_octree_mg_3d::mg_laplacian = 1

Indicates a standard Laplacian.

Definition at line 36 of file m_octree_mg_3d.t.

◆ mg_lvl_hi

integer, parameter, public m_octree_mg_3d::mg_lvl_hi = 20

Maximum allowed grid level.

Definition at line 88 of file m_octree_mg_3d.t.

◆ mg_lvl_lo

integer, parameter, public m_octree_mg_3d::mg_lvl_lo = -20

Minimum allowed grid level.

Definition at line 86 of file m_octree_mg_3d.t.

◆ mg_max_num_vars

integer, parameter, public m_octree_mg_3d::mg_max_num_vars = 10

Maximum number of variables.

Definition at line 67 of file m_octree_mg_3d.t.

◆ mg_max_timers

integer, parameter, public m_octree_mg_3d::mg_max_timers = 20

Maximum number of timers to use.

Definition at line 105 of file m_octree_mg_3d.t.

◆ mg_ndim

integer, parameter, public m_octree_mg_3d::mg_ndim = 3

Problem dimension.

Definition at line 62 of file m_octree_mg_3d.t.

◆ mg_neighb_dim

integer, dimension(6), parameter, public m_octree_mg_3d::mg_neighb_dim = [1, 1, 2, 2, 3, 3]

Definition at line 146 of file m_octree_mg_3d.t.

◆ mg_neighb_dix

integer, dimension(3, 6), parameter, public m_octree_mg_3d::mg_neighb_dix = reshape( [-1,0,0, 1,0,0, 0,-1,0, 0,1,0, 0,0,-1, 0,0,1], [3,6])

Definition at line 136 of file m_octree_mg_3d.t.

◆ mg_neighb_high_pm

integer, dimension(6), parameter, public m_octree_mg_3d::mg_neighb_high_pm = [-1, 1, -1, 1, -1, 1]

Definition at line 142 of file m_octree_mg_3d.t.

◆ mg_neighb_highx

integer, parameter, public m_octree_mg_3d::mg_neighb_highx = 2

Definition at line 130 of file m_octree_mg_3d.t.

◆ mg_neighb_highy

integer, parameter, public m_octree_mg_3d::mg_neighb_highy = 4

Definition at line 132 of file m_octree_mg_3d.t.

◆ mg_neighb_highz

integer, parameter, public m_octree_mg_3d::mg_neighb_highz = 6

Definition at line 134 of file m_octree_mg_3d.t.

◆ mg_neighb_low

logical, dimension(6), parameter, public m_octree_mg_3d::mg_neighb_low = [.true., .false., .true., .false., .true., .false.]

Definition at line 139 of file m_octree_mg_3d.t.

◆ mg_neighb_lowx

integer, parameter, public m_octree_mg_3d::mg_neighb_lowx = 1

Definition at line 129 of file m_octree_mg_3d.t.

◆ mg_neighb_lowy

integer, parameter, public m_octree_mg_3d::mg_neighb_lowy = 3

Definition at line 131 of file m_octree_mg_3d.t.

◆ mg_neighb_lowz

integer, parameter, public m_octree_mg_3d::mg_neighb_lowz = 5

Definition at line 133 of file m_octree_mg_3d.t.

◆ mg_neighb_rev

integer, dimension(6), parameter, public m_octree_mg_3d::mg_neighb_rev = [2, 1, 4, 3, 6, 5]

Definition at line 144 of file m_octree_mg_3d.t.

◆ mg_no_box

integer, parameter, public m_octree_mg_3d::mg_no_box = 0

Special value that indicates there is no box.

Definition at line 100 of file m_octree_mg_3d.t.

◆ mg_num_children

integer, parameter, public m_octree_mg_3d::mg_num_children = 8

Definition at line 108 of file m_octree_mg_3d.t.

◆ mg_num_neighbors

integer, parameter, public m_octree_mg_3d::mg_num_neighbors = 6

Definition at line 128 of file m_octree_mg_3d.t.

◆ mg_num_vars

integer, parameter, public m_octree_mg_3d::mg_num_vars = 4

Number of predefined multigrid variables.

Definition at line 65 of file m_octree_mg_3d.t.

◆ mg_physical_boundary

integer, parameter, public m_octree_mg_3d::mg_physical_boundary = -1

Special value that indicates there is a physical boundary.

Definition at line 102 of file m_octree_mg_3d.t.

◆ mg_smoother_gs

integer, parameter, public m_octree_mg_3d::mg_smoother_gs = 1

Definition at line 57 of file m_octree_mg_3d.t.

◆ mg_smoother_gsrb

integer, parameter, public m_octree_mg_3d::mg_smoother_gsrb = 2

Definition at line 58 of file m_octree_mg_3d.t.

◆ mg_smoother_jacobi

integer, parameter, public m_octree_mg_3d::mg_smoother_jacobi = 3

Definition at line 59 of file m_octree_mg_3d.t.

◆ mg_spherical

integer, parameter, public m_octree_mg_3d::mg_spherical = 3

Spherical coordinate system.

Definition at line 55 of file m_octree_mg_3d.t.

◆ mg_vhelmholtz

integer, parameter, public m_octree_mg_3d::mg_vhelmholtz = 4

Indicates a variable-coefficient Helmholtz equation.

Definition at line 45 of file m_octree_mg_3d.t.

◆ mg_vlaplacian

integer, parameter, public m_octree_mg_3d::mg_vlaplacian = 2

Indicates a variable-coefficient Laplacian.

Definition at line 39 of file m_octree_mg_3d.t.

◆ vhelmholtz_lambda

real(dp), public, protected m_octree_mg_3d::vhelmholtz_lambda = 0.0_dp

Module for implicitly solving diffusion equations.

Module which contains multigrid procedures for a Laplacian operator Module which contains multigrid procedures for a Helmholtz operator of the form: div(D grad(phi)) - lambda*phi = f, where D has a smooth spatial variation The lambda used for the Helmholtz equation (should be >= 0)

Definition at line 396 of file m_octree_mg_3d.t.