Neko 1.99.1
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
tree_amg_multigrid Module Reference

Implements multigrid using the TreeAMG hierarchy structure. USE: More...

Data Types

type  tamg_solver_t
 Type for the TreeAMG solver. More...
 
type  tamg_wrk_t
 

Functions/Subroutines

subroutine tamg_mg_init (this, ax, xh, coef, msh, gs_h, nlvls, blst, max_iter, cheby_degree)
 Initialization of the TreeAMG multigrid solver.
 
subroutine tamg_mg_solve (this, z, r, n)
 Solver function for the TreeAMG solver object.
 
recursive subroutine tamg_mg_cycle (x, b, n, lvl, amg, mgstuff, zero_initial_guess)
 Recrsive multigrid cycle for the TreeAMG solver object.
 
recursive subroutine tamg_mg_cycle_d (x, b, x_d, b_d, n, lvl, amg, mgstuff, zero_initial_guess)
 Recrsive multigrid cycle for the TreeAMG solver object on device.
 
subroutine calc_resid (r, x, b, amg, lvl, n)
 Wrapper function to calculate residyal.
 
subroutine print_preagg_info (lvl, nagg)
 
subroutine print_resid_info (r, x, b, r_d, x_d, b_d, amg, lvl, n)
 
subroutine fill_lvl_map (amg)
 

Detailed Description

type(tamg_hierarchy_t) :: amg type(tamg_solver_t) :: amg_solver

call amginit(ax, Xh, coef, msh, gs_h, 3) call amg_solverinit(amg, niter)

call amg_solversolve(xx, f, n)

Function/Subroutine Documentation

◆ calc_resid()

subroutine tree_amg_multigrid::calc_resid ( real(kind=rp), dimension(n), intent(inout r,
real(kind=rp), dimension(n), intent(inout x,
real(kind=rp), dimension(n), intent(inout b,
type(tamg_hierarchy_t), intent(inout amg,
integer, intent(in lvl,
integer, intent(in n 
)
private
Parameters
rThe residual to be returned
xThe current solution
bThe right-hand side
amgThe TreeAMG object
lvlCurrent level of the cycle
nNumber of dofs

Definition at line 362 of file tree_amg_multigrid.f90.

Here is the caller graph for this function:

◆ fill_lvl_map()

subroutine tree_amg_multigrid::fill_lvl_map ( type(tamg_hierarchy_t), intent(inout amg)
private

Definition at line 406 of file tree_amg_multigrid.f90.

Here is the caller graph for this function:

◆ print_preagg_info()

subroutine tree_amg_multigrid::print_preagg_info ( integer, intent(in lvl,
integer, intent(in nagg 
)
private

Definition at line 375 of file tree_amg_multigrid.f90.

Here is the caller graph for this function:

◆ print_resid_info()

subroutine tree_amg_multigrid::print_resid_info ( real(kind=rp), dimension(n), intent(inout r,
real(kind=rp), dimension(n), intent(inout x,
real(kind=rp), dimension(n), intent(inout b,
type(c_ptr)  r_d,
type(c_ptr)  x_d,
type(c_ptr)  b_d,
type(tamg_hierarchy_t), intent(inout amg,
integer, intent(in lvl,
integer, intent(in n 
)
private

Definition at line 386 of file tree_amg_multigrid.f90.

◆ tamg_mg_cycle()

recursive subroutine tree_amg_multigrid::tamg_mg_cycle ( real(kind=rp), dimension(n), intent(inout x,
real(kind=rp), dimension(n), intent(inout b,
integer, intent(in n,
integer, intent(in lvl,
type(tamg_hierarchy_t), intent(inout amg,
type(tamg_solver_t), intent(inout mgstuff,
logical, intent(in zero_initial_guess 
)
private
Parameters
xThe solution to be returned
bThe right-hand side
nNumber of dofs
lvlCurrent level of the cycle
amgThe TreeAMG object
mgstuffThe Solver object. TODO: rename this

-------—<! SMOOTH <! -------—<!

Is coarsest grid.

-------—<! Residual <! -------—<!

-------—<! Restrict <! -------—<!

----------------—<! Call Coarse solve <! ----------------—<!

-------—<! Project <! -------—<!

-------—<! Correct <! -------—<!

-------—<! SMOOTH <! -------—<!

Definition at line 239 of file tree_amg_multigrid.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tamg_mg_cycle_d()

recursive subroutine tree_amg_multigrid::tamg_mg_cycle_d ( real(kind=rp), dimension(n), intent(inout x,
real(kind=rp), dimension(n), intent(inout b,
type(c_ptr)  x_d,
type(c_ptr)  b_d,
integer, intent(in n,
integer, intent(in lvl,
type(tamg_hierarchy_t), intent(inout amg,
type(tamg_solver_t), intent(inout mgstuff,
logical, intent(in zero_initial_guess 
)
private
Parameters
xThe solution to be returned
bThe right-hand side
nNumber of dofs
lvlCurrent level of the cycle
amgThe TreeAMG object
mgstuffThe Solver object. TODO: rename this

-------—<! SMOOTH <! -------—<!

Is coarsest grid.

-------—<! Residual <! -------—<!

-------—<! Restrict <! -------—<!

----------------—<! Call Coarse solve <! ----------------—<!

-------—<! Project <! -------—<!

-------—<! Correct <! -------—<!

-------—<! SMOOTH <! -------—<!

Definition at line 298 of file tree_amg_multigrid.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tamg_mg_init()

subroutine tree_amg_multigrid::tamg_mg_init ( class(tamg_solver_t), intent(inout), target  this,
class(ax_t), intent(in), target  ax,
type(space_t), intent(in), target  xh,
type(coef_t), intent(in), target  coef,
type(mesh_t), intent(in), target  msh,
type(gs_t), intent(in), target  gs_h,
integer, intent(in nlvls,
type(bc_list_t), intent(in), target  blst,
integer, intent(in max_iter,
integer, intent(in cheby_degree 
)
Parameters
axFinest level matvec operator
XhFinest level field
coefFinest level coeff thing
mshFinest level mesh information
gs_hFinest level gather scatter operator
nlvlsNumber of levels for the TreeAMG hierarchy
blstFinest level BC list
max_iterNumber of AMG iterations

Create level 1 (neko elements are level 0)

Create the remaining levels

Create the end point

Allocate work space on each level

Definition at line 102 of file tree_amg_multigrid.f90.

Here is the call graph for this function:

◆ tamg_mg_solve()

subroutine tree_amg_multigrid::tamg_mg_solve ( class(tamg_solver_t), intent(inout this,
real(kind=rp), dimension(n), intent(inout z,
real(kind=rp), dimension(n), intent(inout r,
integer, intent(in n 
)
private
Parameters
zThe solution to be returned
rThe right-hand side
nNumber of dofs

Definition at line 194 of file tree_amg_multigrid.f90.

Here is the call graph for this function: