On Tue, 26 Sep 2006, Randall Mackie wrote:
> Barry, > > Okay, I assume this means it will be done at some point in the near future? > > I tried taking the transpose in my code, and then using KSPSolve, but then > I was getting error messages about zero pivots. I then added > -pc_shift_positive_definite and it ran, but it didn't seem to do any better > than KSPSolveTranspose, although I haven't been able to spend a lot of time > on that. > > I'll just add another KSP in my code, one to use the fieldsplit PC for > the first problem, and then another one to just use ILU for the transpose > problem, at least until you get the patch for fieldsplit PC. To use it you'll have to use the development copy of PETSc http://www-unix.mcs.anl.gov/petsc/petsc-as/developers/index.html or wait for our next release which is a few months away. Sorry, Barry In general there is nothing that says if B is a good preconditioner for A that B' is a good preconditioner for A', though usually you would think it would be. > > Thanks, Randy > > > Barry Smith wrote: > > > > On Tue, 26 Sep 2006, Randall Mackie wrote: > > > > > When I try to use KSPSolveTranspose with PCFieldSplit, I get the following > > > errors: > > > > > > [0]PETSC ERROR: PCApplyTranspose() line 483 in > > > src/ksp/pc/interface/precon.c > > > [0]PETSC ERROR: No support for this operation for this object type! > > > [0]PETSC ERROR: ! > > > [0]PETSC ERROR: KSPInitialResidual() line 56 in > > > src/ksp/ksp/interface/itres.c > > > [0]PETSC ERROR: KSPSolve_BCGS() line 41 in src/ksp/ksp/impls/bcgs/bcgs.c > > > [0]PETSC ERROR: KSPSolveTranspose() line 562 in > > > src/ksp/ksp/interface/itfunc.c > > > > > > > This is just "lazyness", I hadn't implemented the apply transpose. I've > > added it now to PETSc-dev; the problem is it cannot be made into an > > easy patch since it involves several nontrivial changes. > > > > > > > So then I thought in my code I would just take the transpose of A and call > > > KSPSolve, but then I get the following errors: > > > > > > [0]PETSC ERROR: MatGetSubMatrix_SeqAIJ() line 1686 in > > > src/mat/impls/aij/seq/aij.c > > > [0]PETSC ERROR: Nonconforming object sizes! > > > [0]PETSC ERROR: Cannot reuse matrix. wrong no of nonzeros! > > > [0]PETSC ERROR: MatGetSubMatrices_SeqAIJ() line 1799 in > > > src/mat/impls/aij/seq/aij.c > > > [0]PETSC ERROR: MatGetSubMatrices() line 4828 in > > > src/mat/interface/matrix.c > > > [0]PETSC ERROR: MatGetSubMatrix() line 5438 in src/mat/interface/matrix.c > > > [0]PETSC ERROR: PCSetUp_FieldSplit() line 162 in > > > src/ksp/pc/impls/fieldsplit/fieldsplit.c > > > [0]PETSC ERROR: PCSetUp() line 798 in src/ksp/pc/interface/precon.c > > > [0]PETSC ERROR: KSPSetUp() line 234 in src/ksp/ksp/interface/itfunc.c > > > [0]PETSC ERROR: KSPSolve() line 334 in src/ksp/ksp/interface/itfunc.c > > > > > > > > I'm guessing you used MAT_SAME_NONZERO_PATTERN? But the transpose won't > > have the same nonzero pattern? > > > > BTW: Did you find explicitly forming the transposes and solving worked > > better > > than just using KSPSolveTranspose()? > > > > Barry > > > > > Is there some reason why the PCFIeildSplit is not compatible with > > > KSPSolveTranspose? > > > > > > I'm solving with the following options: > > > > > > > > > -em_ksp_truemonitor \ > > > -em_ksp_type bcgs \ > > > -em_pc_type fieldsplit \ > > > -em_pc_fieldsplit_default \ > > > -em_pc_fieldsplit_type multiplicative \ > > > -em_fieldsplit_pc_type bjacobi \ > > > -em_fieldsplit_sub_pc_type ilu \ > > > -em_fieldsplit_sub_pc_factor_levels 4 \ > > > -em_fieldsplit_sub_pc_factor_fill 10 \ > > > > > > Randy > > > > > > > > > >
