<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div class="" style="word-wrap:break-word; line-break:after-white-space">David,
<div class=""><br class="">
</div>
<div class="">Here is a modified example.</div>
<div class="">Exodus needs some additional work prior to saving fields. See the attached modified example.</div>
<div class=""><br class="">
</div>
<div class="">Blaise</div>
<div class=""><br class="">
<div></div>
</div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Dec 1, 2021, at 1:54 PM, Blaise Bourdin <<a href="mailto:bourdin@mcmaster.ca" class="">bourdin@mcmaster.ca</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="word-wrap:break-word; line-break:after-white-space">OK, let me have a look.
<div class="">Blaise</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On Nov 30, 2021, at 7:31 PM, David Andrs <<a href="mailto:andrsd@gmail.com" class="">andrsd@gmail.com</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class=""><font class="" style="font-size:14px; font-family:sans-serif">
<div class=""><font class="" style="font-family:sans-serif; font-size:14px"><font class="" style="font-size:14px"><font class="" style="font-family:sans-serif">I see. I added a "Cell Sets" label like so:</font></font></font></div>
<div class=""><font class="" style="font-family:sans-serif; font-size:14px"><font class="" style="font-size:14px"><font class="" style="font-family:sans-serif">​</font></font></font></div>
<div class=""><font class="" style="font-family:sans-serif; font-size:14px"><font class="" style="font-family:monospace"><font class="" style="font-size:14px">​    DMCreateLabel(dm, "Cell Sets");</font></font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    DMLabel cs_label;</font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    DMGetLabel(dm, "Cell Sets", &cs_label);</font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    DMLabelAddStratum(cs_label, 0);</font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    PetscInt idxs[] = { 1 };</font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    IS is;</font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    ISCreateGeneral(comm, 1, idxs, PETSC_COPY_VALUES, &is);</font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    DMLabelSetStratumIS(cs_label, 0, is);</font></font></div>
<div class=""><font class="" style="font-family:monospace"><font class="" style="font-size:14px">    ISDestroy(&is);</font></font></div>
<br class="">
<div class="">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 class="">​</div>
<div class="">​This got me past the segfault, but now I see:</div>
<div class="">​</div>
<div class=""><font class="" style="font-family:monospace">[​0]PETSC ERROR: Argument out of range</font></div>
<div class="x_p1"><font class="" style="font-family:monospace">[0]PETSC ERROR: Number of vertices 1 in dimension 2 has no ExodusII type</font></div>
<br class="">
<div class="x_p1">So, I assume I need to do something ​more to make it work.</div>
<div class="x_p1">​</div>
<div class="x_p1">​David</div>
<div class="">​<font class="" style="font-family:sans-serif">​</font></div>
<div class="x_gmail_quote_attribution">On Nov 30 2021, at 11:39 AM, Blaise Bourdin <<a href="mailto:bourdin@mcmaster.ca" class="">bourdin@mcmaster.ca</a>> wrote:</div>
<blockquote class="x_gmail_quote">
<div class="">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 class="">Can you see if that is enough? If not, I will go through your example</div>
<div class=""><br class="">
</div>
<div class="">Blaise</div>
<div class=""><br class="">
<div class="">
<blockquote class="">
<div class="">On Nov 30, 2021, at 9:50 AM, David Andrs <<a href="mailto:andrsd@gmail.com" title="mailto:andrsd@gmail.com" class="">andrsd@gmail.com</a>> wrote:</div>
<br class="">
<div class="">
<div class="">
<div class="">Hello!</div>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">Machine: MacBook Pro 2019</div>
<div class="">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 class="">PETSc: Petsc Release Version 3.16.1, Nov 01, 2021</div>
<div class="">MPI: MPICH 3.4.2</div>
<div class="">Compiler: clang-12</div>
<div class=""><br class="">
</div>
<div class="">Call stack (not sure how relevant that is since it is from opt version):</div>
<div class=""><br class="">
<div class=""><font class="" style="font-family:monospace">* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc)</font></div>
<div class=""><font class="" 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 class=""><font class="" style="font-family:monospace">   454        else if (degree == 2) nodes[cs] = nodesHexP2;</font></div>
<div class=""><font class="" style="font-family:monospace">   455      }</font></div>
<div class=""><font class="" style="font-family:monospace">   456      /* Compute the number of cells not in the connectivity table */</font></div>
<div class=""><font class="" style="font-family:monospace">-> 457      cellsNotInConnectivity -= nodes[cs][3]*csSize;</font></div>
<div class=""><font class="" style="font-family:monospace">   458</font></div>
<div class=""><font class="" style="font-family:monospace">   459      ierr = ISRestoreIndices(stratumIS, &cells);CHKERRQ(ierr);</font></div>
<div class=""><font class="" style="font-family:monospace">   460      ierr = ISDestroy(&stratumIS);CHKERRQ(ierr);</font></div>
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><font class="" style="font-family:arial,sans-serif">With regards,</font></div>
</div>
<div class=""><br class="">
</div>
<div class=""><font class="" style="font-family:arial,sans-serif">David Andrs</font></div>
</div>
<div class=""><exo2.c></div>
</div>
</blockquote>
</div>
<br class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">
<div class="">-- </div>
<div class="">Professor, Department of Mathematics & Statistics</div>
<div class="">Hamilton Hall room 409A, McMaster University</div>
<div class="">1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada </div>
<div class="">Tel. +1 (905) 525 9140 ext. 27243</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</font></div>
</blockquote>
</div>
<br class="">
<div class="">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div class="">-- <br class="">
Professor, Department of Mathematics & Statistics<br class="">
Hamilton Hall room 409A, McMaster University<br class="">
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada <br class="">
Tel. +1 (905) 525 9140 ext. 27243</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
<div class="">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div>-- <br class="">
Professor, Department of Mathematics & Statistics<br class="">
Hamilton Hall room 409A, McMaster University<br class="">
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada <br class="">
Tel. +1 (905) 525 9140 ext. 27243</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
</div>
</div>
</body>
</html>