[petsc-users] Questions about the PetscDSSetResidual and Nedelec element.

Matthew Knepley knepley at gmail.com
Tue Apr 4 09:59:45 CDT 2023

On Tue, Apr 4, 2023 at 10:45 AM neil liu <liufield at gmail.com> wrote:

> Hello,
> I am learning this case,
> https://petsc.org/release/src/snes/tutorials/ex62.c.html
> . And try to make myself familiar with the FEM (PetscFE) there.
> Then I have several questions.
> 1)  PetscDSSetResidual
> <https://petsc.org/release/manualpages/DT/PetscDSSetResidual/>,
> For example, line 291,  PetscCall
> <https://petsc.org/release/manualpages/Sys/PetscCall/>(PetscDSSetResidual
> <https://petsc.org/release/manualpages/DT/PetscDSSetResidual/>(ds, 0,
> f0_quadratic_u, f1_u)), here, f0_quadratic_u and f1_u is function
> pointers. Where have the input parameter for these functions been
> calculated, e.g., u_x.

Line 291 sets callback functions. These functions are actually called in
the loop over the mesh which calculates the residual.
PETSc calculates u_x, given the PetscFE and the coefficients (and the

> If I want to check the values of these parameters before line 291, how to
> print that ?

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.

> 2) Does PetscFE support Nedelec element? Will it be painful to add these
> modules myself ?

What kind? I think we support them, but have no tests. Take a look at our
support for Raviart-Thomas


and see a use case here




> Thanks ,
> Xiaodong

What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230404/f0a78226/attachment.html>

More information about the petsc-users mailing list