<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I am assembling a global mass matrix on a mesh consisting of 8192 elements and 3 basis functions per element (so the global dimension is 24,576. For some reason, when assembling this matrix I get tons of floating point exceptions everywhere:<div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(241, 245, 255); background-color: rgb(47, 47, 47);">[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(241, 245, 255); background-color: rgb(47, 47, 47);">[0]PETSC ERROR: Floating point exception!</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(241, 245, 255); background-color: rgb(47, 47, 47);">[0]PETSC ERROR: Inserting nan at matrix entry (0,0)!</div></div><div><br></div><div>I get this error for every 3rd diagonal entry of the matrix, but the problem is bigger than that I suspect. In my computation of the local 3x3 element mass matrices, printing out the values gives all zeros (which is what the entries are initialized to be in my code). </div><div><br></div><div>I’m at a loss for how to debug this problem. My first thought was that there is an error in the mesh, but I’m certain now that this is not the case since the mesh is generated using the exact same routine that generates all of my coarser meshes before this one that fails. For example, the mesh that is one refinement level below this one has 2048 elements and works completely fine. This is how I am creating the global matrix:</div><div><br></div><div><div>MatCreateSeqAIJ(PETSC_COMM_SELF, NLoc*nElems, NLoc*nElems, NLoc, </div><div><span class="Apple-tab-span" style="white-space:pre"> </span> PETSC_NULL, &Mglobal);</div></div><div><br></div><div>where I allocate NLoc = 3 non-zero entries per row in this case. </div></body></html>