<div dir="ltr"><div dir="ltr">On Tue, Apr 4, 2023 at 10:45 AM neil liu <<a href="mailto:liufield@gmail.com">liufield@gmail.com</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">Hello,<div><br></div><div>I am learning this case, <a href="https://petsc.org/release/src/snes/tutorials/ex62.c.html" target="_blank">https://petsc.org/release/src/snes/tutorials/ex62.c.html</a></div><div>. And try to make myself familiar with the FEM (PetscFE) there. </div><div>Then I have several questions. </div><div>1) <a href="https://petsc.org/release/manualpages/DT/PetscDSSetResidual/" target="_blank">PetscDSSetResidual</a>, </div><div>For example, line <a name="m_585389396370613898_line291" style="color:rgb(0,0,0)">291, </a><span style="color:rgb(0,0,0)"> </span><a href="https://petsc.org/release/manualpages/Sys/PetscCall/" target="_blank">PetscCall</a><span style="color:rgb(0,0,0)">(</span><a href="https://petsc.org/release/manualpages/DT/PetscDSSetResidual/" target="_blank">PetscDSSetResidual</a><span style="color:rgb(0,0,0)">(ds, 0, f0_quadratic_u, f1_u)), here, </span><span style="color:rgb(0,0,0)">f0_quadratic_u and </span><span style="color:rgb(0,0,0)">f1_u is function pointers. Where have the input parameter for these functions been calculated, e.g., u_x. </span></div></div></blockquote><div><br></div><div>Line 291 sets callback functions. These functions are actually called in the loop over the mesh which calculates the residual.</div><div>PETSc calculates u_x, given the PetscFE and the coefficients (and the geometry).</div><div> </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><span style="color:rgb(0,0,0)">If I want to check the values of these parameters before line 291, how to print that ?</span></div></div></blockquote><div><br></div><div>I output many thing with -dm_plex_print_fem 5, but I am not sure if I print out the field jet. It would be easy to add.</div><div> </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><span style="color:rgb(0,0,0)">2) Does PetscFE support Nedelec element? Will it be painful to add these modules myself ?</span></div></div></blockquote><div><br></div><div>What kind? I think we support them, but have no tests. Take a look at our support for Raviart-Thomas</div><div><br></div><div> <a href="https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/dualspace/impls/lagrange/tutorials/ex1.c#L78">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/dualspace/impls/lagrange/tutorials/ex1.c#L78</a></div><div><br></div><div>and see a use case here</div><div><br></div><div> <a href="https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex24.c">https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex24.c</a></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </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><span style="color:rgb(0,0,0)">Thanks ,</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Xiaodong </span></div><div><br></div></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><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>