[petsc-users] Question about how to use DS to do the discretization

Gong Yujie yc17470 at connect.um.edu.mo
Sat Mar 23 07:03:24 CDT 2024


Dear PETSc group,

I'm reading the DS part for the discretization start from SNES ex17.c which is a demo for solving linear elasticity problem. I have two questions for the details.

The first question is for the residual function. Is the residual calculated as this? The dot product is a little weird because of the dimension of the result.
[cid:b790e49a-5adb-4085-807c-546e7c2d941f]
Here \sigma is the stress tensor, \phi_i is the test function for the i-th function (Linear elasticity in 3D contains three equations).

The second question is how to derive the Jacobian of the system (line 330 in ex17.c). As shown in the PetscDSSetJacobian, we need to provide function g3() which I think is a 4th-order tensor with size 3*3*3*3 in this linear elasticity case. I'm not sure how to get it. Are there any references on how to get this Jacobian?

I've checked about the comment before this Jacobian function (line 330 in ex17.c) but don't know how to get this.

Thanks in advance!

Best Regards,
Yujie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240323/d8b14f85/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 34587 bytes
Desc: image.png
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240323/d8b14f85/attachment-0001.png>


More information about the petsc-users mailing list