:orphan:
# PetscLayoutCreate
Allocates `PetscLayout` object 
## Synopsis
```
#include "petscis.h" 
PetscErrorCode PetscLayoutCreate(MPI_Comm comm, PetscLayout *map)
```
Collective


## Input Parameter

- ***comm -*** the MPI communicator



## Output Parameter

- ***map -*** the new `PetscLayout`





## Notes
Typical calling sequence
```none
       PetscLayoutCreate(MPI_Comm,PetscLayout *);
       PetscLayoutSetBlockSize(PetscLayout,bs);
       PetscLayoutSetSize(PetscLayout,N); // or PetscLayoutSetLocalSize(PetscLayout,n);
       PetscLayoutSetUp(PetscLayout);
```

Alternatively,
```none
      PetscLayoutCreateFromSizes(comm,n,N,bs,&layout);
```


Optionally use any of the following
```none
  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` implementations; it is often not needed in
user codes unless you really gain something in their use.


## See Also
 [PetscLayout](sec_matlayout), `PetscLayoutSetLocalSize()`, `PetscLayoutSetSize()`, `PetscLayoutGetSize()`, `PetscLayoutGetLocalSize()`,
`PetscLayout`, `PetscLayoutDestroy()`,
`PetscLayoutGetRange()`, `PetscLayoutGetRanges()`, `PetscLayoutSetBlockSize()`, `PetscLayoutGetBlockSize()`, `PetscLayoutSetUp()`,
`PetscLayoutCreateFromSizes()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/utils/pmap.c.html#PetscLayoutCreate">src/vec/is/utils/pmap.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/utils/pmap.c)


[Index of all IS routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
