Hi Joachim,
Thanks for your reply, and thanks for pointing to the related thread
ngsolve.org/forum/ngspy-forum/949-nodal-...olant-available#2230
! I think the idea of introducing an auxiliary variable discussed there should also work for my problem.
However, I am wondering if there is an easier way of doing this by any chance. So I have the following two questions:
1. I am trying to assemble bilinear form B = BilinearForm(trialspace=V, testspace=Q) from the integral:
b(u,q)=\int q I_h(u \cdot u_0).
If the integral of the form \int I_h(something), I can see that numerical integration with points in the vertices does the job. However, in my case, by taking trial function u to be nodal basis \Phi_i in V and test function q to be nodal basis \Psi_j in Q, I can simplify:
\int \Psi_j I_h(\Phi_i \cdot u_0) = \int \Psi_j (\Phi_i \cdot c_i),
where c_i is a constant vector determined by nodal value of u_0 at x_i. Is it possible to use the symbolic integration to compute B_ij = \int \Psi_j (\Phi_i \cdot c_i)?
2. I also applied the idea of tutorial 2.10 to define an operator nodal_interpolation(func1,func2,fes1,fes2) interpolating func1\cdot func2 into fes2, where func1 and func2 belong to fes1. This works fine for the cases when func1 is GridFunction or CoefficientFunction. However, I need to apply this operator to a TrialFunction func1:
u,v = V.TrialFunction(), V.TestFunction()
p,q = Q.TrialFunction(), Q.TestFunction()
u_old = GridFunction(Vh)
u_old.Set(something)
w = nodal_interpolation(u,u_old,V,Q)
b = BilinearForm(trialspace=V, testspace=Q)
b += q * w * dx
b.Assemble()
but it seems that b.mat has all elements zero, and thus applying this interpolation operator to TrialFunction and using it in symbolic integration does not work. Is it possible to apply an interpolation to a TrialFunction and use it directly in symbolic integration?
Many thanks in advance.