This forum has been archived. All content is frozen. Please use KDE Discuss instead.

BiCGSTAB to solve spare linear system

Tags: None
(comma "," separated)
chaoquan
Registered Member
Posts
1
Karma
0
hello, i am trying finite element method to solve a Partial differential equation. The stiffness matrix is sparse and asymmetric,

so i decided use BiCGSTAB to solve the linear systems. But i get some problem is that

Eigen::BiCGSTAB < SparseMatrix<double>> BCGST;
BCGST.compute(stf);
VectorXd coef1;
coef1 = BCGST.solveWithGuess(bmatrix,coef);
cout << "#iterations: " << BCGST.iterations() << std::endl;
cout << "estimated error: " << BCGST.error() << std::endl;

the stf and bmatrix has already been valued, the output is quite strange:
#iterations: 1
estimated error: -1.#IND
x(1,:)=[-1.78262,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,1.78262,];
y(1,:)=[0,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,-1.#IND,0,];
area=[-1.#IND, ];
tao=[0, ];
length=[-1.#IND ,];
energy=[-1.#IND , ];
so what can i do?
I have try different preconditioners, but still failed. Maybe i should just use SparseLU to solve it.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Make sure you are using the uptodate devel branch or Eigen 3.2.4. And yes, please try SparseLU too. If SparseLU works but BiCGSTAB still gives you ****, then send us the matrix and the right hand side.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]