# Calculate Volume of Quadratic Tetrahedron

**URL:** https://discourse.vtk.org/t/calculate-volume-of-quadratic-tetrahedron/728
**Category:** Support
**Created:** [April 10, 2019, 11:54am UTC](https://discourse.vtk.org/t/calculate-volume-of-quadratic-tetrahedron/728 "2019-04-10T11:54:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![alx](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/59ef9b/32.png) [@alx](https://discourse.vtk.org/u/alx)
#### Post date: [April 10, 2019, 11:54am UTC](https://discourse.vtk.org/t/calculate-volume-of-quadratic-tetrahedron/728/1 "2019-04-10T11:54:59Z")

</div>

I have an unstructured mesh of quadratic tetrahedrons. I would like to calculate the volume of  
each cell, but I am only able to calculate the volume of a linear tetrahedron using vtk.vtkMeshQuality.TetVolume(cell). Is there any way or possible workaround to calculate the volume of nonlinear cells in vtk? Maybe using shape functions?

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [April 10, 2019, 1:30pm UTC](https://discourse.vtk.org/t/calculate-volume-of-quadratic-tetrahedron/728/2 "2019-04-10T13:30:46Z")

</div>

Welcome to the VTK Discourse , @alx. `vtkCellSize` should handle quadratic tetrahedrons. Give that a try.

---

<div class="post-metadata">

### Author: ![alx](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/a/59ef9b/32.png) [@alx](https://discourse.vtk.org/u/alx)
#### Post date: [April 11, 2019, 12:17pm UTC](https://discourse.vtk.org/t/calculate-volume-of-quadratic-tetrahedron/728/3 "2019-04-11T12:17:03Z")

</div>

Thank you for the hint! I tested the vtkCellSizeFilter and compared the results with vtkMeshQuality and the volume calculation by some finite element preprocessors.  
For my curved quadratic tetrahedron I get the following results:  
8.633 (vtkMeshQuality.TetVolume = linear tetrahedron formula)  
9.617 (vtkCellSizeFilter)  
9.946 (volume calculated by multiple FE preprocessors)  
Is there any change to further improve to accuracy?

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [April 11, 2019, 2:26pm UTC](https://discourse.vtk.org/t/calculate-volume-of-quadratic-tetrahedron/728/4 "2019-04-11T14:26:21Z")

</div>

I’m afraid I don’t see any available option to increase the refinement. I’ve sent a question to one of the authors of the filter to see if he can offer any guidance.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cory.quammen/32/6751_2.png) [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)
#### Post date: [April 11, 2019, 4:09pm UTC](https://discourse.vtk.org/t/calculate-volume-of-quadratic-tetrahedron/728/5 "2019-04-11T16:09:50Z")

</div>

> [@cory.quammen](#):
>
> I’ve sent a question to one of the authors of the filter to see if he can offer any guidance.

Is it possible that VTK represents quadratic tetrahedra differently from the other preprocessors?
