[petsc-users] using PCFieldSplitGetSubKSP in c++

Klaij, Christiaan C.Klaij at marin.nl
Tue Mar 13 07:32:43 CDT 2012


> > >Declare this as KSP *subksp;
> >
>
> Compare this ^^^^^^^^^^^
>
>
> > >
> > >   Matt
> > >
> >
> > Thanks Matt, but when I do that I cannot use KSPSetNullSpace:
> >
> >  KSP *subksp[2];
> >
>
> To this ^^^^^^^^^^

Matt, Jed

Thanks, I get the idea now and changed the code to:

  KSP *subksp;
  PetscInt n=2;
  ierr = PCFieldSplitGetSubKSP(pc,&n,&subksp); CHKERRQ(ierr);

which removes the compiler error but gives the following runtime
error in MatSchurComplementGetKSP():

[0]PETSC ERROR: --------------------- Error Message ------------------------------------
[0]PETSC ERROR: Null argument, when expecting valid pointer!
[0]PETSC ERROR: Null Object: Parameter # 1!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Development HG revision: 3e5cbcd09c0cdca7d193329b251809bec1adb9e3  HG Date: Tue Mar 06 22:49:22 2012 -0600
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: ./stokes on a linux_64b named lin0133 by cklaij Tue Mar 13 11:55:39 2012
[0]PETSC ERROR: Libraries linked from /home/CKlaij/ReFRESCO/Libraries/build/petsc-dev/linux_64bit_debug/lib
[0]PETSC ERROR: Configure run at Wed Mar  7 09:40:17 2012
[0]PETSC ERROR: Configure options --with-mpi-dir=/opt/refresco/64bit_intelv11.1_openmpi/openmpi-1.4.5 --with-clanguage=c++ --with-x=1 --with-debugging=1 --with-hypre-include=/opt/refresco/64bit_intelv11.1_openmpi/hypre-2.7.0b/include --with-hypre-lib=/opt/refresco/64bit_intelv11.1_openmpi/hypre-2.7.0b/lib/libHYPRE.a --with-ml-include=/opt/refresco/64bit_intelv11.1_openmpi/ml-6.2/include --with-ml-lib=/opt/refresco/64bit_intelv11.1_openmpi/ml-6.2/lib/libml.a --with-blas-lapack-dir=/opt/intel/mkl
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: MatSchurComplementGetKSP() line 218 in /home/CKlaij/ReFRESCO/Libraries/build/petsc-dev/src/ksp/ksp/utils/schurm.c
[0]PETSC ERROR: PCFieldSplitGetSubKSP_FieldSplit_Schur() line 957 in /home/CKlaij/ReFRESCO/Libraries/build/petsc-dev/src/ksp/pc/impls/fieldsplit/fieldsplit.c
[0]PETSC ERROR: PCFieldSplitGetSubKSP() line 1221 in /home/CKlaij/ReFRESCO/Libraries/build/petsc-dev/src/ksp/pc/impls/fieldsplit/fieldsplit.c
[0]PETSC ERROR: solve() line 101 in stokes.cc
[0]PETSC ERROR: main() line 581 in stokes.cc


dr. ir. Christiaan Klaij
CFD Researcher
Research & Development
E mailto:C.Klaij at marin.nl
T +31 317 49 33 44

MARIN
2, Haagsteeg, P.O. Box 28, 6700 AA Wageningen, The Netherlands
T +31 317 49 39 11, F +31 317 49 32 45, I www.marin.nl



More information about the petsc-users mailing list