# Development

**URL:** https://pyfr.discourse.group/c/dev/14.md

[Latest](https://pyfr.discourse.group/latest.md) · [Categories](https://pyfr.discourse.group/categories.md) · [Tags](https://pyfr.discourse.group/tags.md)

---

## [About the Development category](https://pyfr.discourse.group/t/about-the-development-category/789)

<div class="topic-metadata">

**Author:** [@WillT](https://pyfr.discourse.group/u/WillT)\
**Replies:** 0

</div>

Category for question about developing PyFR. This is broad category for people to discuss PyFR development. For exmple, if you have a question how some feature works, or how you might implement some functionality this i…

---

## [Calculating Average of Variable at Periodic Boundary](https://pyfr.discourse.group/t/calculating-average-of-variable-at-periodic-boundary/1343)

<div class="topic-metadata">

**Author:** [@fredmorin18](https://pyfr.discourse.group/u/fredmorin18)\
**Replies:** 4\
**Last updated:** [25 February 2026 00:58 UTC](https://pyfr.discourse.group/t/calculating-average-of-variable-at-periodic-boundary/1343 "2026-02-25T00:58:26Z")

</div>

Hello, I’ve been able to split the periodic faces from the rest of the internal faces, and I use a class similar to the internal interfaces class to handle the periodic interfaces and some mako kernels to decouple the f…

---

## [Mixed periodic/non-periodic BC for scalar transport](https://pyfr.discourse.group/t/mixed-periodic-non-periodic-bc-for-scalar-transport/693)

<div class="topic-metadata">

**Author:** [@EitanA](https://pyfr.discourse.group/u/EitanA)\
**Replies:** 6\
**Last updated:** [23 February 2026 03:12 UTC](https://pyfr.discourse.group/t/mixed-periodic-non-periodic-bc-for-scalar-transport/693 "2026-02-23T03:12:07Z")

</div>

Hello all I’ve added a passive scalar to PyFR and now I am looking to create periodic flow b.c. with inlet-outlet conditions for the passive scalar. Is there a simple way to achieve such a thing? Any help would be app…

---

## [Weak-Prescribed BCs](https://pyfr.discourse.group/t/weak-prescribed-bcs/1294)

<div class="topic-metadata">

**Author:** [@boundaryconditions](https://pyfr.discourse.group/u/boundaryconditions)\
**Replies:** 1\
**Last updated:** [5 September 2025 23:04 UTC](https://pyfr.discourse.group/t/weak-prescribed-bcs/1294 "2025-09-05T23:04:11Z")

</div>

Hi, I would like to explore some weak-prescribed boundary conditions mentioned in “A Guide to the Implementation of Boundary Conditions in Compact High-Order Methods for Compressible Aerodynamics”, Mengaldo et al. Most o…

---

## [OpenMP gradient fusion](https://pyfr.discourse.group/t/openmp-gradient-fusion/1278)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 9\
**Last updated:** [23 July 2025 14:20 UTC](https://pyfr.discourse.group/t/openmp-gradient-fusion/1278 "2025-07-23T14:20:17Z")

</div>

Hi, what is the reason for which the openMP doesn’t do gradient fusion? Purely optimization or anything else one should be aware? Best

---

## [Kernel calling dimensions](https://pyfr.discourse.group/t/kernel-calling-dimensions/1272)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 1\
**Last updated:** [28 June 2025 08:29 UTC](https://pyfr.discourse.group/t/kernel-calling-dimensions/1272 "2025-06-28T08:29:02Z")

</div>

Hi, I am trying to schedule the following kernel \<%pyfr:kernel name='wspeed' ndim='1' usol='in fpdtype\_t\[${str(nupts)}\]\[${str(nvars)}\]' clen='in fpdtype\_t' wsp='inout fpd…

---

## [Gradient fusion](https://pyfr.discourse.group/t/gradient-fusion/1269)

<div class="topic-metadata">

**Author:** [@Zhenyang](https://pyfr.discourse.group/u/Zhenyang)\
**Replies:** 5\
**Last updated:** [27 May 2025 15:05 UTC](https://pyfr.discourse.group/t/gradient-fusion/1269 "2025-05-27T15:05:14Z")

</div>

Hi, I want to understand how the gradient fusion work in PyFR. As my understanding, if gradient fusion is enabled, transformed corrected gradients are stored in the self.\_grad\_upts, transform is done by the kernel ‘eles…

---

## [Save view matrices](https://pyfr.discourse.group/t/save-view-matrices/1150)

<div class="topic-metadata">

**Author:** [@Zhenyang](https://pyfr.discourse.group/u/Zhenyang)\
**Replies:** 10\
**Last updated:** [12 May 2025 12:25 UTC](https://pyfr.discourse.group/t/save-view-matrices/1150 "2025-05-12T12:25:41Z")

</div>

Hi, I want to save view matrices from the first step to be used in the following computation. I want to use copy kernel to do this job but before that, I need allocate corresponding memory for that via backend.matrix(sh…

---

## [Updating the solution array on fly](https://pyfr.discourse.group/t/updating-the-solution-array-on-fly/1255)

<div class="topic-metadata">

**Author:** [@Zhenyang](https://pyfr.discourse.group/u/Zhenyang)\
**Replies:** 1\
**Last updated:** [28 April 2025 16:06 UTC](https://pyfr.discourse.group/t/updating-the-solution-array-on-fly/1255 "2025-04-28T16:06:50Z")

</div>

Hi, I want to update my solution array scal\_upt while running. My scal\_upts in copied to host to do some operations, and then I want to send it back to device to replace the array scal\_upt on the device end. Is there an…

---

## [Kernels for corrected gradient at interface](https://pyfr.discourse.group/t/kernels-for-corrected-gradient-at-interface/1238)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 17\
**Last updated:** [7 April 2025 18:44 UTC](https://pyfr.discourse.group/t/kernels-for-corrected-gradient-at-interface/1238 "2025-04-07T18:44:03Z")

</div>

Hi, I was trying to schedule a graph to compute the corrected gradients at some boundary interfaces. But when trying use the graphs below, the values I get are not exactly correct. Is there any dependency I am missing? …

---

## [Velocity Neumann BC for Walls](https://pyfr.discourse.group/t/velocity-neumann-bc-for-walls/1236)

<div class="topic-metadata">

**Author:** [@j1woo](https://pyfr.discourse.group/u/j1woo)\
**Replies:** 5\
**Last updated:** [25 March 2025 12:53 UTC](https://pyfr.discourse.group/t/velocity-neumann-bc-for-walls/1236 "2025-03-25T12:53:47Z")

</div>

Hello, So far, I have been using dirichlet BC’s on no-slip walls to implicitly specify shear stress. Is it possible to directly specify neumann BC’s on the walls for velocity without specifying the dirichlet? So far, …

---

## [Reduction on two dimensional arrays](https://pyfr.discourse.group/t/reduction-on-two-dimensional-arrays/1228)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 4\
**Last updated:** [6 March 2025 14:58 UTC](https://pyfr.discourse.group/t/reduction-on-two-dimensional-arrays/1228 "2025-03-06T14:58:56Z")

</div>

Hi, I would like to know if the reduction kernel could be adapted to work on arrays whose ioshape is not three-dimensional (e.g. nupts, nvars, neles) but rather bidimensional (e.g. nvars, neles) and still perform a redu…

---

## [Broadcasting terms to kernels](https://pyfr.discourse.group/t/broadcasting-terms-to-kernels/1119)

<div class="topic-metadata">

**Author:** [@Zhenyang](https://pyfr.discourse.group/u/Zhenyang)\
**Replies:** 13\
**Last updated:** [5 March 2025 12:48 UTC](https://pyfr.discourse.group/t/broadcasting-terms-to-kernels/1119 "2025-03-05T12:48:42Z")

</div>

Hi, I want to have a forcing term (line tripping, as equation 2.2 in the paper Turbulent boundary layers at moderate Reynolds numbers: inflow length and tripping effects | Journal of Fluid Mechanics | Cambridge Core) su…

---

## [Sampling functionality for WMLES Boundary Conditions](https://pyfr.discourse.group/t/sampling-functionality-for-wmles-boundary-conditions/1214)

<div class="topic-metadata">

**Author:** [@j1woo](https://pyfr.discourse.group/u/j1woo)\
**Replies:** 2\
**Last updated:** [14 February 2025 13:57 UTC](https://pyfr.discourse.group/t/sampling-functionality-for-wmles-boundary-conditions/1214 "2025-02-14T13:57:20Z")

</div>

Hello, In the context of developing a wall model, I have been writing my own boundary condition files involving preliminary computations within the prepare method. Specifically, I have been having trouble identifying wh…

---

## [Expressions for boundary condition as a function of neural-network outputs](https://pyfr.discourse.group/t/expressions-for-boundary-condition-as-a-function-of-neural-network-outputs/1189)

<div class="topic-metadata">

**Author:** [@boundaryconditions](https://pyfr.discourse.group/u/boundaryconditions)\
**Replies:** 17\
**Last updated:** [16 December 2024 15:38 UTC](https://pyfr.discourse.group/t/expressions-for-boundary-condition-as-a-function-of-neural-network-outputs/1189 "2024-12-16T15:38:14Z")

</div>

Hi, I am trying to reproduce a study of active flow control of the flow over a 2D cylinder with 2 jets positioned at ±90 degrees. I am solving the compressible NS equations for now. As a start, I set the boundary conditi…

---

## [Get gradients at the flux points](https://pyfr.discourse.group/t/get-gradients-at-the-flux-points/1179)

<div class="topic-metadata">

**Author:** [@Zhenyang](https://pyfr.discourse.group/u/Zhenyang)\
**Replies:** 1\
**Last updated:** [22 October 2024 01:55 UTC](https://pyfr.discourse.group/t/get-gradients-at-the-flux-points/1179 "2024-10-22T01:55:47Z")

</div>

Hi, I am using \_compute\_basegrads\_graph to calculate the gradient of solution to be used in the simulation. And furthermore, I also want to get gradient at the flux points. So I simply add the following expressions in t…

---

## [Caching in the macro kernal](https://pyfr.discourse.group/t/caching-in-the-macro-kernal/1175)

<div class="topic-metadata">

**Author:** [@Zhenyang](https://pyfr.discourse.group/u/Zhenyang)\
**Replies:** 3\
**Last updated:** [15 October 2024 15:06 UTC](https://pyfr.discourse.group/t/caching-in-the-macro-kernal/1175 "2024-10-15T15:06:27Z")

</div>

Hi, I have implemented a piece of code adding a body forcing with a number of Fourier mode with random phase. The random phases will be updated while run time so it has been passed by the external variable hphs0: \<%pyf…

---

## [PyFR 2.0.2 Update question about graph feature](https://pyfr.discourse.group/t/pyfr-2-0-2-update-question-about-graph-feature/1144)

<div class="topic-metadata">

**Author:** [@luli](https://pyfr.discourse.group/u/luli)\
**Replies:** 1\
**Last updated:** [7 August 2024 11:44 UTC](https://pyfr.discourse.group/t/pyfr-2-0-2-update-question-about-graph-feature/1144 "2024-08-07T11:44:27Z")

</div>

“Upon upgrading to PyFR version 2.0.2, I observed the integration of “cudagraph” into the CUDA backend, which is a significant enhancement. However, I noticed that this feature does not appear to have been implemented fo…

---

## [Options when running kernels](https://pyfr.discourse.group/t/options-when-running-kernels/1142)

<div class="topic-metadata">

**Author:** [@Zhenyang](https://pyfr.discourse.group/u/Zhenyang)\
**Replies:** 1\
**Last updated:** [31 July 2024 12:44 UTC](https://pyfr.discourse.group/t/options-when-running-kernels/1142 "2024-07-31T12:44:17Z")

</div>

Hi, I wonder what is the difference between run\_kernels and run\_graph? Is that just running a single kernel and a batch of them? Regards, Zhenyang

---

## [Gradients in 1D kernels](https://pyfr.discourse.group/t/gradients-in-1d-kernels/1109)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 1\
**Last updated:** [11 June 2024 15:58 UTC](https://pyfr.discourse.group/t/gradients-in-1d-kernels/1109 "2024-06-11T15:58:25Z")

</div>

Hello, I would like to introduce the gradients at solution points in a 1D kernel (.e.g entropyfilter) to access them in the form: gradu='in fpdtype\_t\[${str(nupts)}\]\[${str(nvars)}\]\[${str(ndims)}\]' Is it possible? If so…

---

## [Continuous gradients at the interface](https://pyfr.discourse.group/t/continuous-gradients-at-the-interface/1103)

<div class="topic-metadata">

**Author:** [@learner91](https://pyfr.discourse.group/u/learner91)\
**Replies:** 3\
**Last updated:** [6 June 2024 17:47 UTC](https://pyfr.discourse.group/t/continuous-gradients-at-the-interface/1103 "2024-06-06T17:47:05Z")

</div>

Hello, is there any possibility to obtain continuous gradients and continuous solutions at elements interface in PyFR? If so which steps one should follow? I was running the PyFR test case double mach reflections and I…

---

## [Solution value at the flux point](https://pyfr.discourse.group/t/solution-value-at-the-flux-point/1007)

<div class="topic-metadata">

**Author:** [@fei](https://pyfr.discourse.group/u/fei)\
**Replies:** 9\
**Last updated:** [30 January 2024 12:48 UTC](https://pyfr.discourse.group/t/solution-value-at-the-flux-point/1007 "2024-01-30T12:48:20Z")

</div>

Hello everyone, I want to calculate the solution value at the flux point, Q\_{i,FP} = Q\_{i,j}\*L\_{i,j}(x\_{i,FP},y\_{i,FP}), where Q\_{i,j} is solution at solution point, x\_{i,FP} and y\_{i,FP} is the coordinate of the flux p…

---

## [Adding custom function to backend kernels](https://pyfr.discourse.group/t/adding-custom-function-to-backend-kernels/1010)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 1\
**Last updated:** [2 January 2024 10:40 UTC](https://pyfr.discourse.group/t/adding-custom-function-to-backend-kernels/1010 "2024-01-02T10:40:14Z")

</div>

Hi, I would like to know how can I add a function on the backend. I tried with different syntax involving \_\_global\_\_ \_\_host\_\_ \_\_device\_\_ but none of them worked. I was tried to implement a function within a BC mako ker…

---

## [Boundary face pts](https://pyfr.discourse.group/t/boundary-face-pts/1009)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 7\
**Last updated:** [31 December 2023 17:36 UTC](https://pyfr.discourse.group/t/boundary-face-pts/1009 "2023-12-31T17:36:14Z")

</div>

Hello, how is it possible to access the face points that are on a boundary interface? I tried looking into \_scal\_lhs in the BC class but it has the face pts of all the sides of the element while I’m interested in getti…

---

## [Accessing solution at boundary surface](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980)

<div class="topic-metadata">

**Author:** [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Replies:** 4\
**Last updated:** [9 November 2023 09:17 UTC](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980 "2023-11-09T09:17:33Z")

</div>

Hello, I’m trying to get the solution on a boundary surface, but when I try to view it (together with the extracted mesh) there are “holes” between elements. I guess that I’m only getting the spts projected onto the sur…

---

## [Derivative of solution at solution points](https://pyfr.discourse.group/t/derivative-of-solution-at-solution-points/963)

<div class="topic-metadata">

**Author:** [@fei](https://pyfr.discourse.group/u/fei)\
**Replies:** 1\
**Last updated:** [31 October 2023 09:06 UTC](https://pyfr.discourse.group/t/derivative-of-solution-at-solution-points/963 "2023-10-31T09:06:36Z")

</div>

Hello, everyone, I want to obtain the derivative of all the solution points. And I am confused about something. In the navstokes/elements.py, velocity gradients, pressure gradient and density gradient are presented, b…

---

## [Accessing whole solution from neigbouring elements](https://pyfr.discourse.group/t/accessing-whole-solution-from-neigbouring-elements/938)

<div class="topic-metadata">

**Author:** [@fei](https://pyfr.discourse.group/u/fei)\
**Replies:** 0\
**Last updated:** [9 October 2023 02:39 UTC](https://pyfr.discourse.group/t/accessing-whole-solution-from-neigbouring-elements/938 "2023-10-09T02:39:45Z")

</div>

Hello, @tdzanic, I want to get whole solution across elements, as you said, mybe I need the plugins. Are there examples of plugins in pyfr? Could you give some more details? With best regards

---

## [Adjacent element solution](https://pyfr.discourse.group/t/adjacent-element-solution/930)

<div class="topic-metadata">

**Author:** [@fei](https://pyfr.discourse.group/u/fei)\
**Replies:** 11\
**Last updated:** [24 September 2023 12:50 UTC](https://pyfr.discourse.group/t/adjacent-element-solution/930 "2023-09-24T12:50:00Z")

</div>

Hello, Assuming a target element, then how to calculate the average value of adjacent element solutions within a target element? Could someone tell me the steps to implment in pyFR?

---

## [Questions about matrix](https://pyfr.discourse.group/t/questions-about-matrix/908)

<div class="topic-metadata">

**Author:** [@fei](https://pyfr.discourse.group/u/fei)\
**Replies:** 3\
**Last updated:** [1 September 2023 15:26 UTC](https://pyfr.discourse.group/t/questions-about-matrix/908 "2023-09-01T15:26:48Z")

</div>

Hello, I have some questions. What’s the meaning of the method “matrix”, “matrix\_slice”, “xchg\_matrix”? and where’s the definition of these methods? Second, assuming the element u\_{i}, how to get the left and right int…

---

## [Why are there device to device copies](https://pyfr.discourse.group/t/why-are-there-device-to-device-copies/904)

<div class="topic-metadata">

**Author:** [@luli](https://pyfr.discourse.group/u/luli)\
**Replies:** 1\
**Last updated:** [29 August 2023 16:38 UTC](https://pyfr.discourse.group/t/why-are-there-device-to-device-copies/904 "2023-08-29T16:38:42Z")

</div>

Hello , everyone ! I run tgv case TGV Performance Numbers - General - PyFR , and profile with nsys, I found there is DtoD operations . I only use one chip , why there is a copy operation ? Where does it appear in the…

[Next page](https://pyfr.discourse.group/c/dev/14.md?page=1)
