Solver functions and classes. More...
Classes | |
class | Reconstruction |
To perform various reconstruction operations. More... | |
class | EigenProblemSolver |
Class to find eigenvalues and corresponding eigenvectors of a given matrix in a generalized eigenproblem, i.e. Find scalars l and non-null vectors v such that [K]{v} = l[M]{v} where [K] and [M] are symmetric matrices. The eigenproblem can be originated from a PDE. For this, we will refer to the matrices K and M as Stiffness and Mass matrices respectively. More... | |
class | FuncApprox |
To set function approximation methods. More... | |
class | GeoModel |
To set geometry modelling. More... | |
class | Integration |
Class for numerical integration methods. More... | |
class | Iter< T_ > |
Class to drive an iterative process. More... | |
class | LeastSquare |
To compute a least square approximation. More... | |
class | LinearSolver |
Class to solve systems of linear equations by direct or iterative methods. More... | |
class | LPSolver |
To solve a linear programming problem. More... | |
class | MyNLAS |
Abstract class to define by user specified function. More... | |
class | MyODE |
Abstract class to define by user specified (system of) ODE. More... | |
class | MyOpt |
Abstract class to define by user specified optimization function. More... | |
class | NLASSolver |
To solve a system of nonlinear algebraic equations of the form f(u) = 0. More... | |
class | ODESolver |
To solve a system of ordinary differential equations. More... | |
class | OptSolver |
To solve an optimization problem with bound constraints. More... | |
class | Prec< T_ > |
To set a preconditioner. More... | |
class | TimeStepping |
To solve time stepping problems, i.e. systems of linear ordinary differential equations of the form [A2]{y"} + [A1]{y'} + [A0]{y} = {b}. More... | |
Macros | |
#define | MAX_NB_INPUT_FIELDS 3 |
Maximum number of fields for an equation. More... | |
#define | MAX_NB_MESHES 10 |
Maximum number of meshes. More... | |
#define | TIME_LOOP(ts, t, ft, n) |
A macro to loop on time steps to integrate on time ts : Time step t : Initial time value updated at each time step ft : Final time value n : Time step index. | |
#define | TimeLoop |
A macro to loop on time steps to integrate on time. More... | |
#define | IterationLoop while (++theIteration<MaxNbIterations && Converged==false) |
A macro to loop on iterations for an iterative procedure. More... | |
Functions | |
ostream & | operator<< (ostream &s, const Muscl3DT &m) |
Output mesh data as calculated in class Muscl3DT. | |
template<class T_ > | |
int | BiCG (const SpMatrix< T_ > &A, const Prec< T_ > &P, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t &toler) |
Biconjugate gradient solver function. More... | |
template<class T_ > | |
int | BiCG (const SpMatrix< T_ > &A, int prec, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
Biconjugate gradient solver function. More... | |
template<class T_ > | |
int | BiCGStab (const SpMatrix< T_ > &A, const Prec< T_ > &P, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
Biconjugate gradient stabilized solver function. More... | |
template<class T_ > | |
int | BiCGStab (const SpMatrix< T_ > &A, int prec, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
Biconjugate gradient stabilized solver function. More... | |
template<class T_ > | |
int | CG (const SpMatrix< T_ > &A, const Prec< T_ > &P, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
Conjugate gradient solver function. More... | |
template<class T_ > | |
int | CG (const SpMatrix< T_ > &A, int prec, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
Conjugate gradient solver function. More... | |
template<class T_ > | |
int | CGS (const SpMatrix< T_ > &A, const Prec< T_ > &P, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
Conjugate Gradient Squared solver function. More... | |
template<class T_ > | |
int | CGS (const SpMatrix< T_ > &A, int prec, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
Conjugate Gradient Squared solver function. More... | |
ostream & | operator<< (ostream &s, const EigenProblemSolver &es) |
Output eigenproblem information. | |
template<class T_ > | |
int | GMRes (const SpMatrix< T_ > &A, const Prec< T_ > &P, const Vect< T_ > &b, Vect< T_ > &x, size_t m, int max_it, real_t toler) |
GMRes solver function. More... | |
template<class T_ > | |
int | GMRes (const SpMatrix< T_ > &A, int prec, const Vect< T_ > &b, Vect< T_ > &x, size_t m, int max_it, real_t toler) |
GMRes solver function. More... | |
template<class T_ > | |
int | GS (const SpMatrix< T_ > &A, const Vect< T_ > &b, Vect< T_ > &x, real_t omega, int max_it, real_t toler) |
Gauss-Seidel solver function. More... | |
template<class T_ > | |
int | Jacobi (const SpMatrix< T_ > &A, const Vect< T_ > &b, Vect< T_ > &x, real_t omega, int max_it, real_t toler) |
Jacobi solver function. More... | |
ostream & | operator<< (ostream &s, const LPSolver &os) |
Output solver information. | |
ostream & | operator<< (ostream &s, const NLASSolver &nl) |
Output nonlinear system information. | |
ostream & | operator<< (ostream &s, const ODESolver &de) |
Output differential system information. | |
ostream & | operator<< (ostream &s, const OptSolver &os) |
Output differential system information. | |
template<class T_ , class M_ > | |
int | Richardson (const M_ &A, const Vect< T_ > &b, Vect< T_ > &x, real_t omega, int max_it, real_t toler, int verbose) |
Richardson solver function. More... | |
template<class T_ > | |
void | Schur (SkMatrix< T_ > &A, SpMatrix< T_ > &U, SpMatrix< T_ > &L, SpMatrix< T_ > &D, Vect< T_ > &b, Vect< T_ > &c) |
Solve a linear system of equations with a 2x2-block matrix. More... | |
template<class T_ , class M_ > | |
int | SSOR (const M_ &A, const Vect< T_ > &b, Vect< T_ > &x, int max_it, real_t toler) |
SSOR solver function. More... | |
ostream & | operator<< (ostream &s, TimeStepping &ts) |
Output differential system information. More... | |
Solver functions and classes.
#define IterationLoop while (++theIteration<MaxNbIterations && Converged==false) |
A macro to loop on iterations for an iterative procedure.
It uses the following global variables defined in OFELI: theIteration, MaxNbIterations, Converged
theIteration
must be zeroed before using this macro #define MAX_NB_INPUT_FIELDS 3 |
Maximum number of fields for an equation.
Useful for coupled problems
#define MAX_NB_MESHES 10 |
Maximum number of meshes.
Useful for coupled problems
#define TimeLoop |
A macro to loop on time steps to integrate on time.
It uses the following global variables defined in OFELI: theStep, theTime, theTimeStep, theFinalTime
int BiCG | ( | const SpMatrix< T_ > & | A, |
const Prec< T_ > & | P, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t & | toler | ||
) |
Biconjugate gradient solver function.
This function uses the preconditioned Biconjugate Conjugate Gradient algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | P | Preconditioner (Instance of class Prec). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
toler | [in] Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int BiCG | ( | const SpMatrix< T_ > & | A, |
int | prec, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t | toler | ||
) |
Biconjugate gradient solver function.
This function uses the preconditioned Biconjugate Conjugate Gradient algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | prec | Enum variable selecting a preconditioner, among the values IDENT_PREC , DIAG_PREC , ILU_PREC or SSOR_PREC |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
toler | [in] Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int BiCGStab | ( | const SpMatrix< T_ > & | A, |
const Prec< T_ > & | P, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t | toler | ||
) |
Biconjugate gradient stabilized solver function.
This function uses the preconditioned Conjugate Gradient Stabilized algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | P | Preconditioner (Instance of class Prec). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess on input and solution of the linear system on output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int BiCGStab | ( | const SpMatrix< T_ > & | A, |
int | prec, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t | toler | ||
) |
Biconjugate gradient stabilized solver function.
This function uses the preconditioned Conjugate Gradient Stabilized algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | prec | Enum variable selecting a preconditioner, among the values IDENT_PREC , DIAG_PREC , ILU_PREC or SSOR_PREC |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int CG | ( | const SpMatrix< T_ > & | A, |
const Prec< T_ > & | P, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t | toler | ||
) |
Conjugate gradient solver function.
This function uses the preconditioned Conjugate Gradient algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | P | Preconditioner (Instance of class Prec). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int CG | ( | const SpMatrix< T_ > & | A, |
int | prec, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t | toler | ||
) |
Conjugate gradient solver function.
This function uses the preconditioned Conjugate Gradient algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of abstract class SpMatrix). |
[in] | prec | Enum variable selecting a preconditioner, among the values IDENT_PREC , DIAG_PREC , ILU_PREC or SSOR_PREC |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int CGS | ( | const SpMatrix< T_ > & | A, |
const Prec< T_ > & | P, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t | toler | ||
) |
Conjugate Gradient Squared solver function.
This function uses the preconditioned Conjugate Gradient Squared algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | P | Preconditioner (Instance of class Prec). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (real_t, float, complex<real_t>, ...) |
int CGS | ( | const SpMatrix< T_ > & | A, |
int | prec, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
int | max_it, | ||
real_t | toler | ||
) |
Conjugate Gradient Squared solver function.
This function uses the preconditioned Conjugate Gradient Squared algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | prec | Enum variable selecting a preconditioner, among the values IDENT_PREC , DIAG_PREC , ILU_PREC or SSOR_PREC |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (real_t, float, complex<real_t>, ...) |
int GMRes | ( | const SpMatrix< T_ > & | A, |
const Prec< T_ > & | P, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
size_t | m, | ||
int | max_it, | ||
real_t | toler | ||
) |
GMRes solver function.
This function uses the preconditioned GMRES algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | P | Preconditioner (Instance of class Prec). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | m | Number of subspaces to generate for iterations. |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int GMRes | ( | const SpMatrix< T_ > & | A, |
int | prec, | ||
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
size_t | m, | ||
int | max_it, | ||
real_t | toler | ||
) |
GMRes solver function.
This function uses the preconditioned GMRES algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | prec | Enum variable selecting a preconditioner, among the values IDENT_PREC , DIAG_PREC , ILU_PREC or SSOR_PREC |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | m | Number of subspaces to generate for iterations. |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (double, float, complex<double>, ...) |
int GS | ( | const SpMatrix< T_ > & | A, |
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
real_t | omega, | ||
int | max_it, | ||
real_t | toler | ||
) |
Gauss-Seidel solver function.
This function uses the relaxed Gauss-Seidel algorithm to solve a linear system with a sparse matrix.
The global variable Verbosity enables choosing output message level
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | omega | Relaxation parameter. |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (real_t, float, complex<real_t>, ...) |
int Jacobi | ( | const SpMatrix< T_ > & | A, |
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
real_t | omega, | ||
int | max_it, | ||
real_t | toler | ||
) |
Jacobi solver function.
[in] | A | Problem matrix (Instance of class SpMatrix). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | omega | Relaxation parameter. |
[in] | max_it | Maximum number of iterations. |
[in,out] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
<T_> | Data type (real_t, float, complex<real_t>, ...) |
<M_> | Matrix storage class |
ostream & operator<< | ( | ostream & | s, |
TimeStepping & | ts | ||
) |
Output differential system information.
int Richardson | ( | const M_ & | A, |
const Vect< T_ > & | b, | ||
Vect< T_ > & | x, | ||
real_t | omega, | ||
int | max_it, | ||
real_t | toler, | ||
int | verbose | ||
) |
Richardson solver function.
[in] | A | Problem matrix problem (Instance of abstract class M_). |
[in] | b | Right-hand side vector (class Vect) |
x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). | |
[in] | omega | Relaxation parameter. |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
[in] | verbose | Information output parameter (0 : No output, 1 : Output iteration information, 2 and greater: Output iteration information and solution at each iteration. |
<T_> | Data type (real_t, float, complex<real_t>, ...) |
<M_> | Matrix storage class |
void Schur | ( | SkMatrix< T_ > & | A, |
SpMatrix< T_ > & | U, | ||
SpMatrix< T_ > & | L, | ||
SpMatrix< T_ > & | D, | ||
Vect< T_ > & | b, | ||
Vect< T_ > & | c | ||
) |
Solve a linear system of equations with a 2x2-block matrix.
The linear system is of the form
| A U | |x| |b| | | | | = | | | L D | |y| |c|
[in] | A | Instance of class SkMatrix class for the first diagonal block. The matrix must be invertible and factorizable (Do not use SpMatrix class) where A , U , L , D are instances of matrix classes, |
[in] | U | Instance of class SpMatrix for the upper triangle block. The matrix can be rectangular |
[in] | L | Instance of class SpMatrix for the lower triangle block. The matrix can be rectangular |
[in] | D | Instance of class SpMatrix for the second diagonal block. The matrix must be factorizable (Do not use SpMatrix class) |
[in,out] | b | Vector (Instance of class Vect) that contains the first block of right-hand side on input and the first block of the solution on output. b must have the same size as the dimension of A . |
[in,out] | c | Vect instance that contains the second block of right-hand side on output and the first block of the solution on output. c must have the same size as the dimension of D . |
Template Argument:
<T_> | data type (real_t, float, ...) |
SSOR solver function.
[in] | A | Problem matrix (Instance of abstract class M_). |
[in] | b | Right-hand side vector (class Vect) |
[in,out] | x | Vect instance containing initial solution guess in input and solution of the linear system in output (If iterations have succeeded). |
[in] | max_it | Maximum number of iterations. |
[in] | toler | Tolerance for convergence (measured in relative weighted 2-Norm). |
Template Arguments: