# How to align normal vector in one direction(out of the screen)

**URL:** <https://pyfr.discourse.group/t/how-to-align-normal-vector-in-one-direction-out-of-the-screen/629>\
**Category:** Cases\
**Tags:** mesh\
**Created:** [21 June 2022 18:58 UTC](https://pyfr.discourse.group/t/how-to-align-normal-vector-in-one-direction-out-of-the-screen/629 "2022-06-21T18:58:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hima](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@Hima](https://pyfr.discourse.group/u/Hima)\
**Post date:** [21 June 2022 18:58 UTC](https://pyfr.discourse.group/t/how-to-align-normal-vector-in-one-direction-out-of-the-screen/629/1 "2022-06-21T18:58:26Z")

</div>

Getting the runtime error due to Negative mesh Jacobians  
I don’t to know how to flip the orientation of vectors  
Here is my geo and mesh files:

[https://drive.google.com/file/d/1mtkXvMjgeNXSQzMcRNYg5unZO0rw4kof/view?usp=sharing](https://drive.google.com/file/d/1mtkXvMjgeNXSQzMcRNYg5unZO0rw4kof/view?usp=sharing)

[https://drive.google.com/file/d/1mtkXvMjgeNXSQzMcRNYg5unZO0rw4kof/view?usp=sharing](https://drive.google.com/file/d/1mtkXvMjgeNXSQzMcRNYg5unZO0rw4kof/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [29 June 2022 22:13 UTC](https://pyfr.discourse.group/t/how-to-align-normal-vector-in-one-direction-out-of-the-screen/629/2 "2022-06-29T22:13:36Z")

</div>

Sorry about the slow reply, this topic slipped by me. Sadly I don’t know to do it in gmsh, we generally advise using pointwise if you can. To do the flip you require in Pointwise there is a flip option in the edit menu.

---

<div class="post-metadata">

**Author:** ![nnunn](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@nnunn](https://pyfr.discourse.group/u/nnunn)\
**Post date:** [30 June 2022 16:05 UTC](https://pyfr.discourse.group/t/how-to-align-normal-vector-in-one-direction-out-of-the-screen/629/3 "2022-06-30T16:05:07Z")

</div>

Hi @Hima,  
As I recall, this sort of node-ordering issue only happens when using OpenCASCADE.  
In your sample gmsh geometry script, remove the line:

> SetFactory(“OpenCASCADE”);

gmsh will then use its own internal “factory”, which orders the nodes correctly for PyFR.
