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

neil liu liufield at gmail.com
Wed Apr 5 08:59:49 CDT 2023


Thanks, Matt.
1) You mentioned that "PETSc calculates u_x, given the PetscFE and the
coefficients (and the geometry).".
Could you please direct me the source code that calculates u_x ?

2) Yes. Raviart-Thomas is one type of Nedelec element (Hdiv also called
divergence conforming). Do you support Hcurl (curl conforming) Nedelec
element ?

On Tue, Apr 4, 2023 at 10:59 AM Matthew Knepley <knepley at gmail.com> wrote:

> 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
> geometry).
>
>
>> 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
>
>
> https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/dualspace/impls/lagrange/tutorials/ex1.c#L78
>
> and see a use case here
>
>   https://gitlab.com/petsc/petsc/-/blob/main/src/snes/tutorials/ex24.c
>
>   Thanks,
>
>      Matt
>
>
>> 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/20230405/3819ac4d/attachment.html>


More information about the petsc-users mailing list