Use SurfaceL2 function as boundary data for Dirichlet problem

Hi,

I am using NGBem to solve a boundary integral problem on a 3D mesh. This then returns a function g in SurfaceL2. Since I want to solve a problem like the tutorial problem, I now need to extend g to a H1 function, defined as zero in the interior, and equal to g on the full surface outer. The order of all spaces is 1. An interpolant is fine, or some projection method is fine. I am not sure how to implement this. Imagine it is structured like the following:

def interpolate_surface(g: GridFunction, mesh: Mesh) -> GridFunction:
    #some interpolation method, relating
    #the `SurfaceL2` GridFunction `g`
    #to a `H1` GridFunction `g_h`
    return g_h

like in https://docu.ngsolve.org/latest/i-tutorials/unit-1.3-dirichlet/dirichlet.html, using u.Set(g, BND), or for better control of the boundaries use

u_h.Set(g, definedon=mesh.Boundaries("bottom|right"))

Joachim

Hi,

Yes, that has worked, thank you very much!