Hi
I'm using deal.ii-8.0.0.
I'm trying to setup a parallel sparse matrix:
PETScWrappers::MPI::SparseMatrix system_matrix;
Until now I was working in 2D, so I had been initializing the matrix like this:
const types::global_dof_index n_local_dofs
= DoFTools::count_dofs_with_subdomain_association (dof_handler,
this_mpi_process);
system_matrix.reinit (mpi_communicator,
dof_handler.n_dofs (),
dof_handler.n_dofs (),
n_local_dofs,
n_local_dofs,
dof_handler.max_couplings_between_dofs());
I'm currently working on the 3D model. According to the documentation of the function max_couplings_between_dofs(), it shouldn't be used in a 3D case and in fact it throws an error if this is attempted. I'm trying to initialize the matrix in a similar way to step-40 (although it uses p4est for the grid). Like this:
IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs ();
CompressedSimpleSparsityPattern compressed_pattern (dof_handler.n_dofs());
DoFTools::make_sparsity_pattern (dof_handler,
compressed_pattern);
constraints.condense (compressed_pattern);
SparsityPattern sp;
sp.copy_from (compressed_pattern);
system_matrix.reinit (locally_owned_dofs,
locally_owned_dofs,
sp,
mpi_communicator);
But when I compile I receive an error like this:
undefined reference to `void dealii::PETScWrappers::MPI::SparseMatrix::reinit<dealii::SparsityPattern>(dealii::IndexSet const&, dealii::IndexSet const&, dealii::SparsityPattern const&, ompi_communicator_t* const&)'
make: *** [trl_3d_petsc_03_03_2014] Error 1
Is it related with the fact that I'm not using p4est? If so, which would be the correct way to reinit the matrix? Maybe using this other reinit function?
PETScWrappers::MPI::SparseMatrix::SparseMatrix
( const MPI_Comm & communicator,
const SparsityType & sparsity_pattern,
const std::vector< size_type > & local_rows_per_process,
const std::vector< size_type > & local_columns_per_process,
const unsigned int this_process,
const bool preset_nonzero_locations = true )
Best Regards
javier
--
José Javier Muñoz Criollo
PhD Student | Cardiff University School of Engineering
E-mail:
josejm...@gmail.com