How to compare the same function on different meshes

Hello,

To test accuracy, I would like to solve the same differential equation on different meshes and then compute the difference as integrals. Can I just naively subtract the two functions or do I need to do additional work to make the meshes line up?

Thank you for the help.