Hi,
I was wondering how the interpolation coefficients for H(curl) order 2 functions are calculated in e.g. 2 dimensions?
Lets take e.g. one triangle. As far as I understand for order 1 the 3 coefficients c_i are calculated as follows
\vec{F}(P_i)\cdot \vec{e}_i=\left(\vec{N_i}(P_i)\cdot\vec{e}_i\right)\,c_i
where the P_i are the midpoints of the edges, the \vec{e}_i are the edge vectors, the \vec{N}_i are the base functions and \vec{F} is the given vector field.
For order 2 the vector field \vec{F} is calculated at 9 positions during interpolation (see below). How are the 8 coefficients determined finally?
Is there a way to get these positions from the dofmap?
import numpy as np
import dolfinx as dox
import ufl
from mpi4py import MPI
# points and elements to dolfin mesh
def pym2fm(p,t):
gdim = 2
shape = "triangle"
degree = 1
cell = ufl.Cell(shape, geometric_dimension=gdim)
domain = ufl.Mesh(ufl.VectorElement("Lagrange", cell, degree))
cells = np.array(t, dtype=np.int32)
mesh = dox.mesh.create_mesh(MPI.COMM_WORLD, cells, p, domain)
return mesh,mesh.geometry.x[:,[0,1]],mesh.geometry.dofmap.array.reshape(-1,3)
gxy=0
def VectorField(x):
global gxy
gxy = x.T
values = np.empty( (2, x.shape[1]) )
values[0] = x[0]
values[1] = 3*x[1]
return values
# Definition mesh
pois = [[0,0],[1,0.2],[0.5,1]]
tris = [[0,1,2]]
triangle,pt,tt=pym2fm(pois,tris)
# space and interpolation
order=2
VV = dox.fem.FunctionSpace(triangle, ("Nedelec 1st kind H(curl)", order))
uF = dox.fem.Function(VV)
uF.interpolate( VectorField )
print(gxy)
print(uF.x.array)