Documentation: Overview Solvers
Solving with Mumps
Installation
You can find installation information for Mumps
here.
Edit in Jamfile
If the library paths for Mumps package installation is in the standard paths /usr/lib, /usr/lib64, then you do
not need to edit anything in Jamfile.
If it is outside the standard paths /usr/lib, /usr/lib64, then in
$CONCEPTS_PATH/boost-build.jam
file, you need to add,
- MUMPS_PATH
- MUMPS_INCLPATH
- MUMPS_SUFFIX
Documentation
The documentation for the class
Mumps can be found
here.
Syntax
Considering,
A to be a system matrix,
rhs be a right hand side vector, and
sol be a solution vector.
The syntax to use
sequential version of Mumps:
For C++
concepts::Mumps<Real> solver(A)
concepts::Vector<Real> sol(spc)
solver(rhs, sol)
Note that, you have to add MPI_INIT, MPI_FINALIZE (see
parallelizationTutorial.cc) in your main program, if MPI is installed in your machine.
For Python
To use a MUMPS solver, first import MPI libary,
from mpi4py import MPI
then, use a
sequential version of Mumps linear solver in the following way:
solver = MUMPS_r(A = A)
sol = concepts.Vector_r(spc = space)
solver(fncY = rhs, fncX = sol)
Installation
You can find the installation information for
SuperLU library
here.
Documentation
The documentation for the class
SuperLU can be found
here.
Syntax
Considering,
A to be a system matrix,
rhs be a right hand side vector, and
sol be a solution vector.
For C++
concepts::SuperLU<Real> solver(A)
concepts::Vector<Real> sol(spc)
solver(rhs, sol)
For Python
solver = SuperLU _r(A = A)
sol = concepts.Vector_r(spc = space)
solver(fncY = rhs, fncX = sol)
Solving with Conjugate Gradient (CG) method
Documentation
The documentation for the class
CG can be found
here.
Syntax
Considering,
A to be a system matrix,
rhs be a right hand side vector, and
sol be a solution vector.
We use CG method with a tolerance of
1e-6
and a maximum number of iterations of
200
.
For C++
concepts::CG<Real> solver(A,1e-6, 200);
concepts::Vector<Real> sol(spc)
solver(rhs, sol)
For Python
solver = CG_r(A = A, maxeps=1e-6, maxit=200)
sol = concepts.Vector_r(spc = space)
solver(fncY = rhs, fncX = sol)
Other Solvers
Other solvers with similar syntax are:
For the complete list of available linear solvers, please see
here.