MPI-AMRVAC  3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
Data Types | Functions/Subroutines | Variables
m_octree_mg_2d 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(2), 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 = 2
 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 = 4
 
integer, dimension(2, 4), parameter, public mg_child_dix = reshape([0,0,1,0,0,1,1,1], [2,4])
 
integer, dimension(4, 2), parameter, public mg_child_rev = reshape([2,1,4,3,3,4,1,2], [4,2])
 
integer, dimension(2, 4), parameter, public mg_child_adj_nb = reshape([1,3,2,4,1,2,3,4], [2,4])
 
logical, dimension(2, 4), parameter, public mg_child_low = reshape([.true., .true., .false., .true., .true., .false., .false., .false.], [2, 4])
 
integer, parameter, public mg_num_neighbors = 4
 
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, dimension(2, 4), parameter, public mg_neighb_dix = reshape([-1,0,1,0,0,-1,0,1], [2,4])
 
logical, dimension(4), parameter, public mg_neighb_low = [.true., .false., .true., .false.]
 
integer, dimension(4), parameter, public mg_neighb_high_pm = [-1, 1, -1, 1]
 
integer, dimension(4), parameter, public mg_neighb_rev = [2, 1, 4, 3]
 
integer, dimension(4), parameter, public mg_neighb_dim = [1, 1, 2, 2]
 
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_2d::ahelmholtz_set_lambda ( real(dp), intent(in)  lambda)

Definition at line 3798 of file m_octree_mg_2d.t.

◆ ahelmholtz_set_methods()

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

Definition at line 3764 of file m_octree_mg_2d.t.

◆ diffusion_solve()

subroutine, public m_octree_mg_2d::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 719 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ diffusion_solve_acoeff()

subroutine, public m_octree_mg_2d::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 815 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ diffusion_solve_vcoeff()

subroutine, public m_octree_mg_2d::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 766 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ get_sum()

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

Definition at line 3211 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ helmholtz_set_lambda()

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

Definition at line 2892 of file m_octree_mg_2d.t.

◆ helmholtz_set_methods()

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

Definition at line 2871 of file m_octree_mg_2d.t.

◆ laplacian_set_methods()

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

Definition at line 878 of file m_octree_mg_2d.t.

◆ mg_add_children()

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

Definition at line 1523 of file m_octree_mg_2d.t.

◆ mg_add_timer()

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

Definition at line 584 of file m_octree_mg_2d.t.

◆ mg_allocate_storage()

subroutine, public m_octree_mg_2d::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 666 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_apply_op()

subroutine, public m_octree_mg_2d::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 3372 of file m_octree_mg_2d.t.

◆ mg_build_rectangle()

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

Definition at line 1211 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_comm_init()

subroutine, public m_octree_mg_2d::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 2029 of file m_octree_mg_2d.t.

◆ mg_deallocate_storage()

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

Deallocate all allocatable arrays.

Definition at line 629 of file m_octree_mg_2d.t.

◆ mg_fas_fmg()

subroutine, public m_octree_mg_2d::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 3017 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_fas_vcycle()

subroutine, public m_octree_mg_2d::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 3083 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_fill_ghost_cells()

subroutine, public m_octree_mg_2d::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 2205 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_fill_ghost_cells_lvl()

subroutine, public m_octree_mg_2d::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 2216 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_get_child_offset()

pure integer function, dimension(2), public m_octree_mg_2d::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 519 of file m_octree_mg_2d.t.

◆ mg_get_face_coords()

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

Get coordinates at the face of a box.

Definition at line 558 of file m_octree_mg_2d.t.

◆ mg_ghost_cell_buffer_size()

subroutine, public m_octree_mg_2d::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 2108 of file m_octree_mg_2d.t.

◆ mg_has_children()

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

Return .true. if a box has children.

Definition at line 500 of file m_octree_mg_2d.t.

◆ mg_highest_uniform_lvl()

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

Definition at line 532 of file m_octree_mg_2d.t.

◆ mg_ix_to_ichild()

integer function, public m_octree_mg_2d::mg_ix_to_ichild ( integer, dimension(2), 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 510 of file m_octree_mg_2d.t.

◆ mg_load_balance()

subroutine, public m_octree_mg_2d::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 1644 of file m_octree_mg_2d.t.

◆ mg_load_balance_parents()

subroutine, public m_octree_mg_2d::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 1713 of file m_octree_mg_2d.t.

◆ mg_load_balance_simple()

subroutine, public m_octree_mg_2d::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 1595 of file m_octree_mg_2d.t.

◆ mg_number_of_unknowns()

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

Determine total number of unknowns (on leaves)

Definition at line 545 of file m_octree_mg_2d.t.

◆ mg_phi_bc_store()

subroutine, public m_octree_mg_2d::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 2157 of file m_octree_mg_2d.t.

◆ mg_prolong()

subroutine, public m_octree_mg_2d::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 2727 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_prolong_buffer_size()

subroutine, public m_octree_mg_2d::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 2692 of file m_octree_mg_2d.t.

◆ mg_prolong_sparse()

subroutine, public m_octree_mg_2d::mg_prolong_sparse ( type(mg_t), intent(inout)  mg,
integer, intent(in)  p_id,
integer, dimension(2), intent(in)  dix,
integer, intent(in)  nc,
integer, intent(in)  iv,
real(dp), dimension(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 2834 of file m_octree_mg_2d.t.

◆ mg_restrict()

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

Restrict all levels.

Definition at line 3450 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_restrict_buffer_size()

subroutine, public m_octree_mg_2d::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 3394 of file m_octree_mg_2d.t.

◆ mg_restrict_lvl()

subroutine, public m_octree_mg_2d::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 3461 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_set_leaves_parents()

subroutine, public m_octree_mg_2d::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 1451 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_set_methods()

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

Definition at line 2964 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_set_neighbors_lvl()

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

Definition at line 1369 of file m_octree_mg_2d.t.

◆ mg_set_next_level_ids()

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

Definition at line 1380 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_set_refinement_boundaries()

subroutine, public m_octree_mg_2d::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 1489 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ mg_timer_end()

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

Definition at line 599 of file m_octree_mg_2d.t.

◆ mg_timer_start()

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

Definition at line 593 of file m_octree_mg_2d.t.

◆ mg_timers_show()

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

Definition at line 605 of file m_octree_mg_2d.t.

◆ sort_and_transfer_buffers()

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

Definition at line 2052 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ sort_sendbuf()

subroutine m_octree_mg_2d::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 2084 of file m_octree_mg_2d.t.

◆ subtract_mean()

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

Definition at line 3178 of file m_octree_mg_2d.t.

Here is the call graph for this function:

◆ vhelmholtz_set_lambda()

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

Definition at line 1121 of file m_octree_mg_2d.t.

◆ vhelmholtz_set_methods()

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

Definition at line 1089 of file m_octree_mg_2d.t.

◆ vlaplacian_set_methods()

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

Definition at line 1812 of file m_octree_mg_2d.t.

Variable Documentation

◆ ahelmholtz_lambda

real(dp), public, protected m_octree_mg_2d::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 491 of file m_octree_mg_2d.t.

◆ dp

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

Type of reals.

Definition at line 30 of file m_octree_mg_2d.t.

◆ helmholtz_lambda

real(dp), public, protected m_octree_mg_2d::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 446 of file m_octree_mg_2d.t.

◆ i8

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

Type for 64-bit integers.

Definition at line 33 of file m_octree_mg_2d.t.

◆ mg_ahelmholtz

integer, parameter, public m_octree_mg_2d::mg_ahelmholtz = 5

Indicates a anisotropic-coefficient Helmholtz equation.

Definition at line 48 of file m_octree_mg_2d.t.

◆ mg_bc_continuous

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

Value to indicate a continuous boundary condition.

Definition at line 97 of file m_octree_mg_2d.t.

◆ mg_bc_dirichlet

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

Value to indicate a Dirichlet boundary condition.

Definition at line 91 of file m_octree_mg_2d.t.

◆ mg_bc_neumann

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

Value to indicate a Neumann boundary condition.

Definition at line 94 of file m_octree_mg_2d.t.

◆ mg_cartesian

integer, parameter, public m_octree_mg_2d::mg_cartesian = 1

Cartesian coordinate system.

Definition at line 51 of file m_octree_mg_2d.t.

◆ mg_child_adj_nb

integer, dimension(2, 4), parameter, public m_octree_mg_2d::mg_child_adj_nb = reshape([1,3,2,4,1,2,3,4], [2,4])

Definition at line 115 of file m_octree_mg_2d.t.

◆ mg_child_dix

integer, dimension(2, 4), parameter, public m_octree_mg_2d::mg_child_dix = reshape([0,0,1,0,0,1,1,1], [2,4])

Definition at line 111 of file m_octree_mg_2d.t.

◆ mg_child_low

logical, dimension(2, 4), parameter, public m_octree_mg_2d::mg_child_low = reshape([.true., .true., .false., .true., .true., .false., .false., .false.], [2, 4])

Definition at line 117 of file m_octree_mg_2d.t.

◆ mg_child_rev

integer, dimension(4, 2), parameter, public m_octree_mg_2d::mg_child_rev = reshape([2,1,4,3,3,4,1,2], [4,2])

Definition at line 113 of file m_octree_mg_2d.t.

◆ mg_cylindrical

integer, parameter, public m_octree_mg_2d::mg_cylindrical = 2

Cylindrical coordinate system.

Definition at line 53 of file m_octree_mg_2d.t.

◆ mg_helmholtz

integer, parameter, public m_octree_mg_2d::mg_helmholtz = 3

Indicates a constant-coefficient Helmholtz equation.

Definition at line 42 of file m_octree_mg_2d.t.

◆ mg_iold

integer, parameter, public m_octree_mg_2d::mg_iold = 3

Index of previous solution (used for correction)

Definition at line 73 of file m_octree_mg_2d.t.

◆ mg_iphi

integer, parameter, public m_octree_mg_2d::mg_iphi = 1

Index of solution.

Definition at line 69 of file m_octree_mg_2d.t.

◆ mg_ires

integer, parameter, public m_octree_mg_2d::mg_ires = 4

Index of residual.

Definition at line 75 of file m_octree_mg_2d.t.

◆ mg_irhs

integer, parameter, public m_octree_mg_2d::mg_irhs = 2

Index of right-hand side.

Definition at line 71 of file m_octree_mg_2d.t.

◆ mg_iveps

integer, parameter, public m_octree_mg_2d::mg_iveps = 5

Index of the variable coefficient (at cell centers)

Definition at line 78 of file m_octree_mg_2d.t.

◆ mg_iveps1

integer, parameter, public m_octree_mg_2d::mg_iveps1 = 5

Indexes of anisotropic variable coefficients.

Definition at line 81 of file m_octree_mg_2d.t.

◆ mg_iveps2

integer, parameter, public m_octree_mg_2d::mg_iveps2 = 6

Definition at line 82 of file m_octree_mg_2d.t.

◆ mg_iveps3

integer, parameter, public m_octree_mg_2d::mg_iveps3 = 7

Definition at line 83 of file m_octree_mg_2d.t.

◆ mg_laplacian

integer, parameter, public m_octree_mg_2d::mg_laplacian = 1

Indicates a standard Laplacian.

Definition at line 36 of file m_octree_mg_2d.t.

◆ mg_lvl_hi

integer, parameter, public m_octree_mg_2d::mg_lvl_hi = 20

Maximum allowed grid level.

Definition at line 88 of file m_octree_mg_2d.t.

◆ mg_lvl_lo

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

Minimum allowed grid level.

Definition at line 86 of file m_octree_mg_2d.t.

◆ mg_max_num_vars

integer, parameter, public m_octree_mg_2d::mg_max_num_vars = 10

Maximum number of variables.

Definition at line 67 of file m_octree_mg_2d.t.

◆ mg_max_timers

integer, parameter, public m_octree_mg_2d::mg_max_timers = 20

Maximum number of timers to use.

Definition at line 105 of file m_octree_mg_2d.t.

◆ mg_ndim

integer, parameter, public m_octree_mg_2d::mg_ndim = 2

Problem dimension.

Definition at line 62 of file m_octree_mg_2d.t.

◆ mg_neighb_dim

integer, dimension(4), parameter, public m_octree_mg_2d::mg_neighb_dim = [1, 1, 2, 2]

Definition at line 137 of file m_octree_mg_2d.t.

◆ mg_neighb_dix

integer, dimension(2, 4), parameter, public m_octree_mg_2d::mg_neighb_dix = reshape([-1,0,1,0,0,-1,0,1], [2,4])

Definition at line 128 of file m_octree_mg_2d.t.

◆ mg_neighb_high_pm

integer, dimension(4), parameter, public m_octree_mg_2d::mg_neighb_high_pm = [-1, 1, -1, 1]

Definition at line 132 of file m_octree_mg_2d.t.

◆ mg_neighb_highx

integer, parameter, public m_octree_mg_2d::mg_neighb_highx = 2

Definition at line 123 of file m_octree_mg_2d.t.

◆ mg_neighb_highy

integer, parameter, public m_octree_mg_2d::mg_neighb_highy = 4

Definition at line 125 of file m_octree_mg_2d.t.

◆ mg_neighb_low

logical, dimension(4), parameter, public m_octree_mg_2d::mg_neighb_low = [.true., .false., .true., .false.]

Definition at line 130 of file m_octree_mg_2d.t.

◆ mg_neighb_lowx

integer, parameter, public m_octree_mg_2d::mg_neighb_lowx = 1

Definition at line 122 of file m_octree_mg_2d.t.

◆ mg_neighb_lowy

integer, parameter, public m_octree_mg_2d::mg_neighb_lowy = 3

Definition at line 124 of file m_octree_mg_2d.t.

◆ mg_neighb_rev

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

Definition at line 135 of file m_octree_mg_2d.t.

◆ mg_no_box

integer, parameter, public m_octree_mg_2d::mg_no_box = 0

Special value that indicates there is no box.

Definition at line 100 of file m_octree_mg_2d.t.

◆ mg_num_children

integer, parameter, public m_octree_mg_2d::mg_num_children = 4

Definition at line 108 of file m_octree_mg_2d.t.

◆ mg_num_neighbors

integer, parameter, public m_octree_mg_2d::mg_num_neighbors = 4

Definition at line 121 of file m_octree_mg_2d.t.

◆ mg_num_vars

integer, parameter, public m_octree_mg_2d::mg_num_vars = 4

Number of predefined multigrid variables.

Definition at line 65 of file m_octree_mg_2d.t.

◆ mg_physical_boundary

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

Special value that indicates there is a physical boundary.

Definition at line 102 of file m_octree_mg_2d.t.

◆ mg_smoother_gs

integer, parameter, public m_octree_mg_2d::mg_smoother_gs = 1

Definition at line 57 of file m_octree_mg_2d.t.

◆ mg_smoother_gsrb

integer, parameter, public m_octree_mg_2d::mg_smoother_gsrb = 2

Definition at line 58 of file m_octree_mg_2d.t.

◆ mg_smoother_jacobi

integer, parameter, public m_octree_mg_2d::mg_smoother_jacobi = 3

Definition at line 59 of file m_octree_mg_2d.t.

◆ mg_spherical

integer, parameter, public m_octree_mg_2d::mg_spherical = 3

Spherical coordinate system.

Definition at line 55 of file m_octree_mg_2d.t.

◆ mg_vhelmholtz

integer, parameter, public m_octree_mg_2d::mg_vhelmholtz = 4

Indicates a variable-coefficient Helmholtz equation.

Definition at line 45 of file m_octree_mg_2d.t.

◆ mg_vlaplacian

integer, parameter, public m_octree_mg_2d::mg_vlaplacian = 2

Indicates a variable-coefficient Laplacian.

Definition at line 39 of file m_octree_mg_2d.t.

◆ vhelmholtz_lambda

real(dp), public, protected m_octree_mg_2d::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 387 of file m_octree_mg_2d.t.