# ISEmbed
Embed `IS` a into `IS` b by finding the locations in b that have the same indices as in a. If c is the `IS` of these locations, we have a = b*c, regarded as a composition of the corresponding `ISLocalToGlobalMap`s. 
## Synopsis
```
#include "petscis.h"  
PetscErrorCode ISEmbed(IS a, IS b, PetscBool drop, IS *c)
```
Not collective.


## Input Parameters

- ***a    -*** `IS` to embed
- ***b    -*** `IS` to embed into
- ***drop -*** flag indicating whether to drop a's indices that are not in b.



## Output Parameters

- ***c    -*** local embedding indices





## Notes
If some of a's global indices are not among b's indices the embedding is impossible.  The local indices of a
corresponding to these global indices are either mapped to -1 (if !drop) or are omitted (if drop).  In the former
case the size of c is that same as that of a, in the latter case c's size may be smaller.

The resulting `IS` is sequential, since the index substitution it encodes is purely local.


## See Also
 `IS`, `ISLocalToGlobalMapping`

## Level
developer

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


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


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