Dear Wolfgang,

Thank you a lot for the explanation, I got PETSc preinstalled already and 
didn't have a chance to see there were different compiling options. Now 
it's clear!

Anyway, I ran into a further issue with my script that I wanted to 
parallelize. I am dealing with non spd matrices in terms of a mixed 
displacement-pressure formulation problem. I decided to use MUMPS direct 
solver, as I cannot come up with a reasonable preconditioner for an 
iterative solver. I have a block matrix structure and was trying to solve 
the system via:

*PETScWrappers::SparseDirectMUMPS solver(solver_control, mpi_communicator);*
*solver.solve(system_matrix, completely_distributed_solution, system_rhs);*

But I receive an error:


*error: cannot convert ‘dealii::LinearAlgebraPETSc::MPI::BlockSparseMatrix’ 
{aka ‘dealii::PETScWrappers::MPI::BlockSparseMatrix’} to ‘const 
dealii::PETScWrappers::MatrixBase&’  925 |    solver.solve(system_matrix, 
completely_distributed_solution, system_rhs);*
 
I checked the member function documentation for the solve() function of 
MUMPS and found only the solve() function that depends on the *const 
MatrixBase, *but I guess in my case *const* *BlockMatrixBase *would make 
more sense. 

Could you please tell me, whether there is a way to go about it? 

Thank you a lot for your support and time!

With kind regards,
Mariia Bronzova
вторник, 18 января 2022 г. в 01:27:13 UTC+1, Wolfgang Bangerth: 

>
> Mariia,
>
> > I was trying to make adjustments in my script to enable parallel 
> computing (as 
> > it takes unbearably long to calculate it even for small problems due to 
> big 
> > sparsity matrix, I guess).
> > 
> > In my script I am using block matrices and vectors with complex elements 
> > (i.e. BlockSparseMatrix<std::complex<double>>). I discovered that 
> > *LA::MPI::BlockSparseMatrix<std::complex<double>> system_matrix* returns 
> an 
> > error while running the script (error: 
> > ‘dealii::LinearAlgebraPETSc::MPI::BlockVector’ {aka 
> > ‘dealii::PETScWrappers::MPI::BlockVector’} is not a template
> >   149 |     LA::MPI::BlockVector<std::complex<double>> 
> > locally_relevant_solution;), whereas *LA::MPI::BlockSparseMatrix 
> > system_matrix* works just fine.
> > 
> > Could you please give me a hint on how to possibly fix this issue?
>
> There is no issue to fix. The class is not a template, so
> LA::MPI::BlockSparseMatrix
> is the correct syntax, and
> LA::MPI::BlockSparseMatrix<std::complex<double>>
> is wrong.
>
> The underlying issue is that you choose the type to be used for vectors 
> and 
> matrices in PETSc at the time you compile PETSc. This is different from 
> deal.II and Trilinos classes, where you choose the type whenever you 
> create a 
> variable in your own code. If you compile PETSc with default options, 
> vector 
> and matrix entries are always 'double'. If you want anything else, you 
> have to 
> say so when you compile PETSc.
>
> Best
> W.
>
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: [email protected]
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/1981ff9e-0d76-492d-963b-7e8d28711625n%40googlegroups.com.

Reply via email to