petsc and diverge
hi,i have a problem in using petsc to compute 3D FEA.my linear systems always diverge when i use others solution methods except for lu.as you konw, there are many solution methods in petsc, such as bcgs,gmres,cg......,but they really don't adapt to my situation. And when using lu as pc or ksp, memory becomes the bottleneck. anybody can help me? thank you very much!

make sure that what you are solving has diagonal dominance in matrix.
it seems that your matrix does not have this property, LU methods are somewhat less sensitive to this issue. 
you mean to LU less sensitive to diagonal dominance in matrix? I cannot clearly understand your meaning. i cannot make sure my matrix is diagonal dominance, but i guess it is, beause FEM's matrix is general diagonal dominance.if diagonal dominance, whether or not the solution is easier? or reverse.

Quote:
the reason i said about diagonal dominance is because you said nothing else is working. If matrix is diagonally dominant, even a normal method like gauss siedel would show some convergence. (though it would be slow for large cases). 
thank you very much!
my work is about 3D dynamic FEA,and use PETSc to solve Ax=b.but now i find when i use direct method(namely LU),without sufficient memory.When I select iterative method, the result is always diverge,such as sor, cg, gmres etc..so i am confusing. 
is there any way for you to print the matrix and then check if ap > sum(ali).

Thank you!
I don't care if ap > sum(ali) and i also don't know what is ap or sum(ali)?But,i guess i can do it by matlab.But my current problem is how to solve the scalable sparse matrix?because direct method has not enough compute memory,iterative method can not converge(i tried many iterative methods of PETSc). whether or not you have some experiences in PETSc? Thank you again! 
Quote:
if you have written in little bit more detail about equations you are solving it might be possible to something. 
Thanks a lot! I will try lsqr tomorrow! Before, I learned bicgstab or GMRES is a better iterative method for asymmetric matrix,but they were useless to my matrix. CG or PCG is very good for symmetric positive definite matrix, however, my matrix is symmetric and indefinite.Today, to my surprised, I found each diagonal entity of my matrix approximately equals to absolute value of sum of each row all entities. The determinant is infinite, and condition also is very great.Now, I think the best method is find for a preconditioner.Do you think? thank you very much!thank your help. you are welcome if you need more matrix information!

lsqr is very slower, iteration is up to 70000.

this is why use it only if you wish to solve it once. it you have to solve it again and again.

can you speak chinese?

Quote:
i can not speak chinise, though after few years when i am proficient in japanese i have desire to learn it. 
Preconditioners for indefinite problems
Quote:
Code:
ksp_gmres_restart 300 Since your matrix is indefinite, it's quite likely that no blackbox preconditioner will work well. One method that is fairly reliable if your matrix isn't terribly conditioned is sparse approximate inverse. You can select this with Code:
pc_type hypre pc_hypre_type parasails Code:
pc_type spai Another poorman's solution is to use a Schwarz preconditioner with exact (LU) solves in each subdomain. The theory doesn't guarantee that this will converge, but in practice it often works, although usually with suboptimal convergence rates. Use Code:
pc_type asm sub_pc_type lu Code:
pc_asm_blocks Code:
sub_pc_factor_mat_solver_package mumps Code:
sub_pc_factor_mat_solver_package umfpack A good general reference for indefinite problems is Code:
@article{benzi2005nss, Code:
@article{elman2008tcp, 
PETSc mailing list
Also, the PETSc mailing list http://lists.mcs.anl.gov/pipermail/petscusers/ is a very good place to ask questions like this. Provide as much detail as possible and exact error messages.

Thank you very much!
GMRES and other iterative methods all cann't obtain convergence to my problem, unless select lu as a pc or only use lu as a ksp,however, memory becomes new bottleneck again. PETSc team recommends MUMPS,but I find MUMPS cannot be compatible with fortran 77. My program need compute eigenvalues, so I utilize arpack package and it is only compatible with fortran 77. I also want to use hypre,but I don't know how to use? Whether or not after I install hypre, I can utilize hypre by pc_type hypre pc_hypre_type parasails at once or I need modify my program yet? I am short of relevant informations and experiences.Can you help me? My program is about vibration analysis of anisotropic material.I compute eigenvalue by arpack package.But in arpack, I need utilize own program to compute Ax=b,so I select PETSc package to do it.After several attempts, I only find, if convergence, ksp or pc must include lu. 
Quote:
After building PETSc with Hypre, you can control it on the command line; no code modification is necessary. Run with help to see what options are available with the current solver combination (piping through grep is helpful). A more flexible and scalable eigensolver is SLEPc. It uses PETSc data structures and brings the same flexibility to eigenproblems. It provides a uniform interface to several thirdparty solvers including ARPACK. 
All times are GMT 4. The time now is 12:30. 