# Extent attributes in StructuredGrid

**URL:** https://discourse.vtk.org/t/extent-attributes-in-structuredgrid/7472
**Category:** Support
**Created:** [December 22, 2021, 5:52pm UTC](https://discourse.vtk.org/t/extent-attributes-in-structuredgrid/7472 "2021-12-22T17:52:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Toha](https://discourse.vtk.org/user_avatar/discourse.vtk.org/toha/32/4376_2.png) [@Toha](https://discourse.vtk.org/u/Toha)
#### Post date: [December 22, 2021, 5:52pm UTC](https://discourse.vtk.org/t/extent-attributes-in-structuredgrid/7472/1 "2021-12-22T17:52:43Z")

</div>

Dear users,  
I am trying to output my numerical simulation data in vtk format.  
My grid is structured and I need to use the VTK’s XML format.  
My greatest confusion is about the **WholeExtent** and the **Piece Extent** attributes.  
E.g., the VTK pdf manual says

_StructuredGrid WholeExtent=“x1 x2 y1 y2 z1 z2”_.

What exactly are these x1, x2’s, etc? A similar question is about the x1, x2’s in the Piece Extent attribute.  
Thank you!

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [December 22, 2021, 6:37pm UTC](https://discourse.vtk.org/t/extent-attributes-in-structuredgrid/7472/2 "2021-12-22T18:37:08Z")

</div>

WholeExtent is the range of indices for points, for the whole grid. So a 2x3x4 grid could have WholeExtent=“0 1 0 2 0 3”. Note that the start and end indices can be any values including negative values, but start should be less or equal with end.

PieceExtent refers to the range of indices present on a certain MPI rank. Data is partitioned based on that.

---

<div class="post-metadata">

### Author: ![Toha](https://discourse.vtk.org/user_avatar/discourse.vtk.org/toha/32/4376_2.png) [@Toha](https://discourse.vtk.org/u/Toha)
#### Post date: [December 26, 2021, 3:41pm UTC](https://discourse.vtk.org/t/extent-attributes-in-structuredgrid/7472/3 "2021-12-26T15:41:28Z")

</div>

Dear Dan,  
thank a lot for your response.  
It did work out for a single rank case, but I’m having hard time with more ranks.  
Specifically, I have this Minimum (non)-working example:

10x6x1 (2D) grid, 2 CPUs in x direction, 1 CPU in the remaining directions.  
So Proc 1 has 6x6x1 and Proc 2 has 5x6x1 grid points. I’ve these lines in each of the .vts files:

Processor 1:  
StructuredGrid WholeExtent=" 1 10 1 6 1 1 "  
Piece Extent=" 1 6 1 6 1 1 "

Processor 2:  
StructuredGrid WholeExtent=" 1 10 1 6 1 1 "  
Piece Extent=" 6 10 1 6 1 1 "

Thank you!

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [January 3, 2022, 3:13pm UTC](https://discourse.vtk.org/t/extent-attributes-in-structuredgrid/7472/4 "2022-01-03T15:13:11Z")

</div>

This looks right. I generated a pvts from one of VTK’s sample data files.

> **[multicomb\_1.tar.gz](https://drive.google.com/file/d/1xfMo7svEXZsR1vmbAP4Q80ssCrRJWq3O/view?usp=sharing)**
>
> Google Drive file.

You can load this in ParaView and see what is different from what you are generating. How do you write your files?

---

<div class="post-metadata">

### Author: ![Toha](https://discourse.vtk.org/user_avatar/discourse.vtk.org/toha/32/4376_2.png) [@Toha](https://discourse.vtk.org/u/Toha)
#### Post date: [January 5, 2022, 8:00am UTC](https://discourse.vtk.org/t/extent-attributes-in-structuredgrid/7472/5 "2022-01-05T08:00:35Z")

</div>

Dear Dan,  
thank you for your response. I think I found the issue by looking at the file you shared with me.

The “StructuredGrid WholeExtent” and the “Piece Extent” attributes have the same values in your file, and that also fixed problem for me.
