This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

inner product of two dolfin::function with different meshes

0 votes

Thanks for your answer! What I would like to do is to calculate the inner product of two dolfin::functions v and w which have different FE meshes. And I would like to avoid interpolation or projection. Mathematically, this is possible. Say
v=\sum a_i phi_i and
w = \sum b_j psi_j.
Then, < v,w>L2 = \sum_i \sum_j a_i b_j <phi_i, psi_j>.
So I need to calculate the inner product of the finite element ansatz functions. How can I do this in Fenics when the meshes are different? So far, I was not able to get "access" to the FE ansatz functions. And I believe, there must be an easier way...?
I am very thankful for any help!!
frieder

related to an answer for: inner product of two dolfin::function
asked Jul 6, 2016 by frieder FEniCS Novice (340 points)

1 Answer

0 votes

The issue is that using a finite element method discretizes the problem. If you have two meshes then the basis functions phi_i on the first mesh and psi_i on the second mesh are probably going to be different. Often (always?) for finite element functions the inner product <phi_i, psi_j> is a kronecker delta. For two different meshes you will not have many (if any) functions phi_i and psi_j that are identical and your sum will be way off what you want. I don't think you will be able to get around this without projecting or interpolating.

answered Jul 6, 2016 by aldenpack FEniCS User (1,450 points)
...