# I want to assign the result of the calculation to the grid element,

**URL:** https://discourse.paraview.org/t/i-want-to-assign-the-result-of-the-calculation-to-the-grid-element/12099
**Category:** ParaView Support
**Tags:** vtk
**Created:** [May 16, 2023, 12:37am UTC](https://discourse.paraview.org/t/i-want-to-assign-the-result-of-the-calculation-to-the-grid-element/12099 "2023-05-16T00:37:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ZhangMT](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/z/85f322/32.png) [@ZhangMT](https://discourse.paraview.org/u/ZhangMT)
#### Post date: [May 16, 2023, 12:37am UTC](https://discourse.paraview.org/t/i-want-to-assign-the-result-of-the-calculation-to-the-grid-element/12099/1 "2023-05-16T00:37:54Z")

</div>

I can assign the result of the calculation to the grid node and then generate a VTK file; However, I want to assign the result of the calculation to the grid element, but I don’t know how to do that. Asking for help. Thank you

---

<div class="post-metadata">

### Author: ![SebastianSalazar42](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@SebastianSalazar42](https://discourse.paraview.org/u/SebastianSalazar42)
#### Post date: [May 16, 2023, 6:57am UTC](https://discourse.paraview.org/t/i-want-to-assign-the-result-of-the-calculation-to-the-grid-element/12099/2 "2023-05-16T06:57:08Z")

</div>

The question is not very clear, but you can assign info to a cell like the example below (ASCII Unstructured Grid). The scalar will be assigned to the grid element, not to the point.

CELL\_DATA 6  
SCALARS cell\_scalars int 1  
LOOKUP\_TABLE default  
0  
1  
2  
3  
4  
5

If you want to assign data to points, you can do something like this:

POINT\_DATA 27  
SCALARS scalars float 1  
LOOKUP\_TABLE default  
0.0 1.0 2.0 3.0 4.0 5.0  
6.0 7.0 8.0 9.0 10.0 11.0  
12.0 13.0 14.0 15.0 16.0 17.0  
18.0 19.0 20.0 21.0 22.0 23.0  
24.0 25.0 26.0  
VECTORS vectors float  
1 0 0 1 1 0 0 2 0 1 0 0 1 1 0 0 2 0  
1 0 0 1 1 0 0 2 0 1 0 0 1 1 0 0 2 0  
0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1  
0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1  
0 0 1 0 0 1 0 0 1

For more info refer to:  
“File Formats for VTK Version 4.2 (Taken from The VTK User’s Guide)”
