Given construction of mass matrix $M_{c}$ (with entries $m_{ij}$) and some diffusion operator $D$ (with entries $d_{ij}$) using assemble() and some data from functions called $b$ and $c$ on a 2D structured mesh with CG1 elements, I would like to compute the following pointwise:
$$ m_{ij} ( b_{i} - b_{j} ) + d_{ij} ( c_{i} - c_{j} ) $$
I know in parallel with a PETSc LA backend, the matrix is split in a row-oriented way and the tricky part will be accessing the values of $b$ and $c$ that are not locally owned. I'm also aware that looping over these entires is probably not the most efficient either.
Any suggestions would be helpful!
Thanks!