On Tue, Feb 16, 2016 at 12:18 PM, Harshad Sahasrabudhe <hsaha...@purdue.edu> wrote:
> Hi David, > > >> One interesting thing that I didn't realize for a long time is that PETSc >> condenses the sparsity pattern when you call matrix->close(), i.e.: >> >> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatAssemblyBegin.html >> "Space for preallocated nonzeros that is not filled by a call to >> MatSetValues() or a related routine are compressed out by assembly. If you >> intend to use that extra space on a subsequent assembly, be sure to insert >> explicit zeros before MAT_FINAL_ASSEMBLY so the space is not compressed >> out." >> So in this case, if you're using PETSc/SLEPc, then B will be diagonal >> after the matrix is "closed". >> > > Interesting! Thanks for the info. At the moment, I'm adding a dense matrix > of the phi overlaps to B for each element. So this will be basically > placing off-diagonal zeros in the B PETSc matrix. I just need to add the > diagonals to make the sparsity pattern diagonal during assembly. > Yeah, you'd have to change the matrix assembly so that you don't add off-diagonal zeros. Regarding this: >> Use preconditioners which scale well, like AMG, if they make sense for > your problem. > I can try using different preconditioners. How do I set the preconditioner > for the eigensolver? I suggest you consult the SLEPc manual, and ask on the PETSc mailing list if needed. As you can see from the SLEPc manual, you normally don't need to worry about preconditioning since Krylov methods are already optimal if you're looking for an extreme eigenvalue. However, if you're doing a spectral transformation (e.g. Shift-and-invert) then SLEPc has to do some linear solves under the hood, and that's one case where it makes sense to use preconditioners. The simplest thing to do in my experience is to use MUMPS via "-st_ksp_type preonly -st_pc_type lu -st_pc_factor_mat_solver_package mumps" This is discussed in Section 3.4.1 of the manual, and note that it also says "Instead of a direct linear solver, it is possible to use an iterative solver. This may be necessary in some cases, specially for very large problems. However, the user is warned that using an iterative linear solver makes the overall solution process less robust" Anyway, my advice, as mentioned above, is: - consult the SLEPc manual, there's tons of good info in there - ask on the PETSc list, if needed David ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users