<font style="font-size:14px;font-family:sans-serif">
        <div><font style="font-family:sans-serif;font-size:14px"><font style="font-size:14px"><font style="font-family:sans-serif">I see. I added a "Cell Sets" label like so:</font></font></font></div><div><font style="font-family:sans-serif;font-size:14px"><font style="font-size:14px"><font style="font-family:sans-serif">​</font></font></font></div><div><font style="font-family:sans-serif;font-size:14px"><font style="font-family:monospace"><font style="font-size:14px">​    DMCreateLabel(dm, "Cell Sets");</font></font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    DMLabel cs_label;</font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    DMGetLabel(dm, "Cell Sets", &cs_label);</font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    DMLabelAddStratum(cs_label, 0);</font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    PetscInt idxs[] = { 1 };</font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    IS is;</font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    ISCreateGeneral(comm, 1, idxs, PETSC_COPY_VALUES, &is);</font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    DMLabelSetStratumIS(cs_label, 0, is);</font></font></div><div><font style="font-family:monospace"><font style="font-size:14px">    ISDestroy(&is);</font></font></div><br><div>Note, that I have only a single element (Quad4) in the mesh and I am just trying to get this working, so I understand what needs to happen for larger meshes.</div><div>​</div><div>​This got me past the segfault, but now I see:</div><div>​</div><div><font style="font-family:monospace">[​0]PETSC ERROR: Argument out of range</font></div><div class="p1"><font style="font-family:monospace">[0]PETSC ERROR: Number of vertices 1 in dimension 2 has no ExodusII type</font></div><br><div class="p1">So, I assume I need to do something ​more to make it work.</div><div class="p1">​</div><div class="p1">​David</div><div>​<font style="font-family:sans-serif">​</font></div><div class="gmail_quote_attribution">On Nov 30 2021, at 11:39 AM, Blaise Bourdin <bourdin@mcmaster.ca> wrote:</div><blockquote class="gmail_quote"><edo-readonly><div>  It looks like your DM cannot be saved in exodus format as such. The exodus format requires that all cells be part of a single block (defined by ‘Cell Set’ labels), and that the cell sets consists of sequentially numbered cells.</div><div>Can you see if that is enough? If not, I will go through your example</div><div><br></div><div>Blaise</div><div><br><div><blockquote class=""><div>On Nov 30, 2021, at 9:50 AM, David Andrs <<a href="mailto:andrsd@gmail.com" title="mailto:andrsd@gmail.com">andrsd@gmail.com</a>> wrote:</div><br><div><div><div>Hello!</div><div><br></div><div>I am trying to store data into an ExodusII file using the ExodusIIViewer, but running into a segfault inside PETSc. Attached is a minimal example showing the problem. It can very much be that I am missing something obvious. However, if I change the code to VTKViewer I get the desired output file.</div><div><br></div><div>Machine: MacBook Pro 2019</div><div>OS version/type: Darwin notak.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_64</div><div>PETSc: Petsc Release Version 3.16.1, Nov 01, 2021</div><div>MPI: MPICH 3.4.2</div><div>Compiler: clang-12</div><div><br></div><div>Call stack (not sure how relevant that is since it is from opt version):</div><div><br><div><font style="font-family:monospace">* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc)</font></div><div><font style="font-family:monospace">    frame #0: 0x0000000102303ba9 libpetsc.3.16.dylib`DMView_PlexExodusII(dm=<unavailable>, viewer=<unavailable>) at plexexodusii.c:457:45 [opt]</font></div><div><font style="font-family:monospace">   454        else if (degree == 2) nodes[cs] = nodesHexP2;</font></div><div><font style="font-family:monospace">   455      }</font></div><div><font style="font-family:monospace">   456      /* Compute the number of cells not in the connectivity table */</font></div><div><font style="font-family:monospace">-> 457      cellsNotInConnectivity -= nodes[cs][3]*csSize;</font></div><div><font style="font-family:monospace">   458</font></div><div><font style="font-family:monospace">   459      ierr = ISRestoreIndices(stratumIS, &cells);CHKERRQ(ierr);</font></div><div><font style="font-family:monospace">   460      ierr = ISDestroy(&stratumIS);CHKERRQ(ierr);</font></div></div><div><br></div><div><div><font style="font-family:arial, sans-serif">With regards,</font></div></div><div><br></div><div><font style="font-family:arial, sans-serif">David Andrs</font></div></div><div><exo2.c></div></div></blockquote></div><br><div><div><div><div><div><div><div><div><div><div><div><div><div>-- </div><div>Professor, Department of Mathematics & Statistics</div><div>Hamilton Hall room 409A, McMaster University</div><div>1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada </div><div>Tel. +1 (905) 525 9140 ext. 27243</div></div></div></div></div></div></div></div></div></div></div></div></div></div></edo-readonly></blockquote>
      </font>