# Reduce the size of grid data

**URL:** https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615
**Category:** ParaView Support
**Created:** [February 20, 2020, 2:58pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615 "2020-02-20T14:58:23Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![carl.hughes.cerberus](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/85e7bf/32.png) [@carl.hughes.cerberus](https://discourse.paraview.org/u/carl.hughes.cerberus)
#### Post date: [February 20, 2020, 2:58pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/1 "2020-02-20T14:58:23Z")

</div>

Hello,

Is there a filter or process that can reduce the size of a rectilinear grid. i.e, I want to reduce the mesh from 100x100x100 to 50x50x50 but have the overall outer dimensions the same, so that the blocks are averaged onto the new array?

Thanks,

Carl

---

<div class="post-metadata">

### Author: ![randomwangran](https://discourse.paraview.org/user_avatar/discourse.paraview.org/randomwangran/32/5929_2.png) [@randomwangran](https://discourse.paraview.org/u/randomwangran)
#### Post date: [February 20, 2020, 3:16pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/2 "2020-02-20T15:16:15Z")

</div>

Impossible.

By doing this, you made a new grid. If you want to show how dense your mesh is, just to show the boundary layer’s mesh is okay.

---

<div class="post-metadata">

### Author: ![carl.hughes.cerberus](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/85e7bf/32.png) [@carl.hughes.cerberus](https://discourse.paraview.org/u/carl.hughes.cerberus)
#### Post date: [February 20, 2020, 3:20pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/3 "2020-02-20T15:20:12Z")

</div>

We have essentially created too much data, and want to reduce the size of the mesh down to a quarter, with the same outer dimensions. essentially condensing 8 cell blocks to 1, and in doing so smooth out some of the data. We could just write a script that did this averaging the data and taking into account any covariance, I was just hoping that a filter already existed to do this. Trying to avoid doing hundreds of data runs again at a lower grid size.

---

<div class="post-metadata">

### Author: ![randomwangran](https://discourse.paraview.org/user_avatar/discourse.paraview.org/randomwangran/32/5929_2.png) [@randomwangran](https://discourse.paraview.org/u/randomwangran)
#### Post date: [February 20, 2020, 3:21pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/4 "2020-02-20T15:21:40Z")

</div>

> [@carl.hughes.cerberus](#):
>
> want to reduce the size of the mesh down to a quarter

so, what is your rule to write mesh?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [February 20, 2020, 3:24pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/5 "2020-02-20T15:24:12Z")

</div>

The `Extract Subset` filter let’s you change the i/j/k sampling directions. Change the Sample Rate I/J/K as needed. Note, these are advanced properties and you’ll have hit on the “gear” icon to see them.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/9/9eb191661d598a44f151f0f15cb1f0b541bd819e.png)

---

<div class="post-metadata">

### Author: ![randomwangran](https://discourse.paraview.org/user_avatar/discourse.paraview.org/randomwangran/32/5929_2.png) [@randomwangran](https://discourse.paraview.org/u/randomwangran)
#### Post date: [February 20, 2020, 3:29pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/6 "2020-02-20T15:29:56Z")

</div>

Does it only work for vtk?

I’ve tested using \*.foam, not working (you cannot use `extract subset` filter).

I do not how and what is the mesh of the author.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [February 20, 2020, 3:33pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/7 "2020-02-20T15:33:28Z")

</div>

> [@randomwangran](#):
>
> I’ve tested using \*.foam, not working (you cannot use `extract subset` filter).  
> I do not how what is the mesh of the author.

The original email clearly states “…reduce the size of a rectilinear grid”. Rectilinear grid is a specific type of data type called `vtkRectilinearGrid`. `Extract Subset` filter only applies to dataset types that are structured like rectilinear grid, image data, structured grid etc.

---

<div class="post-metadata">

### Author: ![randomwangran](https://discourse.paraview.org/user_avatar/discourse.paraview.org/randomwangran/32/5929_2.png) [@randomwangran](https://discourse.paraview.org/u/randomwangran)
#### Post date: [February 20, 2020, 3:34pm UTC](https://discourse.paraview.org/t/reduce-the-size-of-grid-data/3615/8 "2020-02-20T15:34:13Z")

</div>

Thanks for sharing. I’ve learnt that. Sorry about it.

@utkarsh.ayachit

Can this filter achieve this?

> We could just write a script that did this averaging the data and taking into account any covariance

From what I understand, ` extract subset` pick up points every some points.

Can it achieve:

> averaging the data

@utkarsh.ayachit

If you are using OpenFOAM

> <https://github.com/OpenFOAM/OpenFOAM-dev/blob/master/applications/utilities/postProcessing/dataConversion/foamToVTK/Make/files>

maybe convert to vtk is a better solution.
