Resolution of linear systems

The resolution of linear systems can be performed by a direct solver or an iterative solver with different preconditionings. The direct and iterative solvers are provided by Seldon. All direct solvers are regrouped in the class All_MatrixLU. By using this class, you can select the solver you prefer. Similarly, all the iterative solvers are regrouped in class All_IterativeSolver, which uses as preconditioning the class All_Preconditioner which regroups all the preconditionings used. The class All_Preconditioner can be overloaded if you wish to add an external preconditioner without modifying Montjoie. The following preconditioners are implemented in Montjoie

The class All_LinearSolver regroups iterative and direct solvers and can be used as follows :

// construction of EllipticProblem class
EllipticProblem<TypeElement, TypeEquation> var;
ReadInputFile(input_file, var);
// ...

// then you can declare a solver relying on the considered problem
All_LinearSolver<TypeElement, TypeEquation> glob_solver(var);
// you can read parameters of the data file :
ReadInputFile(input_file, glob_solver);

// you can select the solver, for example a direct solver
glob_solver.SetDirectSolver();

// when you call PerformFactorizationStep, the matrix is computed, and
// factorized if a direct solver has been selected, otherwise the preconditioning
// is computed
typename TypeEquation::Nature_Matrix nat_mat;
glob_solver.PerformFactorizationStep(nat_mat, true);

// then you can compute the solution for each right hand side needed
Vector<Complexe> x(N), b(N);
// resolution of A x = b
glob_solver.Computation(b, x, nat_mat);

Methods of All_MatrixLU

SetPrintLevel sets level of verbosity of the solver
Factorize factorization of a sparse matrix
Solve resolution of a linear system by using its LU factorisation
TransSolve resolution of a transpose linear system by using its LU factorisation
GetSchurComplement computation of the Schur complement of a matrix from its LU factorisation
SelectOptimalDirectSolver selects best direct solver
SelectDirectSolver selects direct solver from a line of the data file
GetMaximumSize returns maximum size for an efficient resolution with a direct solver
SolveDistributed resolution of a linear system by using its LU factorisation (parallel)
TransSolveDistributed resolution of a transpose linear system by using its LU factorisation (parallel)

Public attributes and methods of All_IterativeSolver

type_preconditioner type of preconditioning used
precond preconditioning used
SetPrintLevel sets level of verbosity of the solver
SetPrintLevel sets level of verbosity of the solver
GetPrintLevel returns level of verbosity of the solver
SelectIterativeSolver selects which iterative solver to use
SetMaxNumberIteration sets the maximum number of iterations allowed for the iterative resolution
SetRestart sets the restart parameter (for Gmres, Gcr, etc)
SetStoppingCriterion sets the stopping criterion used by iterative solver
GetStoppingCriterion returns the stopping criterion used by iterative solver
GetM returns the number of rows of the linear system
Solve solves the linear system iteratively
SelectOptimalIterativeSolver selects the best iterative solver for a given linear system

Public attributes and methods of All_LinearSolver

var_deriv considered problem
mat_direct finite element matrix used for the direct solver
mat_iterative finite element matrix used for the iterative solver
mat_lu direct solver
iterative_solver iterative solver
static_condensation if true, internal dofs are eliminated to reduce memory used by the direct solver
scaling_matrix if true, the linear system is scaled to reduce its condition number
GetTypeSolver returns the type of solver
IsIterativeSolver returns true if the used solver is iterative
SetDirectSolver direct solver will be used
SetIterativeSolver iterative solver will be used
SelectOptimalLinearSolver selects the best solver to use
SetPrintLevel sets the level of verbosity
ComputeMatrixAndFactorize computes finite element matrix and its factorisation
ComputeMatrixAndPreconditioning computes finite element matrix and its preconditioning
PerformFactorizationStep computes finite element matrix and its factorisation (or preconditioning for iterative resolution)
ComputeSolution computes the solution of the linear system associated with the finite element matrix

Functions related to resolution of systems

Solve computes the solution of a non-linear system of equations by using MinPack