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

Module to couple the octree-mg library to AMRVAC. This file uses the VACPP preprocessor, but its use is kept to a minimum. More...

Data Types

interface  after_new_tree
 

Functions/Subroutines

subroutine mg_setup_multigrid ()
 Setup multigrid for usage. More...
 
subroutine mg_copy_boundary_conditions (mg, iw)
 Set multigrid boundary conditions for the solution according to variable iw. More...
 
subroutine mg_update_refinement (n_coarsen, n_refine)
 If the grid has changed, rebuild the full multigrid tree. More...
 
subroutine mg_copy_to_tree (iw_from, iw_to, restrict, restrict_gc, factor, state_from)
 Copy a variable to the multigrid tree, including a layer of ghost cells. More...
 
subroutine mg_copy_from_tree (iw_from, iw_to, state_to)
 Copy a variable from the multigrid tree. More...
 
subroutine mg_copy_from_tree_gc (iw_from, iw_to, state_to)
 Copy from multigrid tree with one layer of ghost cells. Corner ghost cells are not used/set. More...
 
subroutine mg_tree_from_amrvac (mg)
 Generate a multigrid tree that includes the amrvac tree, but also contains coarser grid levels. A number of checks has already been performed in mg_setup_multigrid, so we don't repeat these checks here. More...
 

Variables

type(mg_tmg
 Data structure containing the multigrid tree. More...
 
procedure(after_new_tree), pointer mg_after_new_tree => null()
 If defined, this routine is called after a new multigrid tree is constructed. More...
 

Detailed Description

Module to couple the octree-mg library to AMRVAC. This file uses the VACPP preprocessor, but its use is kept to a minimum.

Function/Subroutine Documentation

◆ mg_copy_boundary_conditions()

subroutine mod_multigrid_coupling::mg_copy_boundary_conditions ( type(mg_t), intent(inout)  mg,
integer, intent(in)  iw 
)

Set multigrid boundary conditions for the solution according to variable iw.

Definition at line 59 of file mod_multigrid_coupling.t.

◆ mg_copy_from_tree()

subroutine mod_multigrid_coupling::mg_copy_from_tree ( integer, intent(in)  iw_from,
integer, intent(in)  iw_to,
type(state), dimension(max_blocks), intent(inout), optional, target  state_to 
)

Copy a variable from the multigrid tree.

Parameters
[in]iw_fromVariable to use as right-hand side
[in]iw_toCopy to this variable
[in,out]state_toIf present, use this as the output state

Definition at line 153 of file mod_multigrid_coupling.t.

◆ mg_copy_from_tree_gc()

subroutine mod_multigrid_coupling::mg_copy_from_tree_gc ( integer, intent(in)  iw_from,
integer, intent(in)  iw_to,
type(state), dimension(max_blocks), intent(inout), optional, target  state_to 
)

Copy from multigrid tree with one layer of ghost cells. Corner ghost cells are not used/set.

Parameters
[in]iw_fromVariable to use as right-hand side
[in]iw_toCopy to this variable
[in,out]state_toIf present, use this as the output state

Definition at line 184 of file mod_multigrid_coupling.t.

◆ mg_copy_to_tree()

subroutine mod_multigrid_coupling::mg_copy_to_tree ( integer, intent(in)  iw_from,
integer, intent(in)  iw_to,
logical, intent(in), optional  restrict,
logical, intent(in), optional  restrict_gc,
real(dp), intent(in), optional  factor,
type(state), dimension(max_blocks), intent(in), optional, target  state_from 
)

Copy a variable to the multigrid tree, including a layer of ghost cells.

Parameters
[in]iw_fromVariable to use as right-hand side
[in]iw_toCopy to this variable
[in]restrictRestrict variable on multigrid tree
[in]restrict_gcFill ghost cells after restrict
[in]factorout = factor * in
[in]state_fromIf present, use this as the input state

Definition at line 103 of file mod_multigrid_coupling.t.

Here is the call graph for this function:

◆ mg_setup_multigrid()

subroutine mod_multigrid_coupling::mg_setup_multigrid

Setup multigrid for usage.

Definition at line 33 of file mod_multigrid_coupling.t.

Here is the call graph for this function:

◆ mg_tree_from_amrvac()

subroutine mod_multigrid_coupling::mg_tree_from_amrvac ( type(mg_t), intent(inout)  mg)

Generate a multigrid tree that includes the amrvac tree, but also contains coarser grid levels. A number of checks has already been performed in mg_setup_multigrid, so we don't repeat these checks here.

Definition at line 219 of file mod_multigrid_coupling.t.

Here is the call graph for this function:

◆ mg_update_refinement()

subroutine mod_multigrid_coupling::mg_update_refinement ( integer, intent(in)  n_coarsen,
integer, intent(in)  n_refine 
)

If the grid has changed, rebuild the full multigrid tree.

Definition at line 86 of file mod_multigrid_coupling.t.

Here is the call graph for this function:

Variable Documentation

◆ mg

type(mg_t) mod_multigrid_coupling::mg

Data structure containing the multigrid tree.

Definition at line 19 of file mod_multigrid_coupling.t.

◆ mg_after_new_tree

procedure(after_new_tree), pointer mod_multigrid_coupling::mg_after_new_tree => null()

If defined, this routine is called after a new multigrid tree is constructed.

Definition at line 23 of file mod_multigrid_coupling.t.