<div dir="ltr">Matt, Matt, Matt,<div><br></div><div>Sanjay, (1) is the only sane option. Here is an example taken from a code that I work with.</div><div><br></div><div>This simply has 3 fields with 12 ("<span style="color:rgb(0,0,0);font-family:Menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">stride</span>", not a great name, should be "bs") dofs on each vertex in each field (2D Bell + 1D cubic Hermite).</div>This uses ISCreateBlock, which you might want to use for dof (1,2) in your case. It lets, with stride = 2, input IS = [1,3] create an IS with [2,3,6,7] semantically.<div><br><div>Thanks,</div><div>Mark</div><div><br></div><div><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(47,180,29)">int</span><span style="font-variant-ligatures:no-common-ligatures"> matrix_solve:: setFieldSplitType()</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">{</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(64,11,217)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">// the global parameters</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> PetscInt ierr, dofPerEnt,stride,k;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(47,180,29)">int</span><span style="font-variant-ligatures:no-common-ligatures"> startDof, endDofPlusOne;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(47,180,29)">int</span><span style="font-variant-ligatures:no-common-ligatures"> num_own_ent=m3dc1_mesh::instance()->num_own_ent[</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures">], num_own_dof;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> m3dc1_field_getnumowndof(&fieldOrdering, &num_own_dof);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(193,101,28)">if</span><span style="font-variant-ligatures:no-common-ligatures"> (num_own_ent) dofPerEnt = num_own_dof/num_own_ent;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(64,11,217)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> stride=dofPerEnt/</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">3</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">; </span><span style="font-variant-ligatures:no-common-ligatures">//U </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures">-></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">11</span><span style="font-variant-ligatures:no-common-ligatures">, Omega </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">12</span><span style="font-variant-ligatures:no-common-ligatures">-></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">23</span><span style="font-variant-ligatures:no-common-ligatures">, Chi </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">24</span><span style="font-variant-ligatures:no-common-ligatures">-></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">35</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> m3dc1_field_getowndofid (&fieldOrdering, &startDof, &endDofPlusOne);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> startDof=startDof/stride;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(64,11,217)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">// the </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">3</span><span style="font-variant-ligatures:no-common-ligatures"> fields for PCFIELDSPLIT</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(64,11,217)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">IS field0, field1, field2;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> PetscInt *idx0, *idx1, *idx2;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=PetscMalloc1(num_own_ent, &idx0);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=PetscMalloc1(num_own_ent, &idx1);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=PetscMalloc1(num_own_ent, &idx2);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(193,101,28)">for</span><span style="font-variant-ligatures:no-common-ligatures"> (k=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures">; k<num_own_ent; k++) idx0[k]=k*dofPerEnt/stride + startDof;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=ISCreateBlock(PETSC_COMM_WORLD, stride, num_own_ent, idx0, PETSC_COPY_VALUES, &field0);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(193,101,28)">for</span><span style="font-variant-ligatures:no-common-ligatures"> (k=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures">; k<num_own_ent; k++) idx1[k]=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">1</span><span style="font-variant-ligatures:no-common-ligatures">+k*dofPerEnt/stride + startDof;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=ISCreateBlock(PETSC_COMM_WORLD, stride, num_own_ent, idx1, PETSC_COPY_VALUES, &field1);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(193,101,28)">for</span><span style="font-variant-ligatures:no-common-ligatures"> (k=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures">; k<num_own_ent; k++) idx2[k]=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">2</span><span style="font-variant-ligatures:no-common-ligatures">+k*dofPerEnt/stride + startDof;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=ISCreateBlock(PETSC_COMM_WORLD, stride, num_own_ent, idx2, PETSC_COPY_VALUES, &field2);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> PC pc; </span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr= KSPAppendOptionsPrefix(*ksp,</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">"fs_"</span><span style="font-variant-ligatures:no-common-ligatures">); // ksp is a global here</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=KSPGetPC(*ksp, &pc);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=PCSetType(pc, PCFIELDSPLIT);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=<span class="gmail-il">PCFieldSplitSetIS</span>(pc, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">NULL</span><span style="font-variant-ligatures:no-common-ligatures">, field0);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=<span class="gmail-il">PCFieldSplitSetIS</span>(pc, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">NULL</span><span style="font-variant-ligatures:no-common-ligatures">, field1);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=<span class="gmail-il">PCFieldSplitSetIS</span>(pc, </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">NULL</span><span style="font-variant-ligatures:no-common-ligatures">, field2);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=PetscFree(idx0);</span><a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/Sys/PetscCall/__;!!G_uCfscf7eWS!c_nKrPbKpTddk11qYmEtY65UqhTbG4LXm7rfRLNAprFTA0x4y_NfBtBIEhOMant3sxPS91A_TgyDkqZ9gefqEq4$" style="font-family:Arial,Helvetica,sans-serif;font-size:small">PetscCall</a><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">(</span><a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/IS/ISDestroy/__;!!G_uCfscf7eWS!c_nKrPbKpTddk11qYmEtY65UqhTbG4LXm7rfRLNAprFTA0x4y_NfBtBIEhOMant3sxPS91A_TgyDkqZ9VDKwi_8$" style="font-family:Arial,Helvetica,sans-serif;font-size:small">ISDestroy</a><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">(&</span><span style="font-variant-ligatures:no-common-ligatures">field0</span><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">));</span><a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/Sys/PetscCall/__;!!G_uCfscf7eWS!c_nKrPbKpTddk11qYmEtY65UqhTbG4LXm7rfRLNAprFTA0x4y_NfBtBIEhOMant3sxPS91A_TgyDkqZ9gefqEq4$" style="font-family:Arial,Helvetica,sans-serif;font-size:small">PetscCall</a><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">(</span><a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/IS/ISDestroy/__;!!G_uCfscf7eWS!c_nKrPbKpTddk11qYmEtY65UqhTbG4LXm7rfRLNAprFTA0x4y_NfBtBIEhOMant3sxPS91A_TgyDkqZ9VDKwi_8$" style="font-family:Arial,Helvetica,sans-serif;font-size:small">ISDestroy</a><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">(&</span><span style="font-variant-ligatures:no-common-ligatures">field1</span><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">));</span><a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/Sys/PetscCall/__;!!G_uCfscf7eWS!c_nKrPbKpTddk11qYmEtY65UqhTbG4LXm7rfRLNAprFTA0x4y_NfBtBIEhOMant3sxPS91A_TgyDkqZ9gefqEq4$" style="font-family:Arial,Helvetica,sans-serif;font-size:small">PetscCall</a><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">(</span><a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/IS/ISDestroy/__;!!G_uCfscf7eWS!c_nKrPbKpTddk11qYmEtY65UqhTbG4LXm7rfRLNAprFTA0x4y_NfBtBIEhOMant3sxPS91A_TgyDkqZ9VDKwi_8$" style="font-family:Arial,Helvetica,sans-serif;font-size:small">ISDestroy</a><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">(&</span><span style="font-variant-ligatures:no-common-ligatures">field2</span><span style="font-family:Arial,Helvetica,sans-serif;font-size:small">));</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=PetscFree(idx1);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> ierr=PetscFree(idx2);</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> fsSet=</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">1</span><span style="font-variant-ligatures:no-common-ligatures">;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(193,101,28)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures">return</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(180,36,25)">0</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">;</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">}</span></p></div><div><br></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Apr 3, 2025 at 8:57 AM Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Thu, Apr 3, 2025 at 12:11 AM Sanjay Govindjee via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>We would like to solve an FEA problem (unstructured grid) where the nodes on the elements have different dofs. For example the corner nodes have only dof 0 and then mid-side nodes have dofs 0,1,2 (think 8 node serendipity element). This is a multi-physics problem so we are looking to use the fieldsplit features to pre-condition and solve. Is there a simple example of this type of usage in the src that we can try to mimic?</div><div><br></div><div>I presume this will take programming as opposed to just setting command line options.</div></div></blockquote><div><br></div><div>It will take a little programming, but not much. Here is the idea. FieldSplit needs to know what dofs belong to what field. There are a couple of ways to do this, at different levels of abstraction.</div><div><br></div><div>1. Low level</div><div><br></div><div>You can explicitly makes lists of the dofs in each field, as an IS, and call <a href="https://urldefense.us/v3/__https://petsc.org/main/manualpages/PC/PCFieldSplitSetIS/__;!!G_uCfscf7eWS!aMROjbrPD3RYXMpO8mIii7q8eXZX1uN-6F6-g_jcNLLXGCgYPt2JEDkIIQCHs_vNBhhxsiwQJaz57ydxKyWe$" target="_blank">https://petsc.org/main/manualpages/PC/PCFieldSplitSetIS/</a> for each field. This is not very flexible, but the easiest to understand.</div><div><br></div><div>2. Intermediate level</div><div><br></div><div>You can make a DMShell, and then make a PetscSection, that gives the number of dofs on each vertex and edge. Then call KSPSetDM() or SNESSetDM(), and you can do nested fieldsplits from the command line. This also retains a connection between the topology and the data layout, but you have to deal with that pesky DM object.</div><div><br></div><div>3. High level</div><div><br></div><div>You can use a DMPlex to represent your grid and a PetscFE to represent the discretization, and then layout is done automatically, and nested fieldsplits can be done from the command line. I am not 100% sure PetscFE can represent what you want, but you can always call DMPlexCreateSection() by hand to make the PetscSection.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>-sanjay</div><div><div dir="ltr" class="gmail_signature"><br></div></div></div>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!aMROjbrPD3RYXMpO8mIii7q8eXZX1uN-6F6-g_jcNLLXGCgYPt2JEDkIIQCHs_vNBhhxsiwQJaz57-FUThx2$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>
</blockquote></div>