xref: /petsc/src/dm/impls/da/dapf.c (revision 9a42bb27a39f0cdf3306a1e22d33cd9809484eaa)
1 #define PETSCDM_DLL
2 
3 #include "private/daimpl.h"    /*I   "petscda.h"   I*/
4 
5 
6 #undef __FUNCT__
7 #define __FUNCT__ "DACreatePF"
8 /*@C
9    DACreatePF - Creates an appropriately dimensioned PF mathematical function object
10       from a DA.
11 
12    Collective on DA
13 
14    Input Parameter:
15 .  da - initial distributed array
16 
17    Output Parameter:
18 .  pf - the mathematical function object
19 
20    Level: advanced
21 
22 
23 .keywords:  distributed array, grid function
24 
25 .seealso: DACreate1d(), DACreate2d(), DACreate3d(), DMDestroy(), DACreateGlobalVector()
26 @*/
27 PetscErrorCode PETSCDM_DLLEXPORT DACreatePF(DM da,PF *pf)
28 {
29   PetscErrorCode ierr;
30   DM_DA          *dd = (DM_DA*)da->data;
31 
32   PetscFunctionBegin;
33   PetscValidHeaderSpecific(da,DM_CLASSID,1);
34   PetscValidPointer(pf,2);
35   ierr = PFCreate(((PetscObject)da)->comm,dd->dim,dd->w,pf);CHKERRQ(ierr);
36   PetscFunctionReturn(0);
37 }
38 
39 
40