<div dir="ltr"><div dir="ltr">On Tue, Jul 23, 2019 at 2:45 AM Tsung-Hsing Chen via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></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">Hi,<div>I'am using Petsc to solve FEM problems.</div><div>Right now I just use MatSetValue() or MatSetValues() to build up the stiffness matrix.</div><div>I wonder can I easily get stiffness matrix by using Petsc's functions.<br></div><div>By the way, I'am using unstructured grid (DMPlex).</div></div></blockquote><div><br></div><div>PETSc has some support to generate very simple FEM problems. Almost everything we can do is shown</div><div>in examples. For instance,</div><div><br></div><div> SNES ex12: Poisson</div><div> SNES ex17: Elasticity</div><div> SNES ex62: Stokes</div><div> SNES ex69: nonlinear Stokes</div><div> SNES ex77: large deformation Elasticity</div><div> TS ex45: Heat equation</div><div> TS ex46: Navier-Stokes</div><div><br></div><div>If those look understandable, then maybe this system is capable of generating your problem.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div><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>Thanks a lot for your help,</div><div>Tsung-Hsing Chen</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <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="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>