# Refine and interpolate certain cells within an unstructured grid

**URL:** https://discourse.paraview.org/t/refine-and-interpolate-certain-cells-within-an-unstructured-grid/2825
**Category:** ParaView Support
**Created:** [October 23, 2019, 11:45am UTC](https://discourse.paraview.org/t/refine-and-interpolate-certain-cells-within-an-unstructured-grid/2825 "2019-10-23T11:45:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dolesch](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/dfb087/32.png) [@dolesch](https://discourse.paraview.org/u/dolesch)
#### Post date: [October 23, 2019, 11:45am UTC](https://discourse.paraview.org/t/refine-and-interpolate-certain-cells-within-an-unstructured-grid/2825/1 "2019-10-23T11:45:41Z")

</div>

Hello all,

i have a question concerning programmable filters. I have an unstructured grid and want to interpolate within high gradient regions of a certain field variable. Therefore I want to “split” the cells with the high gradients and interpolate it with different high order functions. Is there a fast way to refine these cells?

Regards

dolesch

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)
#### Post date: [October 25, 2019, 2:51pm UTC](https://discourse.paraview.org/t/refine-and-interpolate-certain-cells-within-an-unstructured-grid/2825/2 "2019-10-25T14:51:46Z")

</div>

I’m not aware of a convenience function in the VTK API for this specific function. The way to do it then is to:

1. copy the input point and point aligned arrays over,
2. iterate over the cells in your input, and either append them across to the output or refine by appending multiple outputs.
3. In the case of refining, be sure to append point quantities too.

See the source code for the existing filters for inspiration.
