[petsc-users] petsc error disappears when I print something in the function

Kaushik Vijaykumar kaushikv318 at gmail.com
Tue Apr 21 09:43:29 CDT 2020


Hello group,

I have been trying to navigate a weird error that I have found in my FEA
code that I am developing using PetSc. The error occurs when, i execute a
call to stiffness generation of a Tetrahederal element. The code returns an
memory error if I don't print the following statements in the function,
(see the ierr print statements below):

for (i1=1; i1<4; i1++)  // Loop 6b
      {
        for (j1=1; j1<4; j1++) // Loop 7b
      {
      for (k1=1; k1<4; k1++) // Loop 8
{
        for (l1=1; l1<4; l1++) // Loop 9
{
  s[ii1+i1-1][jj1+j1-1] =
s[ii1+i1-1][jj1+j1-1]+C4[i1][k1][j1][l1]*w[k1][l1]*weight;
  ierr = PetscFPrintf(PETSC_COMM_WORLD,outfile,"C4 %f
\n",C4[i1][k1][j1][l1]);CHKERRQ(ierr);
  ierr = PetscFPrintf(PETSC_COMM_WORLD,outfile,"w %f
\n",w[k1][l1]);CHKERRQ(ierr);
  ierr = PetscFPrintf(PETSC_COMM_WORLD,outfile,"weight %f
\n",weight);CHKERRQ(ierr);
}   // Loop 9
}  // Loop 8
      } // Loop 7b
        } // Loop 6b


Any help on this is really appreciated.

Thanks
Kaushik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200421/3c9011da/attachment.html>


More information about the petsc-users mailing list