sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector > Class Template Reference

Linear system solver using Thomas Algorithm for Block Tridiagonal matrices. More...

#include <BTDLinearSolver.h>

Inheritance diagram for sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >:

Collaboration graph
[legend]

Public Types

typedef Matrix::SubMatrixType SubMatrix

Public Member Functions

 BTDLinearSolver ()
template<class T >
void invert (SubMatrix &Inv, const T &m)
 Factorize M.
void invert (Matrix &M)
void computeMinvBlock (int i, int j)
 [ inva0-l0(Minv10) Minv10t Minv20t Minv30t ] Minv = Uinv Linv = [ (Minv11)(-l0t) inva1-l1(Minv21) Minv21t Minv31t ] [ (Minv21)(-l0t) (Minv22)(-l1t) inva2-l2(Minv32) Minv32t ] [ (Minv31)(-l0t) (Minv32)(-l1t) (Minv33)(-l2t) inva3 ]
double getMinvElement (int i, int j)
void solve (Matrix &, Vector &x, Vector &b)
 Solve Mx=b.
template<class RMatrix , class JMatrix >
bool addJMInvJt (RMatrix &result, JMatrix &J, double fact)
bool addJMInvJt (defaulttype::BaseMatrix *result, defaulttype::BaseMatrix *J, double fact)
 Multiply the inverse of the system matrix by the transpose of the given matrix, and multiply the result with the given matrix J.

Data Fields

Data< bool > f_verbose
Data< bool > problem
helper::vector< SubMatrix > alpha_inv
helper::vector< SubMatrix > lambda
helper::vector< SubMatrix > B
Matrix::InvMatrixType Minv
helper::vector< int > nBlockComputedMinv
Vector Y
Data< int > f_blockSize

Detailed Description

template<class Matrix, class Vector>
class sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >

Linear system solver using Thomas Algorithm for Block Tridiagonal matrices.

References: Conte, S.D., and deBoor, C. (1972). Elementary Numerical Analysis. McGraw-Hill, New York http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm http://www.cfd-online.com/Wiki/Tridiagonal_matrix_algorithm_-_TDMA_(Thomas_algorithm) http://www4.ncsu.edu/eos/users/w/white/www/white/ma580/chap2.5.PDF

Definition at line 51 of file BTDLinearSolver.h.


Member Typedef Documentation

template<class Matrix , class Vector >
typedef Matrix::SubMatrixType sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::SubMatrix

Definition at line 57 of file BTDLinearSolver.h.


Constructor & Destructor Documentation

template<class Matrix , class Vector >
sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::BTDLinearSolver (  )  [inline]

Definition at line 69 of file BTDLinearSolver.h.


Member Function Documentation

template<class Matrix , class Vector >
bool sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::addJMInvJt ( defaulttype::BaseMatrix *  result,
defaulttype::BaseMatrix *  J,
double  fact 
) [inline, virtual]

Multiply the inverse of the system matrix by the transpose of the given matrix, and multiply the result with the given matrix J.

Parameters:
result the variable where the result will be added
J the matrix J to use
Returns:
false if the solver does not support this operation, of it the system matrix is not invertible

Reimplemented from sofa::core::componentmodel::behavior::LinearSolver.

Definition at line 383 of file BTDLinearSolver.h.

References sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::addJMInvJt().

template<class Matrix , class Vector >
template<class RMatrix , class JMatrix >
bool sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::addJMInvJt ( RMatrix &  result,
JMatrix &  J,
double  fact 
) [inline]

template<class Matrix , class Vector >
void sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::computeMinvBlock ( int  i,
int  j 
) [inline]

template<class Matrix , class Vector >
double sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::getMinvElement ( int  i,
int  j 
) [inline]

template<class Matrix , class Vector >
void sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::invert ( Matrix &  M  )  [inline, virtual]

template<class Matrix , class Vector >
template<class T >
void sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::invert ( SubMatrix &  Inv,
const T &  m 
) [inline]

Factorize M.

[ A0 C0 0 0 ] [ a0 0 0 0 ] [ I l0 0 0 ] M = [ B1 A1 C1 0 ] = L U = [ B1 a1 0 0 ] [ 0 I l1 0 ] [ 0 B2 A2 C2 ] [ 0 B2 a2 0 ] [ 0 0 I l2 ] [ 0 0 B3 A3 ] [ 0 0 B3 a3 ] [ 0 0 0 I ] [ a0 a0l0 0 0 ] M = [ B1 B1l0+a1 a1l1 0 ] [ 0 B2 B2l1+a2 a2l2 ] [ 0 0 B3 B3l2+a3 ] L X = [ a0X0 B1X0+a1X1 B2X1+a2X2 B3X2+a3X3 ] [ inva0 0 0 0 ] Linv = [ -inva1B1inva0 inva1 0 0 ] [ inva2B2inva1B1inva0 -inva2B2inva1 inva2 0 ] [ -inva3B3inva2B2inva1B1inva0 inva3B3inva2B2inva1 -inva3B3inva2 inva3 ] U X = [ X0+l0X1 X1+l1X2 X2+l2X3 X3 ] Uinv = [ I -l0 l0l1 -l0l1l2 ] [ 0 I -l1 l1l2 ] [ 0 0 I -l2 ] [ 0 0 0 I ]

[ (I+l0(I+l1(I+l2inva3B3)inva2B2)inva1B1)inva0 -l0(I+l1(I+l2inva3B3)inva2B2)inva1 l0l1(inva2+l2inva3B3inva2) -l0l1l2inva3 ] Minv = Uinv Linv = [ -((I+l1(I+l2inva3B3)inva2B2)inva1B1)inva0 (I+l1(I+l2inva3B3)inva2B2)inva1 -l1(inva2+l2inva3B3inva2) l1l2inva3 ] [ (((I+l2inva3B3)inva2B2)inva1B1)inva0 -((I+l2inva3B3)inva2B2)inva1 inva2+l2inva3B3inva2 -l2inva3 ] [ -inva3B3inva2B2inva1B1inva0 inva3B3inva2B2inva1 -inva3B3inva2 inva3 ]

[ inva0-l0(Minv10) (-l0)(Minv11) (-l0)(Minv12) (-l0)(Minv13) ] Minv = Uinv Linv = [ (Minv11)(-B1inva0) inva1-l1(Minv21) (-l1)(Minv22) (-l1)(Minv23) ] [ (Minv21)(-B1inva0) (Minv22)(-B2inva1) inva2-l2(Minv32) (-l2)(Minv33) ] [ (Minv31)(-B1inva0) (Minv32)(-B2inva1) (Minv33)(-B3inva2) inva3 ]

if M is symmetric (Ai = Ait and Bi+1 = C1t) : li = invai*Ci = (invai)t*(Bi+1)t = (B(i+1)invai)t

[ inva0-l0(Minv11)(-l0t) Minv10t Minv20t Minv30t ] Minv = Uinv Linv = [ (Minv11)(-l0t) inva1-l1(Minv22)(-l1t) Minv21t Minv31t ] [ (Minv21)(-l0t) (Minv22)(-l1t) inva2-l2(Minv33)(-l2t) Minv32t ] [ (Minv31)(-l0t) (Minv32)(-l1t) (Minv33)(-l2t) inva3 ]

Definition at line 116 of file BTDLinearSolver.h.

Referenced by sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::invert().

template<class Matrix , class Vector >
void sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::solve ( Matrix &  ,
Vector &  x,
Vector &  b 
) [inline, virtual]


Field Documentation

template<class Matrix , class Vector >
helper::vector<SubMatrix> sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::alpha_inv

template<class Matrix , class Vector >
helper::vector<SubMatrix> sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::B

template<class Matrix , class Vector >
Data<int> sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::f_blockSize

template<class Matrix , class Vector >
Data<bool> sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::f_verbose

template<class Matrix , class Vector >
helper::vector<SubMatrix> sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::lambda

template<class Matrix , class Vector >
Matrix::InvMatrixType sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::Minv

template<class Matrix , class Vector >
helper::vector<int> sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::nBlockComputedMinv

template<class Matrix , class Vector >
Data<bool> sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::problem

template<class Matrix , class Vector >
Vector sofa::component::linearsolver::BTDLinearSolver< Matrix, Vector >::Y

Definition at line 65 of file BTDLinearSolver.h.


The documentation for this class was generated from the following file:

Generated on Sun Nov 23 04:20:23 2008 for Sofa by  doxygen 1.5.7.1