That makes perfect sense.
Now if only Matt had told me that FieldSplit was scalable w.r.t. the number of fields..
Thank you very much anyway!

On Mon, 13 Feb 2017 16:19:01 +0000, Lawrence Mitchell wrote:
On 13 Feb 2017, at 15:46, Pierre Jolivet <[email protected]> wrote:

$ mpirun -np 4 ./a.out -f almost_full_jolivet -pc_type fieldsplit -pc_fieldsplit_type additive -fieldsplit_ksp_type preonly -fieldsplit_pc_type lu -fieldsplit_pc_factor_mat_solver_package mumps
It fails during setup:
[0]PETSC ERROR: Petsc has generated inconsistent data
[0]PETSC ERROR: Unhandled case, must have at least two fields, not 1

I would appreciate any feedback and/or fix for this.

You call:

  ierr = KSPCreate(PETSC_COMM_WORLD,&ksp);CHKERRQ(ierr);
  ierr = KSPSetOperators(ksp,A,A);CHKERRQ(ierr);
  PC pc;
  KSPGetPC(ksp, &pc);

  for(int j = 0; j < 2; ++j) {
    ...
    ierr = PCFieldSplitSetIS(pc, NULL, is[j]);CHKERRQ(ierr);
  }

  ierr = KSPSetFromOptions(ksp);CHKERRQ(ierr);

So the pc is not SetFromOptions at the time you call SetIS.
PCFieldSplitSetIS does nothing if the PC type is not of type
fieldsplit.

You need to call KSPSetFromOptions before the loop you have to set the ISes.

Lawrence

Reply via email to