# Node ordering and volume computation

**URL:** https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826
**Category:** ParaView Support
**Created:** [November 21, 2022, 5:52pm UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826 "2022-11-21T17:52:59Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![philippeVerney](https://discourse.paraview.org/user_avatar/discourse.paraview.org/philippeverney/32/5670_2.png) [@philippeVerney](https://discourse.paraview.org/u/philippeVerney)
#### Post date: [November 21, 2022, 5:52pm UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/1 "2022-11-21T17:52:59Z")

</div>

Hi all,

I have created a small unstructured grid with a tetrahedron (in red) and a wedge (in blue).

 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/8d6a240286ed6c5b7d871679dd6bd8b5f564aa2d.png)

The node ordering for the tetrahedron is : 2 1 0 3  
The node ordering for the wedge is : 0 1 2 4 5 6  
I think this is the correct ordering looking at [https://kitware.github.io/vtk-examples/site/VTKBook/05Chapter5/#Figure%205-2](https://kitware.github.io/vtk-examples/site/VTKBook/05Chapter5/#Figure%205-2)

However when I apply a “cell size” filter on it, I have a (nice) positive value for the tetrahedron but a (bad) negative volume for the wedge. See color bar in above screenshot

I cannot understand what I am missing. Could you help me please?

Remarks :

- If I modify the node ordering of the wedge to 2, 0, 1, 6, 4, 5 its volume is correctly computed.
- If I modify the node ordering of the wedge to 2, 1, 0, 6, 5, 4 its volume is correctly computed.

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [November 21, 2022, 6:09pm UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/2 "2022-11-21T18:09:17Z")

</div>

Hi @philippeVerney and welcome to ParaView discourse !

From the documentation you cited notice that using the right hand rule the normal of the first triangular face points outwards and the second points inwards.

In your case (012) points inwards and (456) outwards switching to your  
second suggestion (210) and (654) follows the order above.

---

<div class="post-metadata">

### Author: ![philippeVerney](https://discourse.paraview.org/user_avatar/discourse.paraview.org/philippeverney/32/5670_2.png) [@philippeVerney](https://discourse.paraview.org/u/philippeVerney)
#### Post date: [November 22, 2022, 7:50am UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/3 "2022-11-22T07:50:35Z")

</div>

Thanks @Christos_Tsolakis for the answer.

I agree that 012 points inwards and 456 points outwards in my example.  
However, to me, the VTK documentation states the same : 012 points inwards and 345 points outwards in the hereunder figure  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/c/cdfe32bdb54b389508eff752327471e10aba7e8b.png)

Furthermore, in my example, 201 645 works which is the same orientation than 012 456 which does not work.

I still think that I unfortunately miss something…

---

<div class="post-metadata">

### Author: ![philippeVerney](https://discourse.paraview.org/user_avatar/discourse.paraview.org/philippeverney/32/5670_2.png) [@philippeVerney](https://discourse.paraview.org/u/philippeVerney)
#### Post date: [November 22, 2022, 8:06am UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/4 "2022-11-22T08:06:41Z")

</div>

[This VTK documentation](https://vtk.org/doc/nightly/html/classvtkWedge.html#details) states exactly what @Christos_Tsolakis just answered :

> The wedge is defined by the six points (0-5) where (0,1,2) is the base of the wedge which, using the right hand rule, forms a triangle whose normal points outward (away from the triangular face (3,4,5))

I might be wrong in my right hand rule application but, still to me, the figure ‘m’ in [this VTK documentation](https://kitware.github.io/vtk-examples/site/VTKBook/05Chapter5/#Figure%205-2) shows the opposite : the face 0 1 2 points inwards (i.e. towards the triangular face 3,4,5) using right hand rule.

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [November 23, 2022, 1:29am UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/5 "2022-11-23T01:29:19Z")

</div>

> [@philippeVerney](#):
>
> Furthermore, in my example, 201 645 works which is the same orientation than 012 456 which does not work.

That seems like a bug to me.

> [@philippeVerney](#):
>
> I might be wrong in my right hand rule application but, still to me, the figure ‘m’ in [this VTK documentation](https://kitware.github.io/vtk-examples/site/VTKBook/05Chapter5/#Figure%205-2) shows the opposite : the face 0 1 2 points inwards (i.e. towards the triangular face 3,4,5) using right hand rule.

That would be my interpretation as well. The 012 face points inwards.

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [November 23, 2022, 9:27pm UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/6 "2022-11-23T21:27:58Z")

</div>

You are right that figure looks wrong. Here is another example along with the code  
[https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/LinearCellDemo/](https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/LinearCellDemo/)

---

<div class="post-metadata">

### Author: ![philippeVerney](https://discourse.paraview.org/user_avatar/discourse.paraview.org/philippeverney/32/5670_2.png) [@philippeVerney](https://discourse.paraview.org/u/philippeVerney)
#### Post date: [November 24, 2022, 8:43am UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/7 "2022-11-24T08:43:58Z")

</div>

Thanks for your answers.  
I then [report the bug on VTK side](https://discourse.vtk.org/t/bug-in-documentation-figure-on-wedge-node-ordering/9946).

---

<div class="post-metadata">

### Author: ![Ramzi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ramzi/32/11543_2.png) [@Ramzi](https://discourse.paraview.org/u/Ramzi)
#### Post date: [May 9, 2023, 7:37am UTC](https://discourse.paraview.org/t/node-ordering-and-volume-computation/10826/8 "2023-05-09T07:37:54Z")

</div>

> [@Christos\_Tsolakis](#):
>
> igure looks wrong. Here is a

Hello @Christos_Tsolakis @philippeVerney,

I saw that the reported bug was fixed and the figure of the linear wedge nodes’ ordering was updated accordingly. However, I was wondering if nodes’ ordering for quadratic wedges in the documentation also needed to be corrected ?

I faced same observationfir the quadratic wedge.

Thank you
