#include "petscis.h" PetscErrorCode PetscLayoutCreate(MPI_Comm comm,PetscLayout *map)Collective
| comm | - the MPI communicator | 
| map | - the new PetscLayout | 
       PetscLayoutCreate(MPI_Comm,PetscLayout *);
       PetscLayoutSetBlockSize(PetscLayout,bs);
       PetscLayoutSetSize(PetscLayout,N); // or PetscLayoutSetLocalSize(PetscLayout,n);
       PetscLayoutSetUp(PetscLayout);
Alternatively,
     PetscLayoutCreateFromSizes(comm,n,N,bs,&layout);
| PetscLayoutGetSize(PetscLayout,PetscInt *); | |
| PetscLayoutGetLocalSize(PetscLayout,PetscInt *); | |
| PetscLayoutGetRange(PetscLayout,PetscInt *rstart,PetscInt *rend); | |
| PetscLayoutGetRanges(PetscLayout,const PetscInt *range[]); | |
| PetscLayoutDestroy(PetscLayout*); | 
The PetscLayout object and methods are intended to be used in the PETSc Vec and Mat implementions; it is often not needed in user codes unless you really gain something in their use.