static char help[] = "Demonstrates various vector routines for DMDA.\n\n"; /*T Concepts: mathematical functions Processors: n T*/ /* Include "petscpf.h" so that we can use pf functions and "petscdmda.h" so we can use the PETSc distributed arrays */ #include #include #include PetscErrorCode myfunction(void *ctx,PetscInt n,const PetscScalar *xy,PetscScalar *u) { PetscInt i; PetscFunctionBeginUser; for (i=0; i