CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   are the cg or bicgstab method suitable for dense (http://www.cfd-online.com/Forums/main/15656-cg-bicgstab-method-suitable-dense.html)

 ztdep September 1, 2008 08:48

are the cg or bicgstab method suitable for dense

dear friends: are the cg or bicgstab method suitable for dense matrix.

 solver-issues September 1, 2008 21:25

Re: are the cg or bicgstab method suitable for den

i think you can use it there, but the problem would be of creating preconditioner.

 ztdep September 1, 2008 22:20

Re: are the cg or bicgstab method suitable for den

thank you very much for you answer, i want to use a simpel diagonal precontioner

 solver-issues September 1, 2008 22:35

Re: are the cg or bicgstab method suitable for den

diagonal preconditioner is not very good, you could use Gauss Seidel as preconditioner it would be much better.

 Ted September 2, 2008 00:57

Re: are the cg or bicgstab method suitable for den

no, iterative solver r not good selection.

note that theoritically a cg solver (for SPD matrix) can converge after n interation, and number of FLOPs within each iteration is porportional to number of non-zeros, in a dense matrix it is n^2 (is feasible for sparse solver)

so ur total FLOPs is ~ n^3

for a direct solver this factor is ~ n^3

as direct solver is more rubost, it is a more feasible selection.

e.g., LU decoposition

 Jed September 2, 2008 05:24

Re: are the cg or bicgstab method suitable for den

If your dense matrix is extremely well conditioned, then a Krylov method might be okay, otherwise a direct method is definitely the way to go.

May I ask *why* you have a dense matrix. Frequently there is a way to avoid it (and there must be if you want any sort of scalability).

 ztdep September 6, 2008 07:02

Re: are the cg or bicgstab method suitable for den

the dense matrix come from the DQ method. by the way, do you know where to download a free LU decomposition code regards

 Jed September 6, 2008 09:04

Re: are the cg or bicgstab method suitable for den

Do you want parallel? If so, use PETSc (or PLAPACK if you're sure that's all you need). Otherwise, what's wrong with Lapack?

I'm not familiar with DQ, but it looks like a pseudospectral method. It also looks like there are versions that produce sparse matrices. Does your matrix have tensor/Kronecker product structure? If so, you can apply the matrix using that structure and solve using a Krylov method. You'll need a preconditioner, but you can probably assemble one based on a low-order finite element/difference scheme so that it will be spectrally equivalent but very sparse.

For instance, I have a code that solves a global spectral inhomogeneous 3D Stokes problem with 3.5 million degrees of freedom in a few minutes on a single processor. If I formed the matrix, it would be dense so would require 100 TiB of memory, but I can apply it matrix-free for cheap and precondition with a very sparse matrix.

 Ted September 6, 2008 09:41

Re: are the cg or bicgstab method suitable for den

dense lu decompos is very simple, numerical recipe book include it, also you can see this:

http://www.cfd-online.com/Wiki/LU_decomposition http://en.wikipedia.org/wiki/LU_decomposition

if your matrix has some zero, you can explote its structure to improve performance, e.g. by reordering and using sparse direct solvers (e.g. UMFPACK or HSL sobroutines)

what is dimension of your matrix?

assuming n*n matrix, for n>10^4 direct solver is somehow impossible (memory CPU, memory scale by n^2 and CPU sclae by n^3)!

 All times are GMT -4. The time now is 02:24.