<div dir="ltr"> PetscFECreateLagrange(comm, dim, 1, simplex, 1, PETSC_DETERMINE, &fe);<div><br></div><div>The default may be qorder = 0.</div><div>Replace PETSC_DETERMINE with 1, 2, etc, and see.</div><div><br></div><div>Thanks,</div><div>Mark</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 8, 2023 at 6:26 PM David Andrs <<a href="mailto:andrsd@gmail.com">andrsd@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all!<br>
<br>
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).<br>
<br>
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).<br>
<br>
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.<br>
<br>
Thanks in advance for your help,<br>
<br>
David<br>
<br>
--<br>
<br>
<br>
</blockquote></div>