[petsc-users] fieldsplit: Unhandled case, must have at least two fields, not 1!

Nico Schlömer nico.schloemer at gmail.com
Fri Nov 29 10:43:12 CST 2013


Hm, I tried

================ *snip* ================
  IS is;
  ierr = ISCreateGeneral(PETSC_COMM_WORLD, u_indices.size(), u_indices.data(),
                         PETSC_USE_POINTER, &is);
  PCFieldSplitSetIS(pc, "u", is);
  IS p_is;
  ierr = ISCreateGeneral(PETSC_COMM_WORLD, p_indices.size(), p_indices.data(),
                         PETSC_USE_POINTER, &p_is);
  PCFieldSplitSetIS(pc, "p", p_is);
================ *snap* ================

now (where u_indices, p_indices are set to {0,1,3,4,6,7...},
{2,5,8,...}), but I'm still getting

================ *snip* ================
[0]PETSC ERROR: Petsc has generated inconsistent data!
[0]PETSC ERROR: Unhandled case, must have at least two fields, not 1!
================ *snap* ================

What would I have to look at to debug this?

--Nico

On Thu, Nov 28, 2013 at 5:53 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> Nico Schlömer <nico.schloemer at gmail.com> writes:
>
>> Hi Jed,
>>
>> thanks for the quick answer!
>> I can of course generate the strided index sets (01x34x6...,
>> xx2xx5x...) myself and insert them via PCFieldSplitSetIS(), but I
>> thought that ultimately does the same thing that I would have liked
>> PCFieldSplitSetFields() to do for me. Not true?
>
> PCFieldSplitSetFields is something you call only once to identify all
> the fields.  It doesn't let you group multiple strides in one, so you
> could create "ux", "uy", and "p", but then those would be separate.  You
> can create splits using numbers, -fieldsplit_block_size 3
> -fieldsplit_0_fields 0,1 -fieldsplit_1_fields 2 (assuming collocated
> discretization), but this can be rather opaque to maintain.


More information about the petsc-users mailing list