# A question about converting unstructured grid to explicit structured grid

**URL:** https://discourse.vtk.org/t/a-question-about-converting-unstructured-grid-to-explicit-structured-grid/3632
**Category:** Development
**Created:** [June 24, 2020, 2:15pm UTC](https://discourse.vtk.org/t/a-question-about-converting-unstructured-grid-to-explicit-structured-grid/3632 "2020-06-24T14:15:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rodrigomologni](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@rodrigomologni](https://discourse.vtk.org/u/rodrigomologni)
#### Post date: [June 24, 2020, 2:15pm UTC](https://discourse.vtk.org/t/a-question-about-converting-unstructured-grid-to-explicit-structured-grid/3632/1 "2020-06-24T14:15:01Z")

</div>

I have a question about converting unstructured grid to explicit structured using `vtkUnstructuredGridToExplicitStructuredGrid`:

Two errors are shown when I run this code using `SetWholeExtent`:

```
>>> converter = vtk.vtkUnstructuredGridToExplicitStructuredGrid()
>>> converter.SetInputData(ugrid)
>>> converter.SetWholeExtent(0, 46, 0, 69, 0, 15)
>>> converter.Update()
ERROR:root:Attempt to get an input array for an index that has not been specified
ERROR:root:An ijk array has not be set using SetInputArrayToProcess, aborting.

```

The code works when I include `SetInputArrayToProcess`:

```
>>> converter = vtk.vtkUnstructuredGridToExplicitStructuredGrid()
>>> converter.SetInputData(ugrid)
>>> converter.SetWholeExtent(0, 46, 0, 69, 0, 15)
>>> converter.SetInputArrayToProcess(0, 0, 0, 1, 'BLOCK_I')
>>> converter.SetInputArrayToProcess(1, 0, 0, 1, 'BLOCK_J')
>>> converter.SetInputArrayToProcess(2, 0, 0, 1, 'BLOCK_K')
>>> converter.Update()

```

But the code also works when I remove `SetWholeExtent`:

```
>>> converter = vtk.vtkUnstructuredGridToExplicitStructuredGrid()
>>> converter.SetInputData(ugrid)
>>> converter.SetInputArrayToProcess(0, 0, 0, 1, 'BLOCK_I')
>>> converter.SetInputArrayToProcess(1, 0, 0, 1, 'BLOCK_J')
>>> converter.SetInputArrayToProcess(2, 0, 0, 1, 'BLOCK_K')
>>> converter.Update()

```

Therefore, what is the `SetWholeExtent` for? And how to use it correctly?

The parameters of `SetWholeExtent` are correct. I got them from the original explicit structured grid.
