# Mass matrix between non matching meshes

**URL:** <https://fenicsproject.discourse.group/t/mass-matrix-between-non-matching-meshes/19835>\
**Category:** dolfinx\
**Tags:** mesh, assembly, dolfinx\
**Created:** [September 27, 2026, 9:00pm UTC](https://fenicsproject.discourse.group/t/mass-matrix-between-non-matching-meshes/19835 "2026-09-27T21:00:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JanvdW](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/janvdw/32/9558_2.png) [@JanvdW](https://fenicsproject.discourse.group/u/JanvdW)\
**Post date:** [September 27, 2026, 9:00pm UTC](https://fenicsproject.discourse.group/t/mass-matrix-between-non-matching-meshes/19835/1 "2026-09-27T21:00:04Z")

</div>

Hi,

I have the following setup. I have two finite element spaces, T\_h and T\_H. The mesh of T\_h is a true refinement of the mesh of T\_H. Also, T\_h uses a cg Lagrange basis of degree one, while T\_H uses a dg Legendre basis of degree 2. I now want to calculate the mass matrix M between these two meshes, meaning

M\_{i,j} = \int\_\Omega \varphi\_i \psi\_j \, dx

where \varphi\_i is the i-th basis function of the coarse space and \psi\_j is the j-th basis function of the fine space.

As far as I understand this, this is only possible using interpolation on non-matching meshes since the functions must be defined on the same mesh for the dolfinx forms to work. Is there another option? For example, using the cell data from the refinement for some the calculation of some sort of prolongation matrix, to transform the normal mass matrix of the fine space into the matrix I am looking for?

Thanks a lot for your help!  
~ Jan
