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

Matthew Knepley knepley at gmail.com
Wed Apr 5 10:16:33 CDT 2023


On Wed, Apr 5, 2023 at 10:36 AM neil liu <liufield at gmail.com> wrote:

> Thanks, Matt.
> When you said "P and P minus space" , do you have some references about
> this terminology to build the Hdiv and Hcurl for triangles or tetrahedra?
>

The canonical reference is
https://www-users.cse.umn.edu/~arnold//papers/acta.pdf but that was hard to
understand for me. There must
be a better reference but I do not know it.

  Thanks,

     Matt


> On Wed, Apr 5, 2023 at 10:12 AM Matthew Knepley <knepley at gmail.com> wrote:
>
>> On Wed, Apr 5, 2023 at 10:00 AM neil liu <liufield at gmail.com> wrote:
>>
>>> 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 ?
>>>
>>
>>
>> https://gitlab.com/petsc/petsc/-/blob/main/src/dm/dt/fe/interface/fe.c#L2124
>>
>>
>>> 2) Yes. Raviart-Thomas is one type of Nedelec element (Hdiv also called
>>> divergence conforming). Do you support Hcurl (curl conforming) Nedelec
>>> element ?
>>>
>>
>> Yes, you make them in the same way using the P and P^- spaces.
>>
>>   Thanks,
>>
>>       Matt
>>
>>
>>> 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/>
>>>>
>>>
>>
>> --
>> 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/>
>>
>

-- 
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/95584838/attachment.html>


More information about the petsc-users mailing list