FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
Solver configuration via PropertyMaps

The FEAT::Control::SolverFactory::create_scalar_solver method creates a FEAT::Solver::SolverBase object based on a given PropertyMap.

A solver configuration consists of 1+ sections, describing the solver tree. The tree's root section name is passed to the create_scalar_solver method. All other sections are optional and only required, if the root section references them, e.g. by precon or solver key statements.

Example:

[solver]
type = pcg
precon = jacobiprecon

[jacobiprecon]
type = jac

yields a classical pcg-jac setup with the solver tree root section 'solver' and an additional jacobi preconditioner section.

Note
The section names are user defined and must only match to the corresponding precon/solver key statements. The internal type identification relies only on the type key statement.
Warning
Do not create circles e.g. cg-richardson-cg, as they will crash your application.

The supported solver/precon types are (with a list of supported keys, in addition to the mandatory type key):

  • richardson (precon, max_iter, min_iter, tol_rel, plot_mode, omega)
  • pcg (precon, max_iter, min_iter, tol_rel, plot_mode)
  • bicgstab (precon, max_iter, min_iter, tol_rel, plot_mode)
  • fgmres (precon, max_iter, min_iter, tol_rel, plot_mode, krylov_dim)
  • pmr (precon, max_iter, min_iter, tol_rel, plot_mode)
  • pcr (precon, max_iter, min_iter, tol_rel, plot_mode)
  • psd (precon, max_iter, min_iter, tol_rel, plot_mode)
  • rgcr (precon, max_iter, min_iter, tol_rel, plot_mode)
  • mg (hierarchy, lvl_min, lvl_max, cycle)
  • scarcmg (hierarchy, lvl_min, lvl_max, cycle)
  • hierarchy (coarse, smoother)
  • ilu
  • spai
  • jac (omega)
  • sor (omega)
  • ssor (omega)
  • scale (omega)
  • polynomial (omega, m)
  • chebyshev (chebyshev, max_inter, min_iter, tol-rel, plot_mode)
  • schwarz (solver)

The supported keys semantics:

  • precon: Reference to another section, which shall be used as a preconditioner.
  • max_iter: The maximum amount of iterations for the given solver.
  • min_iter: The minimum amount of iterations for the given solver.
  • tol_rel: Relative convergence criterium.
  • plot_mode: none/summary/iter/all.
  • krylov_dim: Maximum krylov subspace dimension.
  • hierarchy: Reference to another section, which shall be used as the multigrid hierarchy
  • lvl_min: coarsest multigrid level (relative to the hierarchy)
  • lvl_max: finest multigrid level (-1 denotes maximum level in hierarchy)
  • cycle: multigrid cycle type: v, w, f
  • smoother: Reference to another section, which shall be used as the pre/post smoother.
  • coarse: Reference to another section, which shall be used as a coarse grid solver.
  • omega: Damping/Scaling multiplicator.
  • solver: Local solver section for the schwarz preconditioner.
  • memorytype: cuda / main memory
  • indextype: unsigned long / unsigned int
  • datatype: float / double

Advanced example:

[anothersolver]
{
type = fgmres
precon = mgv
krylov_dim = 5
max_iter = 1000
tol_rel = 1e-8
plot_mode = iter

  [mgv]
  type = mg
  hierarchy = h1
  cycle = v
  lvl_min = 0
  lvl_max = -1

  [h1]
  type = hierarchy
  smoother = rich
  coarse = pcg
}

[rich]
type = richardson
max_iter = 4
min_iter = 4
precon = jac

[jac]
type = jac
omega = 0.7

[pcg]
type = pcg
max_iter = 1000
tol_rel = 1e-8
precon = schwarz-ilu

[schwarz-ilu]
type = schwarz
solver = ilu0
memorytype = cuda

[ilu0]
type = ilu
memorytype = cuda
fill_in_param = 0

This creates a fgmres, preconditioned with one mg-v cycle. Each cycle uses 4 jac pre/post smoother steps and a coarse grid pcg solver with schwarz-ilu preconditioner on a cuda gpu.

Note
The referenced precon/solver sections may lie in the parent solver's section or in global scope.
The entry point solver must always be in main memory (due to MatrixStock limitations). If someone wants to execute a solver solely in cuda memory, on can use for example a 1,1 Richardson solver as a simple wrapper, only triggering main->cuda and vice versa conversion at start and end.
[entry-point-solver]
type = richardson
min_iter = 1
max_iter = 1
precon = cuda-only-solver

[cuda-only-solver]
type = imba_cuda_solver
memorytype = cuda
[...]