PETScWrappers and SLEPcWrappers error: "dealii::PETScWrappers::SparseMatrix’ is not a template" ... ...

84 views
Skip to first unread message

David

unread,
May 13, 2016, 3:16:39 AM5/13/16
to deal.II User Group
Hi, everyone:

 I am using the PETScWrappers and SLEPcWrappers to solve eigenproblems, but always get some error messages and failed to compile.
I used these two classes like step-36, but without using the MPI. The PETScWrappers is used as beolw:
      PETScWrappers::SparseMatrix<double>  stiffness_matrix, mass_matrix;
      std
::vector<PETScWrappers::Vector>   eigenfunctions;
      std
::vector<double>             eigenvalues;
and I use the SLEPcWrappers::SolverKrylovSchur to declare an eigensolver:

You see, Eclipse can't even know this class, And the compilation error is:                                                                                                                                                           

dealii::PETScWrappers::SparseMatrix is not a template
   
PETScWrappers::SparseMatrix<double>  stiffness_matrix, mass_matrix;

SLEPcWrappers has not been declared
   
SLEPcWrappers::SolverKrylovSchur eigensolver (solver_control);

error
: expected ‘;’ before eigensolver
   
SLEPcWrappers::SolverKrylovSchur eigensolver (solver_control);

error
: eigensolver was not declared in this scope
    eigensolver
.set_which_eigenpairs (EPS_SMALLEST_REAL);

EPS_SMALLEST_REAL was not declared in this scope
    eigensolver
.set_which_eigenpairs (EPS_SMALLEST_REAL);

EPS_GHEP was not declared in this scope
    eigensolver
.set_problem_type (EPS_GHEP);


I have already include both the PETSc and SLEPc header files. And I am using dealii 8.3 on the virtual mechiane downloaded from dealii website.


So what's the problem here, could anyone please give some suggestions?


Best regards,

David.



Ce Qin

unread,
May 13, 2016, 3:55:23 AM5/13/16
to dea...@googlegroups.com
The compiler says that dealii::PETScWrappers::SparseMatrix is not a template, so declare these variables as PETScWrappers::SparseMatrix  stiffness_matrix, mass_matrix.

I am not sure the reason of the SLEPc problem, perhaps you forgot the namespace dealii::?

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David

unread,
May 13, 2016, 6:59:53 AM5/13/16
to deal.II User Group
Hi, Ce Qin:

Thank you for your help, but the reason you pointed out might not work.

I think it might be that I have not configured the PETSc and SLEPc correctly, because I just found that I can't even run step-36.
The error message says:

ubuntu@dealvm ~/workspace/step-36 $ cmake .
CMake Error at CMakeLists.txt:41 (MESSAGE):
 

 
Error! The deal.II library found at /home/ubuntu/deal.II/installed was not
  configured
with

      DEAL_II_WITH_PETSC
= ON
      DEAL_II_WITH_SLEPC
= ON

 
One or all of these are OFF in your installation but are required for this
  tutorial step
.


-- Configuring incomplete, errors occurred!

But how can I change this configuration? I don't know where to find instructions about this. Could someone please tell me the steps or give me a link to the documentation on this topic. Thanks in advance!

Best,
David.

David

unread,
May 13, 2016, 7:19:57 AM5/13/16
to deal.II User Group
By the way, I've already run

cmake -DDEAL_II_WITH_PETSC = ON .

but it didn't work.

Ce Qin

unread,
May 13, 2016, 7:41:57 AM5/13/16
to dea...@googlegroups.com
I think you should rebuild deal.II with DEAL_II_WITH_PETSC = ON, DEAL_II_WITH_SLEPC = ON, and set the variable PETSC_DIR, PETSC_ARCH and SLEPC_DIR with proper value.

--

David

unread,
May 13, 2016, 8:11:21 AM5/13/16
to deal.II User Group
Hi, Ce Qin:

Thank you for your help.

Well, I don't understand why PETSc is turned off on the virtual machine. But one of the reason I use the dealii virtual mechiane is
that I don't have to install it by myself, which, I think, is a tough task for me. So I am wondering whether there is any other
option for me to change this configuration.

Best,
David.

Tobi Young

unread,
May 13, 2016, 8:12:21 AM5/13/16
to dealii
Ce Qin is correct here. Try to rebuild deal.II from scratch after
setting PETSC_DIR, PETSC_ARCH, and SLEPC_DIR. Instructions to do that
are on the deal.II website.
Check that deal.II has found PETSc and SLEPc in the output after
running cmake. Rebuild and then run "make test" and see if the PETSc
and SLEPc tests are included and pass.
Then you should be good to go.

Best,
Tobi

Bruno Turcksin

unread,
May 13, 2016, 8:17:35 AM5/13/16
to deal.II User Group
David,


On Friday, May 13, 2016 at 8:11:21 AM UTC-4, David wrote:

Well, I don't understand why PETSc is turned off on the virtual machine.
PETSc is installed in the virtual machine. It's SELPC that is not installed. That's why you can't run the tutorial.

Best,

Bruno

Timo Heister

unread,
May 13, 2016, 10:39:04 AM5/13/16
to dea...@googlegroups.com
if you update to the newest virtual machine (released three days ago),
you will have slepc installed.
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Timo Heister
http://www.math.clemson.edu/~heister/
Reply all
Reply to author
Forward
0 new messages