Matrix convergence - part 2

billy at dem.uminho.pt billy at dem.uminho.pt
Mon Oct 30 22:39:03 CST 2006


Hi,

When I use the option -sub_pc_type ilu or no option, I can't lower the residual
of the pressure which is derived from a Laplace equation to the specified
tolerance of 1E-8:   

Matrix p Number of iterations: 8 Residual: +3.971771E-01

On the other hand if I use option -sub_pc_type lu, I get:

Matrix p Number of iterations: 1 Residual: +6.174315E-24

Since this only happens in some cases, I would like to switch between ILU and LU
preconditioning.

I tried that by adding the following code:

  PCASMGetSubKSP(pc, &nlocal, &first, &subksp); 

  KSPGetPC(subksp, &subpc);

  PCSetType(subpc, SubPrecondProc);


Being SubPrecondProc = PCILU or SubPrecondProc = PCLU. However I get the
following error:

0]PETSC ERROR: PCASMGetSubKSP_ASM() line 488 in src/ksp/pc/impls/asm/asm.c
[0]PETSC ERROR: Operation done in wrong order!
[0]PETSC ERROR: Need to call PCSetUP() on PC (or KSPSetUp() on the outer KSP
object) before calling here!
[0]PETSC ERROR: PCASMGetSubKSP() line 786 in src/ksp/pc/impls/asm/asm.c
[0]PETSC ERROR: KSPGetPC() line 1135 in src/ksp/ksp/interface/itfunc.c
[0]PETSC ERROR: Corrupt argument: see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Corrupt!
[0]PETSC ERROR: Invalid Pointer to Object: Parameter # 1!
[0]PETSC ERROR: PCSetType() line 61 in src/ksp/pc/interface/pcset.c
[0]PETSC ERROR: Invalid argument!
[0]PETSC ERROR: Wrong type of object: Parameter # 1!

Matrix s Number of iterations: 0 Residual: +0.000000E+00
[0]PETSC ERROR: PCASMGetSubKSP_ASM() line 488 in src/ksp/pc/impls/asm/asm.c
[0]PETSC ERROR: Operation done in wrong order!
[0]PETSC ERROR: Need to call PCSetUP() on PC (or KSPSetUp() on the outer KSP
object) before calling here!
[0]PETSC ERROR: PCASMGetSubKSP() line 786 in src/ksp/pc/impls/asm/asm.c
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably
memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or try http://valgrind.org on linux to find memory corruption errors
[0]PETSC ERROR: likely location of problem given in stack below
[0]PETSC ERROR: --------------- Stack Frames ---------------
[0]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,
[0]PETSC ERROR:       INSTEAD the line number of the start of the function
[0]PETSC ERROR:       is given.
[0]PETSC ERROR: [0] KSPGetPC line 1134 src/ksp/ksp/interface/itfunc.c
[0]PETSC ERROR: [0] PCASMGetSubKSP_ASM line 486 src/ksp/pc/impls/asm/asm.c
[0]PETSC ERROR: [0] PCASMGetSubKSP line 782 src/ksp/pc/impls/asm/asm.c
[0]PETSC ERROR: --------------------------------------------
[0]PETSC ERROR: User provided function() line 0 in unknown directory unknown file
[0]PETSC ERROR: Signal received!
[0]PETSC ERROR:  !

Anyone knows why?

Thanks,  

Billy.





More information about the petsc-users mailing list