# Usage of CellSize filter

**URL:** https://discourse.paraview.org/t/usage-of-cellsize-filter/8418
**Category:** ParaView Support
**Created:** [November 16, 2021, 3:47pm UTC](https://discourse.paraview.org/t/usage-of-cellsize-filter/8418 "2021-11-16T15:47:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![benediktB](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9f8e36/32.png) [@benediktB](https://discourse.paraview.org/u/benediktB)
#### Post date: [November 16, 2021, 3:47pm UTC](https://discourse.paraview.org/t/usage-of-cellsize-filter/8418/1 "2021-11-16T15:47:04Z")

</div>

Dear community,  
I simulate bubble collapses.  
With a pvbatch-script I want to calculate the volume of the bubble.  
I use the precompiled version ParaView-5.10.0-RC1-osmesa-MPI-Linux-Python3.9-x86\_64  
The following function should do this:

```auto
def Process( file ):
   xdmf = pv.Xdmf3ReaderS( FileName = [file] )
   xdmf.CellArrays = ['levelset']
   bubble = createThreshold( xdmf )
   v = computeCellSize( bubble )
   i = np.sum(v)
   print(i)
   return i

```

The ´createThreshold´ function creates a dataset which contains only the bubble, therefore the name of its result. The `computeCellSize` function looks like this:

```auto
def computeCellSize( input_data ):
   cs = pv.CellSize(registrationName='CellSize1', Input=input_data)
   cs.ComputeVertexCount = 0
   cs.ComputeLength = 0
   cs.ComputeArea = 0
   size = cs.CellData.GetArray('Volume')
   return size

```

It returns the volume array to the `Process` function. However, the `i = np.sum(v)` line only returns `None` values.  
What is the reason for this?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 16, 2021, 3:52pm UTC](https://discourse.paraview.org/t/usage-of-cellsize-filter/8418/2 "2021-11-16T15:52:17Z")

</div>

UpdatePipeline ?

---

<div class="post-metadata">

### Author: ![benediktB](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9f8e36/32.png) [@benediktB](https://discourse.paraview.org/u/benediktB)
#### Post date: [November 16, 2021, 4:10pm UTC](https://discourse.paraview.org/t/usage-of-cellsize-filter/8418/3 "2021-11-16T16:10:09Z")

</div>

I added UpdatePipeline before the sum-line, but I keep getting `None`-values

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 16, 2021, 4:12pm UTC](https://discourse.paraview.org/t/usage-of-cellsize-filter/8418/4 "2021-11-16T16:12:01Z")

</div>

```auto
size = cs.CellData.GetArray('Volume')

```

This is wrong, you need to fetch the data from the server first.

---

<div class="post-metadata">

### Author: ![benediktB](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/9f8e36/32.png) [@benediktB](https://discourse.paraview.org/u/benediktB)
#### Post date: [November 17, 2021, 9:47am UTC](https://discourse.paraview.org/t/usage-of-cellsize-filter/8418/5 "2021-11-17T09:47:31Z")

</div>

Could you tell me how I can do that?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 17, 2021, 9:49am UTC](https://discourse.paraview.org/t/usage-of-cellsize-filter/8418/6 "2021-11-17T09:49:53Z")

</div>

Something like:

```auto
   cs.ComputeArea = 0
   cs.UpdatePipelline()
   dataset = servermanager.Fetch(cs)
   size = dataset.GetCellData().GetArray('Volume')

```
