Copy Gridfunction values

Hi,

i have a geometry with left and right sided boundaries and a complex coefficient function, lets say cf.
Then i use
g = GridFunction(VectorH1(mesh))
g.Set(cf, definedon=mesh.Boundaries(“right”)). The coefficient function has different values on the left and right boundaries but my problemm is symmetric so i want to copy the values of this gridfunction to another gridfunction defined only on the left boundarie. Is there a way to do this?

It becomes easy if you identify left and right boundaries in the geometry, and generate a periodic mesh.

Then dofs on the left and right side can be identified. A Periodic finite element space wrapper builds this dofmap.

Here is an example. As dofmaps were not available from Python, you have to update to the latest ngsolve version from today,

copyperiodic.ipynb (2.0 KB)

What are the requirements for this? I am using miniconda with Python version 3.12.8 and when I try to install it with pip install ngsolve==6.2.2406.post111.dev1, the latest version it can install is the post36.dev1 version.

Now i can install it. But i have a question regarding the identification. I cannot use edges.Max or Min since i have arcs and i want to do this on the arcs which are not minimal or maximal in any direction. I gave them edges name during the geometry creation with arc(2, 90, “right”) for example. Can i also identify them in this way?