# Gradient export flag

**URL:** <https://pyfr.discourse.group/t/gradient-export-flag/527>\
**Category:** Development\
**Created:** [19 January 2022 00:36 UTC](https://pyfr.discourse.group/t/gradient-export-flag/527 "2022-01-19T00:36:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [19 January 2022 00:36 UTC](https://pyfr.discourse.group/t/gradient-export-flag/527/1 "2022-01-19T00:36:51Z")

</div>

Is anyone actively using the gradient export functionality of PyFR? That is to say `export -g …`? In my experience it tends to produce worse results than current versions of ParaView’s gradient of unstructured data set filter, and hence seems somewhat redundant.

Regards, Freddie.

---

<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:** [19 January 2022 13:24 UTC](https://pyfr.discourse.group/t/gradient-export-flag/527/2 "2022-01-19T13:24:26Z")

</div>

Yes, on occasion. Is it worth though understanding why the gradients from the -g flag are not always of the best quality? At least compared to the gradients in paraview.

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [20 January 2022 00:01 UTC](https://pyfr.discourse.group/t/gradient-export-flag/527/3 "2022-01-20T00:01:10Z")

</div>

The gradients come from simply differentiating the basis polynomials inside of each element without consideration for neighbouring elements. By comparison the ParaView filter, run after a clean to grid, can do a much better reconstruction by considering _all_ neighbours (including those which share common vertices — something which PyFR does not even have a concept of since we’re a discontinuous code).

---

<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:** [12 January 2023 08:24 UTC](https://pyfr.discourse.group/t/gradient-export-flag/527/4 "2023-01-12T08:24:04Z")

</div>

2 posts were split to a new topic: [Writing gradients to disk](https://pyfr.discourse.group/t/writing-gradients-to-disk/739)
