<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jul 28, 2016 at 3:43 PM, Andrew Ho <span dir="ltr"><<a href="mailto:andrewh0@uw.edu" target="_blank">andrewh0@uw.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><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-width:1px;border-left-style:solid;border-left-color: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-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> CHKERRQ(PetscQuadratureDestroy(&quad)); </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color: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-width:1px;border-left-style:solid;border-left-color: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" target="_blank">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" target="_blank">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></div></blockquote><div><br></div><div>This is strange. First, you should only have uninitialized classids if you build without dynamics libraries. Did you? If you</div><div>include the entire error output, it would show us.</div><div><br></div><div>If so, then PetscInitialize should set the value of this classid, unless you built this with PETSC_HAVE_DYNAMIC_LIBRARIES,</div><div>but linked against static libraries, as the error message says. Do you have multiple versions of PETSc on your machine?</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><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></div></blockquote><div><br></div><div>That is what it is supposed to be, but its not. We are changing this now. However, at the moment, order just means the</div><div>number of points/dim used to define the quadrature.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><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></div></blockquote><div><br></div><div>Agree completely.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><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></div></blockquote><div><br></div><div>I would set it to be the number of points now, since that is what should be fed to the low level routines. Then we will go through</div><div>and complete a higher layer that translates an order request into a number of points for each type.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span class="gmail-HOEnZb"><font color="#888888">-- <br><div><div dir="ltr">Andrew Ho</div></div></font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>