On Thu, Jul 28, 2016 at 3:43 PM, Andrew Ho <andre...@uw.edu> wrote: > I am trying to create a very simple quadrature object, but for some reason > PETSc keeps giving me an "invalid argument" error. > > Relevant code: > > #include <petsc.h> >> int main(int argc, char** argv) >> { >> CHKERRQ(PetscInitialize(&argc, &argv, nullptr, "quadrature testing")); >> PetscQuadrature quad; >> CHKERRQ(PetscQuadratureCreate(PETSC_COMM_SELF, &quad)); >> > CHKERRQ(PetscQuadratureDestroy(&quad)); > > CHKERRQ(PetscFinalize()); >> } > > > Error message: > >> >> [0]PETSC ERROR: --------------------- Error Message >> -------------------------------------------- >> ------------------ >> >> [0]PETSC ERROR: Invalid argument >> [0]PETSC ERROR: Invalid object classid 0 >> This could happen if you compile with PETSC_HAVE_DYNAMIC_LIBRARIES, but >> link with static libraries. >> >> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html >> for troubleshooting. >> [0]PETSC ERROR: Petsc Release Version 3.7.2, unknown >> [0]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O3 >> -march=native" CXXOPTFLAGS="-O3 -march=native" FOPTFLAGS="-O3 >> -march=native" --prefix=/usr/local >> [0]PETSC ERROR: #1 PetscClassRegLogGetClass() line 290 in >> /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c >> [0]PETSC ERROR: #2 PetscLogObjCreateDefault() line 317 in >> /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c >> [0]PETSC ERROR: #3 PetscQuadratureCreate() line 54 in >> /home/andrew/tools/petsc/petsc/src/dm/dt/interface/dt.c >> >> [0]PETSC ERROR: --------------------- Error Message >> -------------------------------------------------------------- >> >> [0]PETSC ERROR: Invalid argument >> [0]PETSC ERROR: Invalid object classid 0 >> This could happen if you compile with PETSC_HAVE_DYNAMIC_LIBRARIES, but >> link with static libraries. >> >> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html >> for troubleshooting. >> [0]PETSC ERROR: Petsc Release Version 3.7.2, unknown >> [0]PETSC ERROR: Configure options --with-debugging=0 COPTFLAGS="-O3 >> -march=native" CXXOPTFLAGS=" >> -O3 -march=native" FOPTFLAGS="-O3 -march=native" --prefix=/usr/local >> [0]PETSC ERROR: #4 PetscClassRegLogGetClass() line 290 in >> /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c >> >> [0]PETSC ERROR: #5 PetscLogObjCreateDefault() line 317 in >> /home/andrew/tools/petsc/petsc/src/sys/logging/utils/classlog.c >> >> [0]PETSC ERROR: #6 PetscQuadratureCreate() line 54 in >> /home/andrew/tools/petsc/petsc/src/dm/dt/interface/dt.c >> >> [0]PETSC ERROR: #7 main() line 5 in /home/user/tests/pquad.cpp >> [0]PETSC ERROR: No PETSc Option Table entries >> [0]PETSC ERROR: ----------------End of Error Message -------send entire >> error message to petsc-ma...@mcs.anl.gov---------- > > > 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. >
This is strange. First, you should only have uninitialized classids if you build without dynamics libraries. Did you? If you include the entire error output, it would show us. If so, then PetscInitialize should set the value of this classid, unless you built this with PETSC_HAVE_DYNAMIC_LIBRARIES, but linked against static libraries, as the error message says. Do you have multiple versions of PETSc on your machine? > 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. > That is what it is supposed to be, but its not. We are changing this now. However, at the moment, order just means the number of points/dim used to define the quadrature. > 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. > Agree completely. > 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? > 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 and complete a higher layer that translates an order request into a number of points for each type. Matt > -- > Andrew Ho > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener