# neighbors¶

ExplicitStructuredGrid.neighbors(ind, rel='connectivity')

Return the indices of neighboring cells.

Parameters
ind

Cell IDs.

rel`str`, `optional`

Defines the neighborhood relationship. If `'topological'`, returns the `(i-1, j, k)`, ```(i+1, j, k)```, `(i, j-1, k)`, `(i, j+1, k)`, `(i, j, k-1)` and `(i, j, k+1)` cells. If `'connectivity'` (default), returns only the topological neighbors considering faces connectivity. If `'geometric'`, returns the cells in the `(i-1, j)`, `(i+1, j)`, `(i,j-1)` and `(i, j+1)` vertical cell groups whose faces intersect.

Returns
`list`(`int`)

Indices of neighboring cells.

Examples

```>>> import pyvista as pv
>>> from pyvista import examples
{"ft_lang_label":"__label__en","ft_lang_prob":0.53030884,"math_prob":0.9604963,"size":979,"snap":"2021-31-2021-39","text_gpt3_token_len":284,"char_repetition_ratio":0.14666666,"word_repetition_ratio":0.0,"special_character_ratio":0.31869254,"punctuation_ratio":0.25543478,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9852038,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-25T00:53:09Z\",\"WARC-Record-ID\":\"<urn:uuid:2c07bc35-3d61-4c8b-9ff7-9359b07aadb6>\",\"Content-Length\":\"46697\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c597d48c-6700-46e5-996e-ed3453019c16>\",\"WARC-Concurrent-To\":\"<urn:uuid:6765c026-5256-4225-ad0b-8b89ced7b9a4>\",\"WARC-IP-Address\":\"185.199.109.153\",\"WARC-Target-URI\":\"https://docs.pyvista.org/api/core/_autosummary/pyvista.ExplicitStructuredGrid.neighbors.html\",\"WARC-Payload-Digest\":\"sha1:L5WBFU5PKT6DONWRTVJI4ZBGSP4NGHA4\",\"WARC-Block-Digest\":\"sha1:BYE2FRR6RGSDV66RH3VYBFJ42I6V2AT4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057584.91_warc_CC-MAIN-20210924231621-20210925021621-00013.warc.gz\"}"}