# Accessing solution at boundary surface

**URL:** <https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980>\
**Category:** Development\
**Created:** [8 November 2023 07:19 UTC](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980 "2023-11-08T07:19:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [8 November 2023 07:19 UTC](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980/1 "2023-11-08T07:19:50Z")

</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 surface but I’m missing the interface points.

The code is basically the one from the fluidforce plugin

```auto
for etype, fidx in self._m0:
            # Get the interpolation operator
            m0 = self._m0[etype, fidx]
            nfpts, nupts = m0.shape

            # Extract the relevant elements from the solution
            uupts = solns[etype][..., self._eidxs[etype, fidx]]

            # Interpolate to the face
            ufpts = m0 @ uupts.reshape(nupts, -1)
            ufpts = ufpts.reshape(nfpts, nvars, -1)
            ufpts = ufpts.swapaxes(0, 1)

```

And the resultant extracted surface is attached below

 ![IMG_0134](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/75c2601c4ecb181112550079ccea1af012e994e9.jpeg)

Any idea on how to solve this?

Best regards

---

<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:** [8 November 2023 08:46 UTC](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980/2 "2023-11-08T08:46:41Z")

</div>

There is some functionality in the recently merged `SurfaceMixin` that you might like to look at, as it does most of what you want. [https://github.com/PyFR/PyFR/blob/f922692c82fcdfcd9fc16e0310e46209a2fdf3c5/pyfr/plugins/base.py#L180](https://github.com/PyFR/PyFR/blob/f922692c82fcdfcd9fc16e0310e46209a2fdf3c5/pyfr/plugins/base.py#L180)

To fix the panel gaps, you might like to set the points you are interpolating to be either `gauss-legendre-lobatto` for quads/hexs, or `alpha-opt` for tris/tests.

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [8 November 2023 12:21 UTC](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980/3 "2023-11-08T12:21:40Z")

</div>

Thank you @WillT I’ll update you as soon as I can

---

<div class="post-metadata">

**Author:** ![Frankx9](https://avatars.discourse-cdn.com/v4/letter/f/3e96dc/32.png) [@Frankx9](https://pyfr.discourse.group/u/Frankx9)\
**Post date:** [8 November 2023 12:53 UTC](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980/4 "2023-11-08T12:53:40Z")

</div>

@WillT It works as expected, I really forgot that I was using GL points instead of GLL…!  
One last thing I need: say that my solver order is 4, hence a quad has 25 spts. How can I change the qdeg to be such that my number of points on the surface maches the number of spts?

Best regards

---

<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:** [9 November 2023 09:17 UTC](https://pyfr.discourse.group/t/accessing-solution-at-boundary-surface/980/5 "2023-11-09T09:17:33Z")

</div>

This is not something that the current code does by default, as it can only be done if the flux points are a subset of the solution points. But you might be able to modify the code to pull out the solution points on a face.
