[petsc-users] Question about ordering of the gradient in DS

Gong Yujie yc17470 at connect.um.edu.mo
Mon Dec 9 05:34:22 CST 2024


Dear PETSc group,

I would like to inquire about the storage of the gradient in function PetscDSSetResidual:

PetscErrorCode PetscDSSetResidual(PetscDS ds, PetscInt f, void (*f0)(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt uOff_x[], const PetscScalar u[], const PetscScalar u_t[], const PetscScalar u_x[], const PetscInt aOff[], const PetscInt aOff_x[], const PetscScalar a[], const PetscScalar a_t[], const PetscScalar a_x[], PetscReal t, const PetscReal x[], PetscInt numConstants, const PetscScalar constants[], PetscScalar f0[]), void (*f1)(PetscInt, PetscInt, PetscInt, const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], PetscReal, const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]))

Assume u = (u1, u2, u3)^T, the gradient of u is
[cid:68b0e2f6-2465-4550-8ae1-4631bfe74163]

In PetscDSSetResidual, it is stored in an array. Is it ordered as (u1x,u2x, u3x, u1y, u2y, u3y, u1z, u2z,u3z)?

Thanks in advance!

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


More information about the petsc-users mailing list