[deal.II] Solving block system

48 views
Skip to first unread message

陈敏

unread,
Apr 6, 2022, 4:37:29 AM4/6/22
to dea...@googlegroups.com
Hi everyone,

I have a question on the solving of the block system that can solve a block system without providing any preconditioner when using an iterator solver?
for example, PETScWrappers::PreconditionNone()?
Here is an error when I used the SolverFGMRES with PreconditionNone.
code:
LA::MPI::BlockSparseMatrix   system_matrix;
LA::MPI::BlockVector   system_rhs, solution; 

SolvorFGMRES<LA::MPI::Block> solver(solver_control); 
 solver.solve(system_matrix, solution, system_rhs, PETScWrappers::PreconditionNone());
error:
/path/to/include/deal.II/lac/solver_hmres.h:1245:11: error: cannot comvert 'dealii::PETScWrappers::MPI::BlockVector' to'dealii::PETScWrappers::VectorBase&' 
 1234    preconditioner.vmult(z(j,x),v[j]);

Could anyone help me out?
Thank you!
Best,
chen 

SebG

unread,
Apr 6, 2022, 5:27:35 AM4/6/22
to deal.II User Group
Dear Chen,

in the class PETScWrappers::PreconditionNone the method vmult is only defined for vectors of the type PETScWrappers::VectorBase. The class PETScWrappers::MPI::BlockVector however is not inherented from PETScWrappers::VectorBase but from BlockVectorBase< VectorType >. Therefore, your code does not compile. Instead of using a block linear system you could just switch to a regular sparse matrix. Moreover, you need to initialize the PETScWrappers::PreconditionNone object after construction.

Best wishes,
Sebastian

Wolfgang Bangerth

unread,
Apr 6, 2022, 11:29:29 AM4/6/22
to dea...@googlegroups.com
On 4/6/22 02:36, 陈敏 wrote:
>  solver.solve(system_matrix, solution, system_rhs,
> PETScWrappers::PreconditionNone());
>

Can you try to use PreconditionIdentity() instead?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

陈敏

unread,
Apr 8, 2022, 9:24:30 PM4/8/22
to dea...@googlegroups.com
Thanks, Wolfgang Bangerth
PreconditionIdentity() is worked.
Best,
chen

Wolfgang Bangerth <bang...@colostate.edu> 于2022年4月6日周三 23:29写道:
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/bfb8d2b7-419d-33fb-451f-b1e1476bd45b%40colostate.edu.
Reply all
Reply to author
Forward
0 new messages