Complex PetscScalar and distribute_local_to_global

34 views
Skip to first unread message

Juan Carlos Araujo Cabarcas

unread,
Apr 19, 2018, 9:12:06 AM4/19/18
to deal.II User Group
Dear all,

I have been using deal.II along with PETSc with complex arithmetics for some time now.
Usually, I solve eigenvalue problems: so I use the matrix version of (without the RHS)
constraints.distribute_local_to_global
and it works all good. However, now I tried for a problem with RHS and
it throws the error attached at the end of this email.

I have reached a few missing definitions with PetscScalar in the past, and I wonder if this could be a similar error: a missing definition/declaration?

The important code looks like:

PETScWrappers::SparseMatrix     system_matrix;
PETScWrappers::MPI::Vector        solution, system_rhs;

FullMatrix<PetscScalar>              cell_S (dofs_per_cell, dofs_per_cell);
Vector<PetscScalar>                        cell_rhs (dofs_per_cell);

constraints
.distribute_local_to_global (cell_S, cell_rhs,
                                             local_dof_indices
,
                                             system_matrix
, system_rhs);


Any help is greatly appreciated. Thanks in advance,
Juan Carlos Araújo, Umeå Universitet.


/dealii/include/deal.II/lac/constraint_matrix.h:1910: error: undefined reference to
'void ConstraintMatrix::distribute_local_to_global<PETScWrappers::SparseMatrix, PETScWrappers::MPI::Vector>(
        FullMatrix<PETScWrappers::SparseMatrix::value_type> const&,
        Vector<PETScWrappers::MPI::Vector::value_type> const&,
        std::vector<unsigned int, std::allocator<unsigned int> > const&,
        PETScWrappers::SparseMatrix&,
        PETScWrappers::MPI::Vector&,
        bool,
        std::integral_constant<bool,
        false>) const'
       
collect2: error: ld returned 1 exit status
make[2]: *** [DtN_TM_1D] Error 1
make[1]: *** [CMakeFiles/DtN_TM_1D.dir/all] Error 2
make: *** [all] Error 2

Bruno Turcksin

unread,
Apr 19, 2018, 9:27:39 AM4/19/18
to deal.II User Group
Hi,


On Thursday, April 19, 2018 at 9:12:06 AM UTC-4, Juan Carlos Araujo Cabarcas wrote:

I have reached a few missing definitions with PetscScalar in the past, and I wonder if this could be a similar error: a missing definition/declaration?

This should be easy to check. What happens when you include <deal.II/lac/constraint_matrix.templates.h>? If it works then the explicit instantiation is missing.

Best,

Bruno

Juan Carlos Araujo Cabarcas

unread,
Apr 19, 2018, 9:46:51 AM4/19/18
to deal.II User Group
Thanks a lot, it worked ...
Reply all
Reply to author
Forward
0 new messages