Elmer FEM solver
Elmer is an open source finite element software for multiphysical problems
 All Classes Files Functions Variables Typedefs Macros Groups Pages
Multigrid.src File Reference

Data Types

module  multigrid
 

Functions/Subroutines

recursive function gmgsweep ()
 
integer function pmggetelementdofs (Indexes, UElement, USolver)
 
recursive function amgsweep ()
 
type(matrix_t) function, pointer interpolatef2cdistance (Fmat, CF, DOFs)
 
type(matrix_t) function, pointer complexinterpolatef2c (Fmat, CF)
 
subroutine amgtest (direction)
 
recursive function cmgsweep ()
 
subroutine projectmatrix (A, PermA, P, Q, B, PermB, DOFs)
 
real(kind=dp) function mgnorm (n, x)
 
subroutine mgmv (A, x, b, Update)
 
real(kind=dp) function mgcnorm (n, x)
 
subroutine mgcmv (A, x, b, Update)
 
recursive function pmgsweep ()
 
subroutine compatiblerelaxation (Amat, Solver, CF, CandList, nods, newcands)
 
subroutine choosecoarsenodes (Amat, Solver, Projector, Components, CF, InvCF)
 
subroutine amgbonds (Amat, Bonds, Cands, Components)
 
subroutine amgbondsdirichlet (Amat, Bonds, Cands)
 
subroutine amgbondsgeometric (Amat, Bonds, Cands, Components)
 
subroutine amgbondscomplex (Amat, Bonds, Cands)
 
subroutine amgpositivebonds (Amat, Bonds, Cands, CF)
 
subroutine amgcoarse (Amat, Cands, Bonds, CF, CompMat)
 
type(matrix_t) function, pointer interpolatef2c (Fmat, CF, DOFs)
 
subroutine cr_jacobi (A, x0, x1, f, Rounds)
 
subroutine cr_gs (A, x0, x1, f, Rounds)
 
subroutine cr_sgs (A, x0, x1, f, Rounds)
 
subroutine cr_csgs (n, A, rx0, rx1, f, Rounds)
 
subroutine crs_projectvector (PMatrix, u, v, DOFs, Trans)
 
subroutine crs_clusterproject (CF, u, v, DOFs, Trans)
 
subroutine crs_projectmatrixcreate (A, P, R, B, DOFs)
 
subroutine savematrix (A, FileName)
 
subroutine crs_clustermatrixcreate (A, CF, B, Components)
 
subroutine saveclusters ()
 

Function/Subroutine Documentation

subroutine amgsolve::amgbonds ( type(matrix_t), pointer  Amat,
logical, dimension(:), pointer  Bonds,
integer, dimension(:), pointer  Cands,
integer  Components 
)

Create the initial list for measure of importance and make the inverse table for important connections.

References messages::info(), lists::listgetconstreal(), lists::listgetinteger(), and lists::listgetlogical().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::amgbondscomplex ( type(matrix_t), pointer  Amat,
logical, dimension(:), pointer  Bonds,
integer, dimension(:), pointer  Cands 
)

Create the initial list for measure of importance for a complex matrix.

References messages::info(), lists::listgetconstreal(), and lists::listgetinteger().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::amgbondsdirichlet ( type(matrix_t), pointer  Amat,
logical, dimension(:), pointer  Bonds,
integer, dimension(:), pointer  Cands 
)

Mark the Dirichlet bonds in the AMG target matrix.

References messages::info(), and lists::listgetconstreal().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::amgbondsgeometric ( type(matrix_t), pointer  Amat,
logical, dimension(:), pointer  Bonds,
integer, dimension(:), pointer  Cands,
integer  Components 
)

Create the initial list for measure of importance using geometric distance information and topology information from the matrix..

References messages::info(), lists::listgetconstreal(), lists::listgetinteger(), and solver().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::amgcoarse ( type(matrix_t), pointer  Amat,
integer, dimension(:), pointer  Cands,
logical, dimension(:)  Bonds,
integer, dimension(:), pointer  CF,
logical  CompMat 
)

Creates a coarse mesh using the given list of strong connections. Only nodes assigned by the Cands vector may be included in the coarse set - others are ignored. The subroutine returns the vector CF which is nonzero for coarse nodes. The nodes are chosen using a heuristics which takes into account the strength of the coupling.

References messages::info(), and lists::listgetinteger().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::amgpositivebonds ( type(matrix_t), pointer  Amat,
logical, dimension(:), pointer  Bonds,
integer, dimension(:), pointer  Cands,
integer, dimension(:), pointer  CF 
)

Add a posteriori some nodes to be coarse nodes which have strong positive-positive connections.

References messages::info(), lists::listgetconstreal(), and lists::listgetlogical().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

recursive function amgsolve::amgsweep ( )

References crsmatrix::crs_complexmatrixvectormultiply(), crsmatrix::crs_matrixvectormultiply(), crs_projectvector(), lists::listgetintegerarray(), smoothers::mgsmooth(), multigrid::multigridsolve(), parallelutils::parallelmatrixvector(), parallelutils::parallelnorm(), and solver().

Referenced by multigrid::amgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::amgtest ( integer  direction)

This subroutine may be used to check that mapping Xf = P Xc is accurate. The list of original nodes for each level is stored in the Cnodes vector. For the momont this only works for cases with one DOF and no permutation!

References crs_projectvector(), messages::info(), lists::listgetinteger(), and solver().

Referenced by multigrid::amgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::choosecoarsenodes ( type(matrix_t), pointer  Amat,
type(solver_t), target  Solver,
type(matrix_t), pointer  Projector,
integer  Components,
integer, dimension(:), pointer  CF,
integer, dimension(:), optional, pointer  InvCF 
)

Create a coarse mesh given the fine mesh and the stiffness matrix. The coarse nodes may be selected in a number of ways and after the selection a new mesh is made of them. This mesh is then used to create a projection between the coarse and fine degrees of freedom.

References amgbonds(), amgbondscomplex(), amgbondsdirichlet(), amgbondsgeometric(), amgcoarse(), amgpositivebonds(), compatiblerelaxation(), complexinterpolatef2c(), messages::fatal(), messages::info(), interpolatef2c(), interpolatef2cdistance(), lists::listgetinteger(), lists::listgetlogical(), and solver().

Referenced by multigrid::amgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

recursive function cmgsolve::cmgsweep ( )

References crs_clusterproject(), crsmatrix::crs_complexmatrixvectormultiply(), crsmatrix::crs_matrixvectormultiply(), messages::info(), lists::listgetintegerarray(), smoothers::mgsmooth(), multigrid::multigridsolve(), parallelutils::parallelmatrixvector(), parallelutils::parallelnorm(), and solver().

Referenced by multigrid::cmgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::compatiblerelaxation ( type(matrix_t), pointer  Amat,
type(solver_t), target  Solver,
integer, dimension(:), pointer  CF,
integer, dimension(:), pointer  CandList,
integer  nods,
integer  newcands 
)

Apply compatible relaxation for the current C/F split and based on the convergence behavior include some of the F nodes to the new candidate list.

References cr_csgs(), cr_gs(), cr_jacobi(), cr_sgs(), messages::info(), lists::listgetconstreal(), lists::listgetinteger(), lists::listgetstring(), and messages::warn().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

type(matrix_t) function, pointer amgsolve::complexinterpolatef2c ( type(matrix_t), target  Fmat,
integer, dimension(:), pointer  CF 
)

As the previous one but expects complex valued equation. The projector is built using only the absolute values.

References generalutils::allocatematrix(), messages::fatal(), messages::info(), lists::listgetconstreal(), lists::listgetinteger(), and lists::listgetlogical().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::cr_csgs ( integer  n,
type(matrix_t), pointer  A,
real(kind=dp), dimension(:)  rx0,
real(kind=dp), dimension(:)  rx1,
integer, dimension(:)  f,
integer  Rounds 
)

References lists::listgetinteger().

Referenced by compatiblerelaxation().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::cr_gs ( type(matrix_t), pointer  A,
real(kind=dp), dimension(:)  x0,
real(kind=dp), dimension(:)  x1,
integer, dimension(:)  f,
integer  Rounds 
)

Referenced by compatiblerelaxation().

Here is the caller graph for this function:

subroutine amgsolve::cr_jacobi ( type(matrix_t), pointer  A,
real(kind=dp), dimension(:)  x0,
real(kind=dp), dimension(:)  x1,
integer, dimension(:)  f,
integer  Rounds 
)

The following subroutines are CR (Compatible Relaxation) versions of the simple relaxation schemes. The relaxation speed of equation Ax = 0 to x=0 may be used as a measure of the goodness of the chosen coarse node set.

Referenced by compatiblerelaxation().

Here is the caller graph for this function:

subroutine amgsolve::cr_sgs ( type(matrix_t), pointer  A,
real(kind=dp), dimension(:)  x0,
real(kind=dp), dimension(:)  x1,
integer, dimension(:)  f,
integer  Rounds 
)

Referenced by compatiblerelaxation().

Here is the caller graph for this function:

subroutine cmgsolve::crs_clustermatrixcreate ( type(matrix_t), pointer  A,
integer, dimension(:), pointer  CF,
type(matrix_t), pointer  B,
integer  Components 
)

Project cluster matrix A to B: B = PAR The projector is formed implicitely.

References generalutils::allocatematrix(), messages::info(), lists::listgetconstreal(), and lists::listgetlogical().

Referenced by multigrid::cmgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine crs_clusterproject ( integer, dimension(:), pointer  CF,
real(kind=dp), dimension(:), pointer  u,
real(kind=dp), dimension(:), pointer  v,
integer  DOFs,
logical, optional  Trans 
)

Project the residuals from coarse to fine and restrict from fine to coarse in the clustering multigrid method.

Referenced by cmgsweep().

Here is the caller graph for this function:

subroutine amgsolve::crs_projectmatrixcreate ( type(matrix_t), pointer  A,
type(matrix_t), pointer  P,
type(matrix_t), pointer  R,
type(matrix_t), pointer  B,
integer  DOFs 
)

Project matrix A to B: B = PAR.

References generalutils::allocatematrix(), messages::info(), and lists::listgetconstreal().

Referenced by multigrid::amgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::crs_projectvector ( type(matrix_t), pointer  PMatrix,
real(kind=dp), dimension(:), pointer  u,
real(kind=dp), dimension(:), pointer  v,
integer  DOFs,
logical, optional  Trans 
)

References messages::fatal().

Referenced by amgsweep(), and amgtest().

Here is the call graph for this function:

Here is the caller graph for this function:

recursive function gmgsolve::gmgsweep ( )

References crsmatrix::crs_applyprojector(), messages::info(), lists::listgetintegerarray(), smoothers::mgsmooth(), multigrid::multigridsolve(), and solver().

Referenced by multigrid::gmgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

type(matrix_t) function, pointer amgsolve::interpolatef2c ( type(matrix_t), target  Fmat,
integer, dimension(:), pointer  CF,
integer  DOFs 
)

make a matrix projection such that fine nodes are expressed with coarse nodes Xf = P Xc, with given set of coarse nodes, CF, and the stiffness matrix used in the projection.

References generalutils::allocatematrix(), messages::fatal(), messages::info(), lists::listgetconstreal(), lists::listgetinteger(), and lists::listgetlogical().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

type(matrix_t) function, pointer amgsolve::interpolatef2cdistance ( type(matrix_t), target  Fmat,
integer, dimension(:), pointer  CF,
integer  DOFs 
)

A pseudo geometric version of the previous Here the stregth of connections is assumed to be inversily proportional to the distance between nodes.

References generalutils::allocatematrix(), messages::info(), lists::listgetconstreal(), lists::listgetinteger(), lists::listgetlogical(), solver(), and generalutils::sortf().

Referenced by choosecoarsenodes().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine mgcmv ( type(matrix_t), pointer  A,
complex(kind=dp), dimension(:)  x,
complex(kind=dp), dimension(:)  b,
logical, optional  Update 
)

References crsmatrix::crs_complexmatrixvectormultiply().

Referenced by ccg(), and cjacobi().

Here is the call graph for this function:

Here is the caller graph for this function:

real(kind=dp) function gmgsolve::mgcnorm ( integer  n,
complex(kind=dp), dimension(:)  x 
)
subroutine mgmv ( type(matrix_t), pointer  A,
real(kind=dp), dimension(:)  x,
real(kind=dp), dimension(:)  b,
logical, optional  Update 
)

References crsmatrix::crs_matrixvectormultiply(), and parallelutils::parallelmatrixvector().

Referenced by multigrid::amgsolve(), bicg(), paralleleigensolve::bicgpareigen(), cg(), paralleleigensolve::cgpareigen(), multigrid::cmgsolve(), direct1dsmoother(), multigrid::gmgsolve(), jacobi(), paralleleigensolve::jacobi(), smoothers::mgsmooth(), paralleleigensolve::parallelarpackeigensolve(), multigrid::pmgsolve(), smoothedjacobi(), and uzawa().

Here is the call graph for this function:

Here is the caller graph for this function:

real(kind=dp) function gmgsolve::mgnorm ( integer  n,
real(kind=dp), dimension(:)  x 
)

References parallelutils::parallelnorm().

Referenced by multigrid::amgsolve(), paralleleigensolve::bicgpareigen(), paralleleigensolve::cgpareigen(), smoothers::mgsmooth(), and multigrid::pmgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

integer function pmgsolve::pmggetelementdofs ( integer, dimension(:)  Indexes,
type(element_t), optional, target  UElement,
type(solver_t), optional, target  USolver 
)

References pelementmaps::ispelement(), lists::listgetlogical(), and solver().

Referenced by multigrid::pmgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

recursive function pmgsolve::pmgsweep ( )

References crsmatrix::crs_matrixvectormultiply(), smoothers::mgsmooth(), multigrid::multigridsolve(), parallelutils::parallelmatrixvector(), parallelutils::parallelnorm(), and solver().

Referenced by multigrid::pmgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine gmgsolve::projectmatrix ( type(matrix_t), pointer  A,
integer, dimension(:), pointer  PermA,
type(matrix_t), pointer  P,
type(matrix_t), pointer  Q,
type(matrix_t), pointer  B,
integer, dimension(:), pointer  PermB,
integer  DOFs 
)

Project matrix A to B: B = PAQ^T.

The code is a little complicated by the fact that there might be three different numbering schemes for the DOFs: one for both matrices and the nodal numbering of the projectors.

Referenced by multigrid::gmgsolve().

Here is the caller graph for this function:

subroutine cmgsolve::saveclusters ( )

References messages::fatal(), lists::listgetinteger(), solver(), and lists::variableadd().

Referenced by multigrid::cmgsolve().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine amgsolve::savematrix ( type(matrix_t)  A,
character(len=*)  FileName 
)

Referenced by mainutils::addequationsolution(), multigrid::amgsolve(), multigrid::gmgsolve(), parallelutils::parallelmatrixvector(), multigrid::pmgsolve(), and sparitersolve::solve().

Here is the caller graph for this function: