Date: 2026-03-01T05:24:36+00:00

Actual source code: dapf.c

      1: #include <petsc/private/dmdaimpl.h>

      3: /*@C
      4:   DMDACreatePF - Creates an appropriately dimensioned `PF` mathematical function object
      5:   from a `DMDA`.

      7:   Collective; No Fortran Support

      9:   Input Parameter:
     10: . da - initial distributed array

     12:   Output Parameter:
     13: . pf - the mathematical function object

     15:   Level: advanced

     17: .seealso: `DM`, `PF`, `DMDA`, `DMDACreate1d()`, `DMDACreate2d()`, `DMDACreate3d()`, `DMDestroy()`, `DMCreateGlobalVector()`
     18: @*/
     19: PetscErrorCode DMDACreatePF(DM da, PF *pf)
     20: {
     21:   DM_DA *dd = (DM_DA *)da->data;

     23:   PetscFunctionBegin;
     25:   PetscAssertPointer(pf, 2);
     26:   PetscCall(PFCreate(PetscObjectComm((PetscObject)da), da->dim, dd->w, pf));
     27:   PetscFunctionReturn(PETSC_SUCCESS);
     28: }