<div dir="ltr">I am trying to create a very simple quadrature object, but for some reason PETSc keeps giving me an "invalid argument" error.<div><br></div><div>Relevant code:</div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">#include <petsc.h><br>int main(int argc, char** argv)<br>{<br>  CHKERRQ(PetscInitialize(&argc, &argv, nullptr, "quadrature testing"));<br>  PetscQuadrature quad;<br>  CHKERRQ(PetscQuadratureCreate(PETSC_COMM_SELF, &quad));<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  CHKERRQ(PetscQuadratureDestroy(&quad)); </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  CHKERRQ(PetscFinalize());<br>}</blockquote></div><div><br></div><div>Error message:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------<br>------------------                                                                             <br>[0]PETSC ERROR: Invalid argument<br>[0]PETSC ERROR: Invalid object classid 0<br>This could happen if you compile with PETSC_HAVE_DYNAMIC_LIBRARIES, but link with static libraries.                                                                                            <br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for troubleshooting.<br>[0]PETSC ERROR: Petsc Release Version 3.7.2, unknown <br>[0]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O3 -march=native" CXXOPTFLAGS="-O3 -march=native" FOPTFLAGS="-O3 -march=native" --prefix=/usr/local<br>[0]PETSC ERROR: #1 PetscClassRegLogGetClass() line 290 in /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c<br>[0]PETSC ERROR: #2 PetscLogObjCreateDefault() line 317 in /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c<br>[0]PETSC ERROR: #3 PetscQuadratureCreate() line 54 in /home/andrew/tools/petsc/petsc/src/dm/dt/interface/dt.c                                                                <br>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------                                                                             <br>[0]PETSC ERROR: Invalid argument<br>[0]PETSC ERROR: Invalid object classid 0<br>This could happen if you compile with PETSC_HAVE_DYNAMIC_LIBRARIES, but link with static libraries.                                                                                            <br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for troubleshooting.<br>[0]PETSC ERROR: Petsc Release Version 3.7.2, unknown <br>[0]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O3 -march=native" CXXOPTFLAGS="<br>-O3 -march=native" FOPTFLAGS="-O3 -march=native" --prefix=/usr/local<br>[0]PETSC ERROR: #4 PetscClassRegLogGetClass() line 290 in /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c                                                    <br>[0]PETSC ERROR: #5 PetscLogObjCreateDefault() line 317 in /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c                                                    <br>[0]PETSC ERROR: #6 PetscQuadratureCreate() line 54 in /home/andrew/tools/petsc/petsc/src/dm/dt/interface/dt.c                                                                <br>[0]PETSC ERROR: #7 main() line 5 in /home/user/tests/pquad.cpp<br>[0]PETSC ERROR: No PETSc Option Table entries<br>[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint@mcs.anl.gov----------</blockquote><div><br clear="all"><div>I've had no problems using other parts of PETSc with the exact same build options/install (SNES, linear solvers), so I suspect this is likely just user error. I have tried building PETSc both as a shared and static library, and both methods fail in the same way.</div><div><br></div><div>As a related question, what is the "Order" of quadrature object suppose to be? The documentation for "PetscQuadratureGetOrder" and "PetscQuadratureSetOrder" says this is the highest degree polynomial that is exactly integrated.</div><div><br></div><div>However, when I looked at the source code for "PetscDTGaussTensorQuadrature", this appears to set the order to the number of quadrature points, which for Gaussian quadrature means it can integrate a 2*npoints-1 polynomial exactly.</div><div><br></div><div>If I wanted to implement my own quadrature scheme (Gauss-Lobatto) which is exact for polynomials up to 2*npoints-3, what should I set the quadrature order to?</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Andrew Ho</div></div></div></div>