This article outlines how to use Flows to perform simple mathematical operations on a grid. This requires using three flows building blocks:
- GridInput
- GridMath
- GridOutput
The assembled flow is shown below:
![](https://i0.wp.com/www.danomics.com/wp-content/uploads/2021/01/image-21.png?resize=692%2C192&ssl=1)
In the GridInput I choose a previously generated grid.
![](https://i0.wp.com/www.danomics.com/wp-content/uploads/2021/01/image-23.png?resize=667%2C182&ssl=1)
In the GridMath I enter a formula. In this case we use the protected “value” key word. I used the following expression:
clamp(value, 0, 0.25)^2
This clamps the value of he grid to be between 0 and 0.25 and then squares that value. This expression has no importance, but I wanted to demonstrate the operation of clamping the values and then doing additional math on top of that (in this case squaring the value).
![](https://i0.wp.com/www.danomics.com/wp-content/uploads/2021/01/image-24.png?resize=750%2C171&ssl=1)
And finally we write out the new grid using the GridOutput block. Note that they grid will be written to the folder that contains the flow.