# Grid function coefficients

**URL:** <https://bempp.discourse.group/t/grid-function-coefficients/49>\
**Category:** Bempp\
**Created:** [1 December 2020 10:51 UTC](https://bempp.discourse.group/t/grid-function-coefficients/49 "2020-12-01T10:51:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Peter](https://bempp.discourse.group/u/Peter)\
**Post date:** [1 December 2020 10:51 UTC](https://bempp.discourse.group/t/grid-function-coefficients/49/1 "2020-12-01T10:51:36Z")

</div>

Hi all,  
For my project I am interested in improving the accuracy of my solution with higher order functions, therefore I am restricted to using the legacy version of bempp.  
My question is about coefficients, both in the specifying the grid function and in the solution. How do I know what interpolation points the coefficients belong to? The coefficients that belong to the nodes are obvious, but for defining the grid function how do I map my data to the mesh? I can`t seem to find information about this in the documentation.

Thanks in advance,  
Peter

---

<div class="post-metadata">

**Author:** ![timo](https://yyz2.discourse-cdn.com/free1/user_avatar/bempp.discourse.group/timo/32/7_2.png) [@timo](https://bempp.discourse.group/u/timo)\
**Post date:** [7 January 2021 13:43 UTC](https://bempp.discourse.group/t/grid-function-coefficients/49/2 "2021-01-07T13:43:24Z")

</div>

Hi Peter,

this is very legacy code. I would have to dig deep into the basis functions from the Dune library that we were using in the legacy version. We will eventually implement at least quadratic functions for the new Bempp-cl. But this is not a priority at the moment.

---

<div class="post-metadata">

**Author:** ![arieder](https://avatars.discourse-cdn.com/v4/letter/a/71e660/32.png) [@arieder](https://bempp.discourse.group/u/arieder)\
**Post date:** [1 February 2021 10:41 UTC](https://bempp.discourse.group/t/grid-function-coefficients/49/3 "2021-02-01T10:41:57Z")

</div>

Hi,  
just a quick note, since I encountered this issue when coupling ngsolve to bempp:  
On the reference element, the degrees of freedom are the lagrange nodes for the points generated by the following snippet:

> ```
> nd=int((k+1)*(k+2)/2) ##number of degrees of freedom on the reference element
> if k == 0:
> eval_pts = [(1/3, 1/3)] # center point
> else:
> eval_pts = [(i/k, j/k) for j in range(k+1) for i in range(k-j+1)]
> 
> ```

You then probably have to use the local\_to\_global map to get to the real coefficients. Maybe you can look at [https://github.com/arieder/ngbem/blob/master/ngbem.py](https://github.com/arieder/ngbem/blob/master/ngbem.py) for inspiration.

best,  
Alex

---

<div class="post-metadata">

**Author:** ![Peter](https://avatars.discourse-cdn.com/v4/letter/p/278dde/32.png) [@Peter](https://bempp.discourse.group/u/Peter)\
**Post date:** [1 February 2021 11:01 UTC](https://bempp.discourse.group/t/grid-function-coefficients/49/4 "2021-02-01T11:01:44Z")

</div>

Thank you both for your reply. I dug through the source code and have come to the same conclusion.

Kind regards,  
Peter
