Module to couple the octree-mg library to AMRVAC. This file uses the VACPP preprocessor, but its use is kept to a minimum.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(mg_t), | public | :: | mg |
Data structure containing the multigrid tree. |
|||
| procedure(after_new_tree), | public, | pointer | :: | mg_after_new_tree | => | null() |
If defined, this routine is called after a new multigrid tree is constructed. |
Set multigrid boundary conditions for the solution according to variable iw
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_t), | intent(inout) | :: | mg | |||
| integer, | intent(in) | :: | iw |
Copy a variable from the multigrid tree
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | iw_from |
Variable to use as right-hand side |
||
| integer, | intent(in) | :: | iw_to |
Copy to this variable |
||
| type(state), | intent(inout), | optional, | target | :: | state_to(max_blocks) |
If present, use this as the output state |
Copy from multigrid tree with one layer of ghost cells. Corner ghost cells are not used/set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | iw_from |
Variable to use as right-hand side |
||
| integer, | intent(in) | :: | iw_to |
Copy to this variable |
||
| type(state), | intent(inout), | optional, | target | :: | state_to(max_blocks) |
If present, use this as the output state |
Copy a variable to the multigrid tree, including a layer of ghost cells
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | iw_from |
Variable to use as right-hand side |
||
| integer, | intent(in) | :: | iw_to |
Copy to this variable |
||
| logical, | intent(in), | optional | :: | restrict |
Restrict variable on multigrid tree |
|
| logical, | intent(in), | optional | :: | restrict_gc |
Fill ghost cells after restrict |
|
| real(kind=dp), | intent(in), | optional | :: | factor |
out = factor * in |
|
| type(state), | intent(in), | optional, | target | :: | state_from(max_blocks) |
If present, use this as the input state |
Setup multigrid for usage
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.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_t), | intent(inout) | :: | mg |
If the grid has changed, rebuild the full multigrid tree
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n_coarsen | |||
| integer, | intent(in) | :: | n_refine |