Hi all!

I am trying to use DMPlexComputeIntegralFEM to compute an integral $\int_\Omega 
u d\Omega$. My domain is a square (-1, 1)^2 (2x2 QUAD4 elements), I add first 
order Lagrange FE field on it, set the solution vector (computed by a previous 
simulation).

The value I am seeing computed by PETSc is -4, but the hand-calculated value of 
this integral is -4.6. I also checked this in paraview using the ‘Integrate 
Variables’ filter and it also returns -4.6 (this was to double check that my 
hand-calculated value is correct).

So, I must be missing something obvious in my code. Attached is the minimal 
PETSc code to show what I am doing. This is against PETSc 3.19.4.

Thanks in advance for your help,

David

--


Attachment: main.cpp
Description: Binary data

Reply via email to